Last updated
Last updated
This short demo shows how one can upload a file into Azure storage, using just basic utilities (i.e. no Microsoft-provided tooling).
To do so, we need a few requirements satisfied:
bash
, curl
and jq
The cURL
utility must be locally installed
The jq
utility (https://stedolan.github.io/jq/) must be locally installed
You need to have an Azure storage account
In that storage account, there needs to be a storage container already created
You need to have the Storage Blob Data Contributor
role assigned
Obviously you need some local file
Given that we'll upload the file in a single shot, it must be less than in size
The script attempts a device code signin to the given Azure AD tenant, requesting a token for Azure storage
Once the script outputs the device code, you need to open https://microsoft.com/devicecode
in a web browser and punch in the device code
The script locally computes the MD5 hash of the file (using md5sum
, awk
, xxd
and base64
), to ensure upload errors will be catched
The script uploads the file to blob storage.