Forum Discussion
Build is failing while deplpoying through CI CD pipeline
Has the storage account from the old subscription been removed?
That error refers to the fact that that storage account name is already taken (in use), Storage accounts are global resources (because they are usually published and accessed remotely via a URL), the name of the storage account may have been taken up by someone else using Azure.
With Infrastructure as code, I use a prefix (ie company name or something like 'diag' then a unique string based on the resource ID of the resource group, that it is deployed too, that way its global;ly unique and if I redeploy to the same resource group in the future (it knows its the same resource), if I deploy to another resource group (the name is different):
https://docs.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-storage-account-name?tabs=bicep
https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming