azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

The "Get-AzKeyVault" but not returning as expected on Azure CLI even on the latest version of az

Open Papad2005 opened this issue 1 year ago • 3 comments

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

Papad2005 avatar Jul 11 '24 11:07 Papad2005

try this https://github.com/Azure/azure-powershell/issues/24967

rach1tarora avatar Jul 12 '24 16:07 rach1tarora

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.

isra-fel avatar Aug 26 '24 02:08 isra-fel

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.