-
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
Document --sdk-auth as deprecated #20743
Comments
This is actually a problem of the document: MicrosoftDocs/azure-docs-cli#2720.
@N-Usha, @kaverma, perhaps you can help with the removal of |
Just ran into this now. Also, how do we go about resetting a service principal credential? Running 'az ad sp credential reset' returns the non 'sdk-auth' format which does not work with GitHub actions. |
@andersson09, you may manually translate the result of |
We were using the Could someone point us at the suggested new syntax instead of For reference: inlets/inletsctl#116 |
You may simply use the original output without |
Hi, I ran into this issue as well. The original output is missing subscription id. Given a service principal is tied to a subscription id and having that id is required to authorize against the Python SDK it's nice to have in the json credential file. Is this something that can be added to the original output before --sdk-auth is removed? Also, the key names all change which makes it harder to support both types. Is there a reason to not use the same key names? I also ran into the issue with permissions disappearing. Previously a principal was created as a Contributor by default I assume. As it had permissions by default. Now it seems this is required as --role but this change is not communicated. Additionally it would be nice to set explicit permissions such as:
Is this something that's possible? |
I created a separate request related to the missing subscription id #21693 |
@jiasli The format returned without --sdk-auth doesn't work with Github Actions azure/login@v1. Not sure which keys exactly it needs that are missing. |
Please refer to this documentation for the above- https://github.com/azure/login#configure-a-service-principal-with-a-secret |
@BALAGA-GAYATRI Thanks for that! As sdk-auth is clearly still useful, why is it being deprecated? Seems like a nice shortcut to have versus building the object manually. I'd sure feel better about using it if the deprecated warning would be removed. |
But there is no way to get the desired output for an existing SP. As well, this is impactful not only for the azure/login task, but for any boilerplate which leveraged the secret in a workflow alongside it; e.g., terraform azure module login with key values provided from the same secret. This could have ramifications in the event of need for a credential reset, extending downtime if unaware of the appid -> clientId (and so on) mapping. |
@codytipton-hpg If you call "az ad sp create-for-rbac" on an existing SP with a scope/role it already has, it will patch it, not changed anything, and return the output needed. One thing I have found difficult though is that sometimes I get an error message instead of a result, depending on what scopes I apply. If I just apply a management group for instance, then I get an error instead of a result. It seems to need a subscription scope, and even if I include both a MG and a subscription sometimes it still fails. Also when you do this, it seems the old secret is invalidated so any pipelines using it now need the new credentials to continue working. |
No, that doesn't work with the
Yes. As noted in Azure/login#205 (comment), without the
|
The docs on Quickstart: Deploy Bicep files by using GitHub Actions recommend using az ad sp create-for-rbac --name {app-name} --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/exampleRG --json-auth That said, it generates this warning anyway, so it just adds to the confusion in my opinion.
|
They need to document using federated credentials better and make that the recommended approach |
Really wish this was documented. I was real confused trying to figure out how to reset and get the new json similar to the originally created output until I found this helpful post. |
In #19949 we can read
This has been/is used by many build systems, and it's still documented without any hint of being deprecated
on https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest#az_ad_sp_create_for_rbac
So think this needs to be clearly documented there, and what should be used instead with i.e. GitHub Action for Azure CLI which has this documented as their preferred way
https://github.com/Azure/cli#configure-azure-credentials-as-github-secret
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: