Skip to content
Latchkey

az storage blob upload: Upload to Blob in CI

Upload a local file to a container in Azure Blob Storage.

az storage blob upload pushes a single file into a blob container. In CI it stores artifacts, static assets, or reports. Authentication is via account key, SAS token, or --auth-mode login using your az login identity.

Common flags

  • --account-name ACCOUNT and -c CONTAINER - target storage
  • -f FILE and -n BLOB - local file and destination blob name
  • --auth-mode login - use the logged-in identity instead of a key
  • --overwrite - replace an existing blob

Example in CI

Upload a build artifact using the logged-in identity.

shell
az storage blob upload \
  --account-name mystorage -c artifacts \
  -f dist.tar.gz -n builds/${GITHUB_SHA}.tar.gz \
  --auth-mode login --overwrite

Common errors in CI

  • AuthorizationPermissionMismatch - identity lacks Storage Blob Data Contributor (with --auth-mode login)
  • The specified container does not exist - wrong container name
  • BlobAlreadyExists - destination exists and --overwrite was not passed

Key takeaways

  • Uploads a single file to a Blob Storage container.
  • Prefer --auth-mode login over account keys when the identity has data roles.
  • Grant Storage Blob Data Contributor to avoid permission-mismatch errors.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →