Reputation: 1591
I am trying to add a Keyvault with PowerShell. I am always getting below two warnings while creating this. Though the vault is getting created successfully but, but want to understand how can I elminiate this warnings?
New-AzKeyVault -VaultName "kvxxxxxxxxxxx" `
-ResourceGroupName "RG-xxxx" -Location "South Central US"
WARNING: The provided information does not map to an AD object id.
WARNING: Access policy is not set. No user or application have 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.
Upvotes: 0
Views: 997
Reputation: 42063
I can reproduce your issue on my side. The two WARNING
s were caused by your account is a Personal Account/Microsoft account
(e.g. outlook, hotmail account) in your Azure AD tenant, your user type
is Guest
.
Actually you can just ignore them, or use the -WarningAction Ignore
parameter as mentioned in the comment.
When using a work account/member user type to create a keyvault, it will add the account which used to create the keyvault to the access policy of the keyvault automatically. In your case, you could use the command Set-AzKeyVaultAccessPolicy
to set the access policy after creating the keyvault.
Upvotes: 4