Missed Team ’24? Catch up on announcements here.

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

How to copy the content of a directory to azure storage using pipelines

sschroders May 1, 2024

Hi, 

I am trying to setup a ci/cd for our frontend react code which needs to build and deploy the frontend to azure storage. I am using Azure Storage Deploy pipe but I can mange to only copy the whole directory over instead of the files inside or only one file / folder from within the main dir. How can I set the YMAL correctly to only coy the files and folders of my main folder over?

 

2 answers

1 accepted

0 votes
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 3, 2024
0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 2, 2024

Hello @sschroders 

and thank you for reaching out to Community!

You can configure the path that will be deployed by the atlassian/azure-storage-deploy pipe by setting the SOURCE variable in the pipe definition on your YML file.

For example, to deploy a folder named main inside the current directory, you can configure the pipe as follows: 

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

SOURCE accepts both directory or filename, so to deploy a single file named my-file.txt, the pipe definition would be: 

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

You can find additional examples and descriptions of each of the pipe's variables on it's official documentation page : 

Hope that helps! Let us know in case you have any questions.

Thank you, @sschroders !

Patrik S

Suggest an answer

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

Atlassian Community Events