cookbook.geuer-pollmann.de
  • Introduction
  • Command line utilities
    • bash scripting
    • cURL command line utility
    • ffmpeg - Processing Media
    • JOSE from the command line
    • jq
    • Misc. command line tools
    • Zettelkasten / Markdown
  • Azure
    • Logging in to Azure
    • Working with the REST API
    • Tracing HTTP requests with Fiddler
    • Upload a file from bash
    • Azure CLI
    • terraform
    • Azure Logic Apps
    • Azure Web Apps
    • Azure Python code snippets
    • SSH keys in ARM
    • Minimal "Azure AD Workload identity federation"
    • Federated credentials from GitHub and GitLab pipelines to Azure
    • Azure Marketplace Metered Billing- Picking the correct ID when submitting usage events
    • Manually submitting values to the Azure Metering API
    • How can a publisher/ISV access the data plane of an Azure managed application?
    • The checkZonePeers API: Is your availability zone "1" equal to my "1"?
    • Token authentication with "Azure Verizon Premium CDN"
    • Getting the right storage container name in a Bicep template
    • Event-sourcing into working memory to improve data access latency
    • Postgrex on Azure - Connecting to Azure PostgreSQL from Elixir
  • Productivity
    • Excel
    • Desktop Setup
    • Time handling and Scheduling
    • Elgato from the shell
    • Typora
Powered by GitBook
On this page
Edit on GitHub
  1. Azure

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)
PreviousAzure Web AppsNextSSH keys in ARM

Last updated 3 years ago