Immutable solution version
Azure Blob Storage in Go: azblob client with identity auth
Complete solution
The Go azblob SDK splits clients per operation type and the auth story is different: NewClient with azidentity, SAS builders, and no connection-string helpers in some versions.
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)Go-specific traps:
- Module split. azblob lives in
sdk/storage/azblob, identity insdk/azidentity. Version-skew between the two modules breaks auth in confusing ways; pin both and upgrade together. - No fromconnectionstring in newer versions. If you are porting Python/Node code that used a connection string, the Go path is
NewClientWithSharedKeyCredentialor 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.
Verify with client.NewContainerClient("[container]").NewBlobClient(...) then a download round-trip comparing bytes.
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 1 · 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>