'How to edit existing Azure storage account CORS Rule through Bash Script

I've been working as Devops engineer from past 3 months. So, I am learning creating scripts for automation. But I am stuck here. I wanna try to edit the CORS rule through bash script. I have successfully written a script for adding the rule but every time i run the script, its create a new rule. I want to edit the existing rule.

Here's the script line, I am using to add CORS rule.

Add_Rule=$(az storage cors add --account-name testingscriptcors --origins 'http://google321.comh, http://www.google123.com'  --methods GET PUT --allowed-headers '*' --exposed-headers '*' --max-age 200 --services b)

What I am thinking that if I provide ( --rule 1 ) in this script, It'll worked out. But this doesn't work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source