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

Authentication with Azure CLI #1284

Closed
architshukla opened this issue Jul 10, 2021 · 4 comments · Fixed by #1365
Closed

Authentication with Azure CLI #1284

architshukla opened this issue Jul 10, 2021 · 4 comments · Fixed by #1365
Labels

Comments

@architshukla
Copy link

Feature request to add support for getting AAD access tokens using Azure CLI.

Justification
The tedious library supports Azure Managed Identity, which removes the need to manage credentials in production applications and moves that responsibility to the platform. This feature request would extend this "credential-less" access to a developer's local environment.
Typically, developers are logged in with Azure CLI and libraries like @azure/ms-rest-nodeauth and @azure/identity can use it to retrieve access tokens instead of having their application manage credentials.

Proposed changes

  1. Add a new authentication type azure-active-directory-azure-cli.
  2. Use an appropriate library function to get credentials from Azure CLI. As tedious is using @azure/ms-rest-nodeauth right now, AzureCliCredentials will be used (sample usage).

I have got it to work and I'm willing to contribute this functionality if the justification makes sense.

Challenges

  1. I noticed that there is a plan for a major refactor for authentication with the end goal or removing a direct dependency on an authentication library. This seems like a long-term plan so this feature could be added in the interim.
  2. The first PR to refactor authentication types has been open for a bit so it would be helpful to understand how this change should be prioritized against that. If that is planned to be merged soon, this change can wait for it. Otherwise, this can go in first.
@MichaelSun90
Copy link
Contributor

Hi @architshukla, Thanks for this suggestion. We are also looking into migrating from the current ADD authentication lib to @azure/identity. Will have a discussion with the team. Hi Arthur @arthurschreiber, do you have any thoughts on this.

@pgraham
Copy link

pgraham commented Sep 15, 2021

Hi, now that v13 is release and has migrated to @azure/identity, being able to authenticate with AzureCliCredentials or DefaultAzureCredentials would be helpful in enabling credential-less auth for development tasks such as running tests against a database locally.

@aangelisc
Copy link

Hey @architshukla, how did you get this to work? Would you be able to provide a gist?

@github-actions
Copy link

🎉 This issue has been resolved in version 14.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants