@Jeff Schulz Thanks for posting your query on Microsoft Q&A.
Currently there isn't a way to update the CORS rules via JSON view on Azure portal.
But you can use Azure CLI or Azure PowerShell to update the CORS rules, if you do not want to go the REST API way.
For example, to update CORS rules using Azure PowerShell,
Set Storage context
$ctx1=New-AzStorageContext -StorageAccountName "sname" -StorageAccountKey "abc"
Get Storage CORS rule
$CorsRules = Get-AzStorageCORSRule -ServiceType Blob -Context $ctx1
View existing CORS rules if any.
Write-Output $CorsRules
Output:
AllowedOrigins : {127.0.0.1}
AllowedHeaders : {*}
ExposedHeaders : {}
AllowedMethods : {Get}
MaxAgeInSeconds : 0
Update CORS rule:
$CorsRules[0].AllowedMethods = @("Get", "Connect", "Merge")
Set-AzStorageCORSRule -ServiceType Blob -CorsRules $CorsRules -Context $ctx1
$CorsRules = Get-AzStorageCORSRule -ServiceType Blob -Context $ctx1 Write-Output $CorsRules
Output:
AllowedOrigins : {127.0.0.1}
AllowedHeaders : {*}
ExposedHeaders : {}
AllowedMethods : {Get, Connect, Merge}
MaxAgeInSeconds : 0
This way, you can update the CORS rules.
You may also find these documents helpful:
- Set-AzStorageCORSRule
- Using Azure CLI: az storage account blob-service-properties update
Updates the properties of a storage account's blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - https://stackoverflow.com/a/71226363
If you have any questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.
If this helps, please 'Accept answer', 'mark as helpful' so that it can help others in the community looking for help on the same topic.