Azure Python code snippets

Azure Python code snippets

# Python SDK needs these for symmetric service principal authN
os.environ['AZURE_TENANT_ID'] = '...'
os.environ['AZURE_CLIENT_ID'] = '...'
os.environ['AZURE_CLIENT_SECRET'] = '...'

# Want to have all TLS traffic man-in-the-middle-intercepted by Fiddler
os.environ['HTTP_PROXY'] = 'http://127.0.0.1:8888/'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:8888/'
os.environ['ADAL_PYTHON_SSL_NO_VERIFY'] = '1'
os.environ['CURL_CA_BUNDLE'] = ''  # https://stackoverflow.com/questions/48391750/disable-python-requests-ssl-validation-for-an-imported-module

credential = DefaultAzureCredential(logging_enable=true)

Last updated