azure-powershell
azure-powershell copied to clipboard
The "Get-AzKeyVault" but not returning as expected on Azure CLI even on the latest version of az
Description
Hello Team,
I have a cx query the "Get-AzKeyVault" but not returning as expected on Azure CLI.
The cmd “Get-AzKeyVault -ResourceGroupName $ccoeKvResourceGroupName -VaultName $ccoeKeyVaultName -SubscriptionId $ccoeKvSubscriptionId” returned with error to Connect-AzAccount with the service principal.
It should pick the subscription as stated in the variables but doesn't it only works when we force it and actually specify the subscription again in the variables .
"Connect-AzAccount -ServicePrincipal -TenantId $Tenantid -Credential -Subscription "belfius-spoke-dev-001" which return as expected.
Get-AzKeyVault (Az.KeyVault) | Microsoft Learn
Thanks for your assistance.
Script or Debug output
No response
Environment data
No response
Module versions
No response
Error output
No response
try this https://github.com/Azure/azure-powershell/issues/24967
It could be an issue with WAM - fixed, please try the latest version.
Also worth noting that if -Subscription doesn't allow specifying subscription not in the current tenant. Run Get-AzContext to get the active tenant. Set-AzContext to switch to another.
Hi @Papad2005. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.
Hi @Papad2005, since you haven't asked that we "/unresolve" the issue, we'll close this out. If you believe further discussion is needed, please add a comment "/unresolve" to reopen the issue.