I am finding these days the Azure Blobs more and more useful. The ability to store centrally the sources for any programs or scripts and not be forced to copy content around is making my life easier.
I recently created a script to install some language packs in Azure Virtual Desktop and needed the sources for these language packs. As I wanted the script to be universal for all customers and light, I decided to store the sources on a Blob Storage Account in Azure and just call them from the script upon execution.
The full script can be found here.
First we need to set Nuget as a package provider and install the Az.Storage PS Module:
Install-PackageProvider -Name "Nuget" -Force
Install-module az.storage -Force
Then we need to set the connection context for the storage account. This would allow us to connect with a connection string, instead of credentials.
In case you’re new to this, this is how you create a connection string to an Azure Storage account:
Got to the storage account and under Shared Access Signature

Add the allowed resource types, for the resources you’d like to access the storage account, and the permissions for the connection string. For our example you need only Read and List.
Select the time period, for which the string will be available.
Then click on “Generage SAS and Connection String” and copy the connection string.

$context=New-AzStorageContext -ConnectionString "BlobEndpoint=<Endpoint as generated by your storage account. Read and List permissions are required>"
Then you are ready to download the blob
Get-AzStorageContainer -Context $context appsources | Get-AzStorageBlobContent -Blob "Blob parent Folder/Blob Folder/Blob Name" -Destination $env:TEMP