
In the past days I uploaded a lot of files to an Azure Blob Storage using the Azure Storage Explorer.
Unfortunately, I forgot to specify system properties such as cache content when uploading to Azure Storage Explorer. Currently the only option here is the Azure CLI and the “upload-batch” command. The files were already uploaded in the meantime, so I didn’t want to do the upload again.
Unfortunately, there is currently no command in the Azure Storage Explorer and the Azure CLI to update system properties such as cache content with a one-liner.
So I wrote myself a PowerShell script that reads all the blob storage items, filters for file extensions and updates the cache content.
1# Storage Settings
2$storageAccount = "__storage account__";
3$containerName = "__container name__";
4
5# Blob Update Settings
6$contentCacheControl = "public, max-age=2592000"; # 30 days
7$extensions = @(".gif", ".jpg", ".jpeg", ".ico", ".png", ".css", ".js");
8
9# Read all blobs
10$blobs = az storage blob list --account-name $storageAccount --container-name $containerName --num-results * --output json | ConvertFrom-Json
11
12# iterate all blobs
13foreach($blob in $blobs)
14{
15 # use name as identifier
16 $blobName = $blob.name;
17
18 # get extension
19 $extension = [System.IO.Path]::GetExtension($blobName).ToLower();
20
21 # update blob if extension is affected
22 if($extensions.Contains($extension))
23 {
24 az storage blob update --account-name $storageAccount --container-name $containerName --name $blobName --content-cache-control $contentCacheControl
25 Write-Host "Updated $blobName"
26 }
27}
Azure CLI - Upload Batch
During my research I also found the upload-batch command, with which I could have specified this directly during the upload.
1az storage blob upload-batch --account-name $storageAccount --destination $containerName --source C:\your\local\folder --content-cache-control "public, max-age=2592000"
Related articles

Feb 26, 2026 · 6 min read
Run Azure Cosmos DB locally with .NET Aspire and make emulator endpoints visible in the dashboard
When building cloud-native .NET applications, two goals often matter at the same time: a fast local development loop and a clean path to …

Sep 24, 2025 · 9 min read
Automatically discover tools for Azure OpenAI Realtime API
Azure now provides a unified Realtime API for low‑latency, multimodal conversations over WebRTC or WebSockets. If you’ve used the earlier …

Sep 01, 2025 · 3 min read
Azure Document Intelligence – Fix: ContentSourceNotAccessible (Invalid data URL)
Problem Training custom models (for example, delivery notes) in Azure Document Intelligence initially worked fine. Suddenly, both training …
Let's Work Together
Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

Comments