Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment Script Error: Set-AzKeyVaultSecret #131

Open
samuel990705 opened this issue Aug 19, 2020 · 4 comments
Open

Deployment Script Error: Set-AzKeyVaultSecret #131

samuel990705 opened this issue Aug 19, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@samuel990705
Copy link

Having an error with the 2 lines of Set-AzKeyVaultSecret on lines 547 and 548 regarding KeyVaults:

  • "Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name 'appid' -SecretValue (ConvertTo-SecureString -String $global:appId -AsPlainText -Force) | Out-Null"
  • "Set-AzKeyVaultSecret -VaultName $KeyVaultName -Name 'appsecret' -SecretValue (ConvertTo-SecureString -String $global:appSecret -AsPlainText -Force) | Out-Null"

The same error is thrown:
"Set-AzKeyVaultSecret : Operation returned an invalid status code 'Forbidden'"
SharedScreenshot

Note the 2 warnings prior to the errors. There were no errors prior to this.

Thank you!

@alexc-MSFT alexc-MSFT added the bug Something isn't working label Aug 19, 2020
@alexc-MSFT alexc-MSFT self-assigned this Aug 19, 2020
@samuel990705
Copy link
Author

samuel990705 commented Aug 21, 2020

Hi @alexc-MSFT , any updates on the issue?

@alexc-MSFT
Copy link
Member

@samuel990705 this is odd - i've not seen this before. What permissions do you have on the azure subscription just out of interest?

@samuel990705
Copy link
Author

@alexc-MSFT If I'm not mistaken, I am a global administrator. I have been able to run these lines without errors before, I'm unsure why they are being thrown now. I have tried deleting the key vault and rerun, as well as just creating an entirely new key vault (with a different name).
Screen Shot 2020-08-24 at 10 18 53 AM

@samuel990705
Copy link
Author

samuel990705 commented Aug 27, 2020

@alexc-MSFT It seems like this is the only issue I am having. The script runs to completion afterwards. I can see that the Key Vault is still being created. Could I manually add the keyvault secret? Was the " Set-AzKeyVaultAccessPolicy" meant to come before?

It seems to have something to do with my permissions for the keyvault.
SharedScreenshot12

Although I am listed as an owner of the keyvault
SharedScreenshot13

Also, does it matter that my Azure AD tenant ID is different from my Teams' tenant ID? I have run into problems with other custom apps on teams for this reason before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants