Created
January 30, 2020 22:36
-
-
Save lmazuel/be0b03d67ea8c9b003714d2e57c4db72 to your computer and use it in GitHub Desktop.
azure-identity and new autorest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.identity import ClientSecretCredential | |
from azure.mgmt.storage import StorageManagementClient | |
def get_credentials_identity(): | |
subscription_id = os.environ.get( | |
'AZURE_SUBSCRIPTION_ID', | |
'11111111-1111-1111-1111-111111111111') # your Azure Subscription Id | |
credentials = ClientSecretCredential( | |
client_id=os.environ['AZURE_CLIENT_ID'], | |
client_secret=os.environ['AZURE_CLIENT_SECRET'], | |
tenant_id=os.environ['AZURE_TENANT_ID'] | |
) | |
return credentials, subscription_id | |
def run_example(): | |
credentials_identity, subscription_id = get_credentials_identity() | |
storage_client = StorageManagementClient(credentials_identity, subscription_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment