I need to provide the link of an Azure Storage blob in an email so that it can be downloaded from that link. This email is triggered by Azure Devops Pipeline. Now the problem is that we do not know the name of the blob in advance (we only know the container name for that blob) so we cannot hardcode it in the email body for the Email Step in Azure Devops Pipeline. Is there any alternative way by which I can provide the downloadable link in the email step?
Asked
Active
Viewed 462 times
0
-
You need to know the name of the blob in order to generate a link for that blob. – Gaurav Mantri May 17 '22 at 05:15
-
You'll have to find a way to store and retrieve your blob url. That said, you would need to edit your question with specific details around what you've already done, and where you're struggling. Right now, as written, this is really a broad, high-level question. – David Makogon May 19 '22 at 17:55
1 Answers
-1
As Suggested by Gaurav Matri is correct you need to know the name of blob in order to generate the link for the blob.
You can try to execute az storage blob download command in Azure cli task to download files from Azure Blob Storage:
steps:
- task: AzureCLI@1
displayName: 'Azure CLI '
inputs:
azureSubscription: {service connection}
scriptLocation: inlineScript
inlineScript: |
mkdir $(Build.SourcesDirectory)\BlobFile
az storage blob download --container-name $(containername) --file $(Build.SourcesDirectory)\BlobFile --name "{file name}" --account-key $(accountkey) --account-name $(accountname)
Reference : How can I download a file from blob storage inside an Azure pipeline?

RahulKumarShaw
- 4,192
- 2
- 5
- 11
-
The OP isn't asking to download a blob, during a pipeline step (that doesn't help when sending out emails). They need a link to a blob, to include that link within an email. Anything downloaded, during a pipeline step, will be unreachable via URI. – David Makogon May 19 '22 at 17:53
-
Also, the OP hasn't shown any work: no details of their pipeline, no specific question. There's really nothing that can be answered at this point. – David Makogon May 19 '22 at 17:56