Skip to content

Commit

Permalink
azure_fence.py: fix managed identity authentication (ClusterLabs#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyTobi authored Jan 31, 2025
1 parent 03c599c commit 5d9d6a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/azure_fence.py.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ def get_azure_credentials(config):
if config.UseMSI:
try:
from azure.identity import ManagedIdentityCredential
credentials = ManagedIdentityCredential(identity_config={"resource_id": cloud_environment["resource_manager"]})
credentials = ManagedIdentityCredential(authority=cloud_environment["authority_hosts"])
except ImportError:
from msrestazure.azure_active_directory import MSIAuthentication
credentials = MSIAuthentication(cloud_environment=cloud_environment["cloud_environment"])
return
return credentials

try:
# try to use new libraries ClientSecretCredential (azure.identity, based on azure.core)
Expand Down

0 comments on commit 5d9d6a9

Please sign in to comment.