Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

sbiales
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!
June 10, 2024

Hi, I am trying to use this pipeline to deploy to azure, formatted exactly as it is here except I have tried versions 2.3.0 and 2.4.0, but I am getting this error: "Deployment failed. Reason: (MissingRequiredHeader) An HTTP header that's mandatory for this request is not specified."

I don't know how to tell what header is missing or why this error would be occurring. Any help would be appreciated.

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

@sbiales hi. Please, next time create a new question to describe your problem.

Also could you check this is your case?

 

Regards, Igor

sbiales
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!
June 11, 2024

Yes that was it!! Thank you! And sorry, I will do so next time :)

Like Igor Stoyanov likes this

Suggest an answer

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

Atlassian Community Events