Anirudh B
Anirudh B

Reputation: 39

Azure SAS Token issues

Can these issues be sorted out or any feedback comments welcome.

Upvotes: 0

Views: 1007

Answers (1)

Jim Xu
Jim Xu

Reputation: 23141

If you want to upload large amounts of files to Azure blob and it will spend lots of time, I suggest you use Azure AD Authentication. It may be a better way. And, Azcopy supports multiple Azure AD Authentication ways, such as managed identity, User, Service principal. But, please note that no matter which method you use, you need to assign Storage Blob Data Contributor for them. For more details, please refer to the document

For example, I use a service principal

  1. create a service principal and assign Reader role for the sp.
az login
az account set --subscription "<your subscription id>"
# it will assign Storage Blob Data Contributor to the sp at subscription level
az ad sp create-for-rbac -n "mysample" --role Storage Blob Data Contributor

enter image description here

  1. Azcopy login with Powershell
$env:AZCOPY_SPA_CLIENT_SECRET="$(Read-Host -prompt "Enter key")"
azcopy login --service-principal --application-id <application-id> --tenant-id=<tenant-id>
  1. Use azcopy

Upvotes: 1

Related Questions