Last active
August 24, 2016 06:58
-
-
Save irwinwilliams/4cf93b6e2461c753ff125590650186ae to your computer and use it in GitHub Desktop.
Update an Azure Blob's CORS setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
AllowedMethods=@("Get","Connect", "Head")}) | |
Set-AzureStorageCORSRule -ServiceType Blob -CorsRules $CorsRules -Context $Context | |
$CORSrule = Get-AzureStorageCORSRule -ServiceType Blob -Context $Context | |
echo "Current CORS rules: " | |
echo $CORSrule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment