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

Admin User access policy setup error #7

Open
Laxman-SM opened this issue Jan 17, 2020 · 1 comment
Open

Admin User access policy setup error #7

Laxman-SM opened this issue Jan 17, 2020 · 1 comment

Comments

@Laxman-SM
Copy link

Hi,

Without Azure AD we can't use this script, also this create resources on every execution.

WARNING: The provided information does not map to an AD object id.
WARNING: Access policy is not set. No user or application has access permission to use this vault. This can happen if the vault was created by a service principal. Please use Set-AzKeyVaultAccessPolicy to set access policies.
SUCCESS!

Setting KeyVault Access Policy for Admin User: [TERRALADM].....................ERROR!
Set-AzKeyVaultAccessPolicy : Cannot validate argument on parameter 'ObjectId'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At /home/rubik/Desktop/DocumentM/terraform-azure/scripts/ConfigureAzureForSecureTerraformAccess.ps1:264 char:58

  • ... olicy -BypassObjectIdValidation @azKeyVaultAccessPolicyParams | Out-S ...
  •                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidData: (:) [Set-AzKeyVaultAccessPolicy], ParameterBindingValidationException
  • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.KeyVault.SetAzureKeyVaultAccessPolicy
@adamrushuk
Copy link
Owner

Hi Laxman,

Without Azure AD we can't use this script

Correct. You will need to provide an Azure AD Admin username for this script to work in it's current form. How would you like this to work instead?

also this create resources on every execution.

This script is not idempotent, so you will need to do some cleanup if it fails for some reason.
I mainly use Azure CLI now, as most commands are idempotent.

If you wish to add these changes, I will accept PRs.

Cheers,
Adam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants