Charlie Nash
12/01/2025, 5:01 PMTask run failed with exception: ResourceNotFoundError('The specified container does not exist.\nRequestId:84e44cab-801e-005c-71dc-623316000000\nTime:2025-12-01T16:09:16.5744514Z\nErrorCode:ContainerNotFound') - Retries are exhaustedMarvin
12/01/2025, 5:01 PMMarvin
12/01/2025, 5:02 PMimport os
from azure.storage.blob import BlobServiceClient
def debug_azure():
container = os.getenv("AZURE_BLOB_CONTAINER")
conn = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
acct = os.getenv("AZURE_STORAGE_ACCOUNT_NAME")
key = os.getenv("AZURE_STORAGE_ACCOUNT_KEY")
print(f"Resolved container={container!r}, account={acct!r}")
if conn:
svc = BlobServiceClient.from_connection_string(conn)
elif acct and key:
svc = BlobServiceClient(account_url=f"https://{acct}.<http://blob.core.windows.net|blob.core.windows.net>", credential=key)
else:
raise RuntimeError("No Azure credentials found (connection string or account/key).")
print("Containers visible from this pod:")
for c in svc.list_containers():
print(" -", c['name'])
# Will raise if the container truly doesn't exist or is inaccessible
svc.get_container_client(container).get_container_properties()
print("Container exists and is accessible from the pod.")
4) Ensure the container creation behavior is consistent
- If your local run creates the container when missing, ensure the same code path and permissions are used in-cluster. If you rely on pre-created infra, confirm the container exists in the exact target account.
5) Prefect/Kubernetes specifics
- If you’re using a Prefect Kubernetes work pool: make sure your job template (or deployment) passes the required env vars to the flow’s pod.
- If you’re using private endpoints or storage firewall rules: confirm the cluster can resolve/reach the blob endpoint and is allowed by the storage account network rules.
If you can share a bit more, I can be more specific:
- Prefect version (assuming 3.x unless you say otherwise) and how you’re running (Kubernetes work pool? Custom job template?).
- How you authenticate to Azure from the pod (connection string, account key, SAS, workload identity).Marvin
12/01/2025, 5:02 PM