How to copy files from azure Devops to Azure file share storage account

3.7k Views Asked by At

I have a build pipeline which builds *.p12 files and been published a artifacts in the build pipeline

How to copy files from azure Devops pipeline workspace or from published artifacts to Azure storage account (Fileshare) path

3

There are 3 best solutions below

1
Suki Ji-MSFT On

You could Azure file copy task in Azure pipeline to copy file from Azure pipeline to azure storage account. This task works only when run on Windows agents.

enter image description here

1
Rahini P On

“Az storage file upload “ az cli command works to upload files from azure Devops pipeline workspace to fileshare storage account

0
Niehm On

Az storage file upload is what y'all are looking for. Batch upload can be used to do files instead of directories. Despite what the website says a combination of connection string and share name will also work.

Since it took me a while to find it, here is the command to get the connection string and then reuse it later:

connectionString=$(az storage account show-connection-string -g **name of your resource group** -n **name of storage account** --query connectionString -o tsv )