azure azcopy cp doesn't work with SAS token

Guilherme de Oliveira
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 27, 2024

I'm generating a SAS Token following this microsoft documentation  to deploy files to my Azure StorageAccount using BitBucket Pipelines, but when I run Deploy I get this error:

'failed to perform copy command due to error: no SAS token or OAuth token is present and the resource is not public'. 


Status: Downloaded newer image for mspipes/azure-storage-deploy:2.0.1

INFO: Starting deployment to Azure storage...

azcopy cp "./my-folder/*" "https://myblob.blob.core.windows.net/my-container/$MY_SAS_TOKEN" --from-to localBlob --recursive

INFO: Scanning...

failed to perform copy command due to error: no SAS token or OAuth token is present and the resource is not public

✖ Deployment failed.



Until 4 days ago the Deploy worked normally, and now it no longer works.


Here is the code step where I use the SAS Token:

- step:

name: Deploy to Storage Account

script:

- pipe: microsoft/azure-storage-deploy:2.0.1

variables:

SOURCE: './my-folder/*'

DESTINATION: 'https://myblob.blob.core.windows.net/my-container/'

DESTINATION_SAS_TOKEN: $MY_SAS_TOKEN

EXTRA_ARGS: '--from-to localBlob --recursive'

- sleep 15


Any help would be greatly appreciated, thanks

1 answer

1 vote
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 1, 2024

@Guilherme de Oliveira hi. Pipe you mentioned not supported anymore. Instead, try this pipe: atlassian/azure-storage-deploy:

script:
  - pipe: atlassian/azure-storage-deploy:2.1.0
    variables:
      SOURCE: 'myfile.txt'
      DESTINATION_STORAGE_ACCOUNT_NAME: 'https://mystorageaccount.blob.core.windows.net'
      DESTINATION_SAS_TOKEN: $AZURE_STORAGE_SAS_TOKEN
      DESTINATION_CONTAINER_NAME: 'my-container'

Regards, Igor

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events