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

az identity show #3

Open
cpatil7 opened this issue Jun 19, 2020 · 0 comments
Open

az identity show #3

cpatil7 opened this issue Jun 19, 2020 · 0 comments

Comments

@cpatil7
Copy link

cpatil7 commented Jun 19, 2020

Hey,

While following the instruction as per below
https://github.com/HoussemDellai/aks-keyvault/blob/master/commands-identity.ps1

when trying to retrieve existing identity

If using AKS with Managed Identity, retrieve the existing Identity

If ($isAKSWithManagedIdentity -eq "true") {
echo "Retrieving the existing Azure Identity..."
$existingIdentity = az resource list -g $aks.nodeResourceGroup --query "[?contains(type, 'Microsoft.ManagedIdentity/userAssignedIdentities')]" | ConvertFrom-Json
$identity = az identity show -n $existingIdentity.name -g $existingIdentity.resourceGroup | ConvertFrom-Json
}

echo $existingIdentity, it will retrieve three entries as below

None None /subscriptions/xxxxxxxxxxxx/resourceGroups/MC_rg-demo01_aks-demo01_westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aks-demo01-agentpool None None westeurope None aks-demo01-agentpool None None None MC_rg-demo01_aks-demo01_westeurope None Microsoft.ManagedIdentity/userAssignedIdentities

None None /subscriptions/xxxxxxxxx/resourceGroups/MC_rg-demo01_aks-demo01_westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/kubedashboard-aks-demo01 None None westeurope None kubedashboard-aks-demo01 None None None MC_rg-demo01_aks-demo01_westeurope None Microsoft.ManagedIdentity/userAssignedIdentities

None None /subscriptions/xxxxxxxxxxxxxx/resourceGroups/MC_rg-demo01_aks-demo01_westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/omsagent-aks-demo01 None None westeurope None omsagent-aks-demo01 None None None MC_rg-demo01_aks-demo01_westeurope None Microsoft.ManagedIdentity/userAssignedIdentities

Idenity will throw error as below

$identity = az identity show -n $existingIdentity.name -g $existingIdentity.resourceGroup | ConvertFrom-Json
az: error: unrecognized arguments: kubedashboard-aks-demo01 omsagent-aks-demo01 MC_rg-demo01_aks-demo01_westeurope MC_rg-demo01_aks-demo01_westeurope

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

1 participant