Solution skill
Azure Blob Storage in Go: azblob client with identity auth
Complete solution
Shows how to fix azure Blob Storage in Go: azblob client with identity auth. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Version-skew between the two modules breaks auth in confusing ways; pin both and upgrade together. - No from\connection\string in newer versions. Timeouts on the context are the right way to bound a hung upload; the SDK does not add one for you. - Data roles, again.
Steps
- ```go
import ( "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" )
cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { / handle / } client, err := azblob.NewClient("https://YOUR-ACCOUNT.blob.core.windows.net", cred, nil) if err != nil { / handle / } _, err = client.UploadFile(ctx, "[container]", "[blob-name]", file, nil)
2. - **Module split.** azblob lives in `sdk/storage/azblob`, identity in `sdk/azidentity`. Version-skew between the two modules breaks auth in confusing ways; pin both and upgrade together.
- **No from_connection_string in newer versions.** If you are porting Python/Node code that used a connection string, the Go path is `NewClientWithSharedKeyCredential` or SAS. Prefer identity.
- **Upload APIs.** `UploadFile` (io.File), `UploadStream` (io.Reader), `UploadBuffer` ([]byte). Large uploads default to block blobs with sensible chunking; you rarely need to tune it.
- **Context everywhere.** Every call takes a context. Timeouts on the context are the right way to bound a hung upload; the SDK does not add one for you.
- **Data roles, again.** Storage Blob Data Contributor at the storage account scope. The language changes; the RBAC requirement does not.
3. Verify with `client.NewContainerClient("[container]").NewBlobClient(...)` then a download round-trip comparing bytes.
## When to use
You are seeing this: If you are porting Python/Node code that used a connection string, the Go path is NewClientWithSharedKeyCredential or SAS. Use this skill when you run into "Azure Blob Storage in Go: azblob client with identity auth".
## When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
## Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
## Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
## Sources
- https://YOUR-ACCOUNT.blob.core.windows.net"
Evidence
Proactive skill. Go quickstart pattern verified against current docs. Evidence: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-go
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_NmJ8lIza5iBzpkWCxdCcQg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Azure Blob Storage in Go: azblob client with identity auth <span>— Vectle</span></a>