-
Notifications
You must be signed in to change notification settings - Fork 3k
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
calling ad sp credential list returns empty #21195
Comments
@jiasli for awareness |
I will keep this in mind and take a look during Microsoft Graph migration. |
I suspect that I am hitting this issue. The output of I need to figure out in advance which cluster credentials need to be reset soon. After wrestling with the ms graph API for a while (filtering should not be that hard, right) I decided to give the updated az-cli a try. az ad sp show --id $SP_ID
# ...
# "passwordCredentials": [
# {
# "endDateTime": "2022-02-16T17:55:54.2217355Z",
# "keyId": "...",
# "startDateTime": "2021-02-16T17:53:08.7185779Z"
# }
# ], The credentials are already reset, but all I can see are the original ones. This is not exactly ideal, any ways to get around this problem? These docs are no longer up to date too: https://docs.microsoft.com/en-us/azure/aks/update-credentials#check-the-expiration-date-of-your-service-principal |
The issue is from Graph api because by using powershell you'll see the same issue.
If it's empty then use
|
Thanks, I didn't think of this. Its decent as far as workarounds go :) |
I encounter the same issue, is any updates? {
"azure-cli": "2.38.0",
"azure-cli-core": "2.38.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"aks-preview": "0.4.67",
"application-insights": "0.1.13",
"ssh": "1.0.0"
}
}
|
@tonystz, which issue did you encounter? |
Hello. I also get empty response on When I search for the service principal in portal, I was able to found the expiry info and obfuscated secret under AAD->Apps Registrations->Certificates and Secrets
EDIT: I was able to get the information using
or
Where id is to be found using
|
Azure Portal can only show app's credential, not service principal's. Use |
The docs for az ad sp credential say:
Which is not correct if |
This issue still appears to be occurring with the latest version. Even alternatives |
An additional complication I have noticed while investigating this is that it takes a while after I use With the hidden/undiscoverable nature of sp-specific credentials. the misleading documentation and the lag before changes display in the portal, Microsoft couldn't have designed a more confusing and frustrating system if they tried! |
When calling az ad sp credential list it returns empty value but after renewing a password for the first time it shows the correct value.
To Reproduce
Create a spn and then call
then renew a password for the spn and call the above command again
Expected behavior
It should show the expiry date of spn before renewing the password.
After further investigation I noticed the command is calling below url:
'https://graph.windows.net/tenant/applications/{objectid}/passwordCredentials?api-version=1.6'
which is the same url for az ad app credential.
It should call
'https://graph.windows.net/tenant/serviceprincipals/{objectid}/passwordCredentials?api-version=1.6'
What's more ,if url of serviceprincipal is called it doesn't return the latest expiry date after renewing the password which is another issue.
azure-cli 2.32.0
The text was updated successfully, but these errors were encountered: