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

removed subscription_id from azure_keyvault_secret lookup when using az cli auth #1175

Merged
merged 5 commits into from
Aug 22, 2023

Conversation

msl0
Copy link
Contributor

@msl0 msl0 commented May 31, 2023

Added support for Azure CLI authentication without subscription ID in azure_keyvault_secret lookup plugin, fixes #1174

msl0 added 2 commits May 31, 2023 22:38
Added Azure CLI support
Updated documentation
Removed subscription_id from examples
@Fred-sun
Copy link
Collaborator

Fred-sun commented Jun 2, 2023

@msl0 I recommend adding support for "az login" credentials, as there are users using this plugin even through az login! Thanks!

@Fred-sun Fred-sun added medium_priority Medium priority work in In trying to solve, or in working with contributors labels Jun 2, 2023
@msl0
Copy link
Contributor Author

msl0 commented Jun 2, 2023

@Fred-sun support for "az login" is included. DefaultAzureCredential() supports multiple authentication scenarios. It can use credentials from environment variables and works with managed identity, identity currently logged in to the Azure CLI and PowerShell

@Fred-sun
Copy link
Collaborator

Fred-sun commented Jun 3, 2023

@msl0 Ok, I'll test it out as soon as possible! Thanks!

@Fred-sun
Copy link
Collaborator

Fred-sun commented Jul 6, 2023

@msl0 There is a conflict in the file you submitted. Can you fix it?

@msl0
Copy link
Contributor Author

msl0 commented Jul 6, 2023

@Fred-sun fixed and then tested once again

@msl0
Copy link
Contributor Author

msl0 commented Jul 19, 2023

@Fred-sun did you have a chance to take a look at my PR?

plugins/lookup/azure_keyvault_secret.py Outdated Show resolved Hide resolved
plugins/lookup/azure_keyvault_secret.py Outdated Show resolved Hide resolved
@Fred-sun
Copy link
Collaborator

@msl0 Being tested. Thank you!

@Fred-sun

This comment was marked as resolved.

@Fred-sun
Copy link
Collaborator

@msl0 Everything else is fine, But there's one sanity test that always has a problem, you can't find the cause. Can you adjust the location of 'import logging'? Avoid this mistake. Please change line 121 below line 118. Thank you!

ERROR: plugins/lookup/azure_keyvault_secret.py:134:0: traceback: NameError: name 'logging' is not defined

@msl0
Copy link
Contributor Author

msl0 commented Jul 23, 2023

@Fred-sun Thank you! I changed the import order if that's what you meant. But I don't fully understand the problem. I didn't notice anything when testing the change locally so maybe there is some problem with the test

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged and removed work in In trying to solve, or in working with contributors labels Jul 24, 2023
@xuzhang3 xuzhang3 merged commit 89cbfd9 into ansible-collections:dev Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azure_keyvault_secret lookup plugin doesn't work without subscription_id with az cli authentication
3 participants