I have configured a CICD pipelines for build and deploy the front end files into azure blob storage.
I configured my release pipeline to clear all files before uploading the new flies using az copy.
IP=`curl -s http://ipinfo.io/json | jq -r '.ip'`
echo "firewall - Agent IP: $IP"
sleep 50
az storage account network-rule add -g Test_RG --account-name "Test_RG_1" --ip-address $IP
sleep 30
az storage blob delete-batch --account-name "Test_RG_1" --source '$web'
echo "Removing :$IP"
az storage account network-rule remove --account-name "Test_RG_1" --ip-address $IP
Above script is working fine for sometimes without any changes but its getting failed many times, throwing a error like
ERROR: BadRequestError: (InvalidValuesForRequestParameters) Values for request parameters are invalid: networkAcls.ipRule[*].value. For more information, see - https://aka.ms/storagenetworkruleset
The request may be blocked by network rules of storage account. Please check network rule set
Any one can you please advise me on this ?
Reference
Azure Devops MS-hosted agent IP address
How to get the IP Address for Azure DevOps Hosted Agents to add to the white list
Azure DevOps pipeline cannot copy to Azure storage
https://docs.microsoft.com/en-us/cli/azure/ext/storage-preview/storage?view=azure-cli-latest
VSTS Release - Delete Azure BLOB Container / Contents
Uploading File in Azure using CLI
Network Rules of storage account blocking container creation