I am facing issue in copying files from Edgenode to ADLS. For this i used AZCOPY and here is the code for that. It ran perfectly fine in Dev environment.
When it comes to the test environment it behaves odd,
export AZCOPY_AUTO_LOGIN_TYPE="SPN"
export AZCOPY_SPA_APPLICATION_ID="$client_id"
export AZCOPY_SPA_CLIENT_SECRET="$client_secret"
export AZCOPY_TENANT_ID="$tenant_id"
az login --service-principal -u $client_id --tenant $tenant_id -p $client_secret
Azcopy code
azcopy cp –overwrite "True" "$src_file_path" "$dest_file_path" –put-md5
and the error snipped which I am getting in test environment is
enter image description here
Any suggestions or solutions please?
2
Answers
The
403 unauthorized
error usually occurs if you don’t have required permissions/roles to perform the action.To resolve the error, try assigning
Storage Blob Data Owner
orStorage Blob Data Contributor
role to your storage account.Confirm whether the roles are assigned or not by following below:
Go to Azure Portal -> Azure Active directory -> Users -> Select user -> Azure role assignment
Reference:
What is the best way to transfer huge files to Azure Data Lake Storage? (nealanalytics.com)
azure cli – az login with certificate protected with password – Stack Overflow
If you have the IAM control set correctly and if the storage account is restricted to connect from specific networks only then you need to add your IP address to the access list.
Go to Azure Portal -> Storage Account -> Networking -> Click on Add you IP address -> Hit Save
This should help you fix the error.