简体   繁体   中英

Azure Devops step copy YAML from Azure storage account to DevOps repo

I wonder if anyone could advise, I am trying to find a way to release updated YAML files centrally to multiple DevOps projects via azure storage. So that a daily release can be updated to use newer version of a yasl pipeline.

Currently we use Azure lighthouse to release packages to storage and the individual pipelines pick them up and process however the YAML pipelines cannot be changed if additional steps are required.

Therefore I want to be able to pick up new versions of YAML in the same way the modules are picked up and update the local Devops repository.

How could this be achieved?

Kind Regards M

As a workaround, we could download the YAML file from Azure storage account via AzCopy command and push the file via git cmd.

  1. Install AzCopy from: https://aka.ms/downloadazcopy-v10-windows

  2. Read docs from: https://docs.microsoft.com/en-us/azure/storage/storage-use-azcopy

  3. cd "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy"

  4. Get Blob Storage (Secondary) Key

  5. Download single file via the cmd .\AzCopy /Source:https://myaccount.file.core.windows.net/myfileshare/myfolder/ /Dest:C:\myfolder /SourceKey:key /Pattern:xxx.yml

  6. Clone the azure devops repo via the git cmd:

    git config --global user.email "xxx@xyz.com"

    git config --global user.name "Admin"

    git clone <repo> <directory>

  7. Copy the xxx.yml file to the folder.

  8. Then add a command line task to submit and push the changes to the repo:

    git commit -m "Add docs.zip file"

    git push -u origin master

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM