Skip to content

Azure connector ignores cloud_environment value #65319

@sfirke

Description

@sfirke

Under which category would you file this issue?

Providers

Apache Airflow version

3.1.5

What happened and how to reproduce it?

I want to launch Azure Container Instances from Airflow. My problem is that I'm on the Azure US Government cloud, AzureUSGovernment. It has a different base URL for the endpoint, as does the Azure China sovereign cloud:

Cloud Auth (authority) Management (base_url)
AzurePublicCloud https://login.microsoftonline.com https://management.azure.com/
AzureUSGovernment https://login.microsoftonline.us https://management.usgovcloudapi.net/
AzureChina https://login.chinacloudapi.cn https://management.chinacloudapi.cn/

Thus my attempts produce an error:

ResourceNotFoundError: (SubscriptionNotFound)

Without an indication of what the problem is.

What you think should happen instead?

If I have cloud_environment set to AzureUSGovernment in the extra fields of the Airflow connection settings, Airflow should use that to set the correct endpoints.

Image

Operating System

Ubuntu 24.04

Deployment

Docker-Compose

Apache Airflow Provider(s)

microsoft-azure

Versions of Apache Airflow Providers

apache-airflow-providers-microsoft-azure==12.9.0

Anything else?

I will send a PR momentarily that I've verified fixes this problem in my deployment.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions