Forum Discussion

curious7's avatar
curious7
Copper Contributor
Aug 27, 2021

How to download files from Azure blob storage?

I am trying to find out how to download files from Azure blob storage container to a VM in Azure VNET (both within same tenancy).

I found that using System.Net.webclient command and SAS token I can download individual objects in blob storage if I allow public access.

But there are 2 problems with that :

- I have to generate SAS token for each file in container 

- SAS tokens expire after some time

 

VNET has the smb port blocked to internet and pubic access to blob will be kept blocked.

 

This will be straight after building the new VM so it won't have storage explorer or Azure powershell module, so I can't use those. And I need this download scripted for automation.

 

Can the download be done using Access token (so that it doesn't expire) and can whole folder be downloaded?

1 Reply

  • cpinotossi's avatar
    cpinotossi
    Copper Contributor
    Hello,

    did you consider to make use of AAD to authenticate and authorize your access? I would recommend to assign an identity to your vm (System assigend or user assigend Identity) and make sure to setup your Azure Storage RBAC (IAM) accordently.