azureairflowazure-blob-storage

Airflow Connection: How to create an airflow connection to Azure Blob Storage using Service Principal?


I followed this doc to attempt to create an Azure Blob Storage connection. I believe for my case, I am looking to connect via token credentials.

However I get an error when trying to save with no error message. I'm a bit confused on whether I am providing client_id, tenant_id, client_secret, sub_id, etc. in the appropriate location as the UI doesn't specify those exact words except for tenant id. In the blob storage key (optional) input I have provided the client secret, and blob storage login (optional) holds the account name. For the extra section, do the values need to follow "extra__azure__..."?

Any suggestion are highly appreciated!

enter image description here

I am able to connect to the Blob Storage via azure cli. Airflow version is 2.4.3 running on Kubernetes as a Docker container.


Solution

  • To connect airflow with service principal to azure blob storage.

    -- Application Client ID

    -- Tenant ID

    -- Client secret

    -- Connection Id : Enter a name for the connection.

    -- Account Name : Enter Blob Service URL for your storage account. eg. https://mystorageaccount.blob.core.windows.net/

    -- Blob Storage Login : Enter your Application (client) ID.

    -- Blob Storage Key : Enter your client secret Value.

    -- Tenant Id : Enter your Directory (tenant) ID.

    REFERENCE : Create an Azure Blob Storage connection in Airflow