fINTERACTIVE FIELD GUIDES
Azure service access25 / 30

Connect a Pod to Azure Blob Storage

Use AKS Workload ID and the Azure Storage SDK to authorize Blob data operations without account keys.

Learning status: Not practiced

Use Microsoft Entra Workload ID for a pod that needs Blob data. The pod authenticates as its federated identity; Azure Storage then authorizes that identity against the requested data operation.

Grant Blob data access

Assign the workload identity a data-plane role at the narrowest practical scope:

  • Storage Blob Data Reader for reading blobs.
  • Storage Blob Data Contributor when the workload must create, update, or delete blobs.

Assign the role to the managed identity's principal ID (object ID), not its client ID. A management-plane role such as Reader on the storage account does not grant access to blob contents.

Use the SDK

For example, a TypeScript application can use the Azure Identity and Blob Storage SDKs:

import { DefaultAzureCredential } from "@azure/identity";
import { BlobServiceClient } from "@azure/storage-blob";

const credential = new DefaultAzureCredential();
const service = new BlobServiceClient(
  `https://${storageAccountName}.blob.core.windows.net`,
  credential,
);
const container = service.getContainerClient(containerName);

for await (const blob of container.listBlobsFlat()) {
  console.log(blob.name);
}

In AKS, DefaultAzureCredential uses the Workload ID settings and projected token when the pod is configured for federation. Do not put an account key, client secret, or access token in the image or source code.

Check connectivity

If the storage account uses a private endpoint, make sure the AKS network can route to it and that the storage hostname resolves to the private endpoint address from the pod's network. Also check storage firewall and network rules. Diagnose authentication, the Blob data role, and networking as separate boundaries.

Sources: Authorize Blob access with Microsoft Entra ID, Get started with Azure Blob Storage and JavaScript, AKS Workload ID overview.