How to connect to Azure Blob Storage in Airflow connections

Nandini T 0 Reputation points

Hi Team, I am connecting to Azure Blob storage from Airflow UI connections using Active Directory Auth and sas_token. When I use Wasb_hook inbuilt method for checking file-prefix getting Azure.core.exeptions.ResourceNotFoundError:Not Found error. I think the Azure connection is using Default Azure credentials. Could you please tell how to pass Azure storage account name when using wasb_hook and how to resolve Resource not found error.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,424 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 18,352 Reputation points Microsoft Employee

    @Nandini T The ResourceNotFoundError often occurs when the access level of your container is set to Private, restricting access.

    To resolve this, consider changing the access level of your container:

    -In the Azure Portal, navigate to your storage account.

    -Click on the Blob service section.

    -Select the specific Blob or Container you want to modify.

    -Adjust the Access policy to allow either Blob or Container access based on your requirements.

    When using the Wasb_hook, you need to provide the storage account name explicitly. The hook expects the following parameters: wasb_conn_id: The connection ID for your Azure Blob storage. container_name: The name of the container. account_name: The Azure storage account name. sas_token: The Shared Access Signature (SAS) token (if applicable).

    0 comments No comments