如何从构建管道内部的项目存储库中的Azure存储Blob下载文件(Azure DevOps) [英] how to download file from azure storage blob in project repository inside build pipeline (Azure DevOps)

查看:43
本文介绍了如何从构建管道内部的项目存储库中的Azure存储Blob下载文件(Azure DevOps)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建期间需要一种将一组文件从Azure Blob存储下载到Project存储库的方法.

Need a way to download a set of files from Azure Blob storage to Project repository during the build.

流程的目标是对移动应用程序进行CI-CD.但是移动应用程序的图标,背景图像和其他一些图像是由其他应用程序提供的,因此在构建过程中,这些图像应该是从Blob存储容器中获取的.

The aim of process is to CI-CD the mobile app. but the mobile app's icon, background image and some other images are provided by other application, so during build the images are suppose to take from blob storage container.

推荐答案

您可以使用Azure Powershell做到这一点,这可能是最简单的方法:

you can use Azure Powershell to do that, would probably be the easiest way of doing that:

$storage = Get-AzStorageAccount -ResourceGroupName xxx -Name yyy
$ctx = $storageAccount.Context

# download blob
Get-AzStorageblobcontent -Blob "Image001.jpg" `
  -Container $containerName `
  -Destination "D:\_TestImages\Downloads\" `
  -Context $ctx 

阅读:
https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-powershell#download-blobs

这篇关于如何从构建管道内部的项目存储库中的Azure存储Blob下载文件(Azure DevOps)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆