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

Fix: Authentication Issue: azure.azcollection.azure_rm_storageblob Fails with Disabled Shared Keys #1564

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,12 @@ def get_blob_service_client(self, resource_group_name, storage_account_name, aut
account = self.storage_client.storage_accounts.get_properties(resource_group_name=resource_group_name, account_name=storage_account_name)
if auth_mode == 'login' and self.azure_auth.credentials.get('credential'):
credential = self.azure_auth.credentials['credential']
elif (auth_mode == 'login' and self.azure_auth.credentials.get('tenant')
and self.azure_auth.credentials.get('client_id')
and self.azure_auth.credentials.get('secret')):
credential = client_secret.ClientSecretCredential(tenant_id=self.azure_auth.credentials.get('tenant'),
paronbol marked this conversation as resolved.
Show resolved Hide resolved
client_id=self.azure_auth.credentials.get('client_id'),
client_secret=self.azure_auth.credentials.get('secret'))
else:
account_keys = self.storage_client.storage_accounts.list_keys(resource_group_name=resource_group_name, account_name=storage_account_name)
credential = account_keys.keys[0].value
Expand Down