Skip to content

Instantly share code, notes, and snippets.

@irwinwilliams
irwinwilliams / UpdateAzureBlobCORS.ps
Last active August 24, 2016 06:58
Update an Azure Blob's CORS setting
#works with Azure in Powershell v 1.3.2
clear
$StorageAccountName = "[storageaccountname]"
$Key = "[storageaccountkey]"
$Context = New-AzureStorageContext -StorageAccountKey $Key -StorageAccountName $StorageAccountName
$CorsRules = (@{
AllowedHeaders=@("*");
AllowedOrigins=@("*");
ExposedHeaders=@("content-length");
MaxAgeInSeconds=200;