问题
I have to delete all the files in azure blob storage(specific container) automatically via azure release pipelines. So I have configured a task to get the IP address of Microsoft agent dynamically and add the IP address into blob Firewall. Below script working successfully sometimes, but I'm not able to see the IP in the Firewall list.
Also same script is failing many times and throwing a error like
The request may be blocked by network rules of storage account. Please check network rule set using 'az storage account show -n accountname --query networkRuleSet'.If you want to change the default action to apply when no rule matches, please use 'az storage account update'.
IP=`curl -s http://ipinfo.io/json | jq -r '.ip'`
echo "Opening firewall for the IP : $IP"
az storage account network-rule add -g custom-web --account-name "customwebapp" --ip-address $IP
I'm not sure on this , Any one able to advise me a best way to achieve this or Another alternate secure way for connecting the azure blob via Microsoft hosted agent ?
References https://docs.microsoft.com/en-us/cli/azure/storage/account/network-rule?view=azure-cli-latest
来源:https://stackoverflow.com/questions/66196473/az-storage-account-network-rule-not-working-for-microsoft-hosted-agentazure-dev