Deploying the contents of a directory with Bitbucket Pipelines Pipe: Azure Storage Deploy
Asked by Victor Ferreira:

Hello, everyone,

it is not possible to sync the contents of a directory (and not the directory itself) with the Storage Account in Azure with Bitbucket Pipelines Pipe: Azure Storage Deploy.

<https://bitbucket.org/atlassian/azure-storage-deploy/src/master/>

It fails with error: FileNotFoundError: \[Errno 2\] No such file or directory: 'bar/\*'  
I found this repository supposedly by Microsoft that says the star sign should work to deploy the contents of the directory:  
<https://bitbucket.org/microsoft/azure-storage-deploy/src/master/>  

Is there a way to make it work with the official Atlassian's Pipe? The Microsoft workspace is official too? could someone confirm?  

Thank you


Answers:
author: sschroders
body: I am trying to deploy to azure using atlassian/azure-storage-deploy:2.2.1 pipe but i am having a hard time getting the content of directory copied to azure. I keep getting the whole directory copied. here is my ymal

image: node:20.11.1

definitions:  
caches:  
yarn: node_modules

pipelines:  
branches:  
master:  
- step:  
name: 'Build'  
caches:  
- yarn  
script:  
- echo "Your build and test goes here..."  
- yarn install  
- yarn build  
artifacts:  
- dist/\*\*

<br />

- step:  
name: Deploy to development  
deployment: Development  
script:  
- echo "Deploying to test environment"  
- pipe: atlassian/azure-storage-deploy:2.2.1  
variables:  
SOURCE: 'dist/'  
DESTINATION_STORAGE_ACCOUNT_NAME: $DESTINATION_STORAGE_ACCOUNT_NAME  
DESTINATION_SAS_TOKEN: $DESTINATION_SAS_TOKEN  
DESTINATION_CONTAINER_NAME: $DESTINATION_CONTAINER_NAME  
OVERWRITE: 'true' # Optional.  
DEBUG: 'true' # Optional.

comments: author: Igor Stoyanov
body: With this version of the pipe you may upload only file or a directory, not the content of a directory.  

Update: you could try to cd to needed directory and then provide a dot as source:

```
- cd dist  
- pipe: atlassian/azure-storage-deploy:2.2.1  variables:    SOURCE: '.'
```

Please, provide a feedback if this helped you.  

Regards, Igor


author: sschroders
body: unfortunetly this then gets the whole content of my repo to the azure storage than only the content of dist. on my azure storage I have a static website for my react front end. I need in there the content of the dist do you have any other suggestion how to achieve this?


author: Igor Stoyanov
body: I will investigate this, add this as feature request to the pipe, and notify you when this feature will become available.

Regards, Igor


author: sschroders
body: thanks


author: Igor Stoyanov
body: [@sschroders](/t5/user/viewprofilepage/user-id/4412281) hi. New version [azure-storage-deploy:2.4.0](https://bitbucket.org/atlassian/azure-storage-deploy/src/2.4.0/) released, that allows you to copy the content of a directory:  

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

<br />

Regards, Igor


author: Victor Ferreira
body: I came across the blog post from 2019

<https://cloudblogs.microsoft.com/opensource/2019/03/12/now-available-bitbucket-pipes-microsoft-azure/>


author: Igor Stoyanov
body: [@Victor Ferreira](/t5/user/viewprofilepage/user-id/5472899) Hi. Microsoft pipe: <https://bitbucket.org/microsoft/azure-storage-deploy/src/master/> is not supported anymore.  
To deploy a directory with <https://bitbucket.org/atlassian/azure-storage-deploy/src/master/> try to provide a directory name without wildcard:

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

Regards, Igor

comments: author: Igor Stoyanov
body: [@Oleksandr Kyrdan](/t5/user/viewprofilepage/user-id/2885705)


Tags: azure

bitbucket-cloud

bitbucket-pipelines

cloud

pipe

storage