Bicep Resource Not Found
Bicep stopped deploying with this error
I’m trying to deploy a resource group which has two storage accounts in it with this PowerShell command using a bicep template:
I haven’t made any code changes, just not deployed this resource for a while. I decided to update bicep to the latest version (at the time of writing is Bicep CLI version 0.4.412 (f1169d063e)).
I still get the same error, so I update the PowerShell
Az module to the latest version too. Now when I try my command again, getting a different error:
New-AzResourceGroupDeployment: The deployment ‘azuredeploy’ failed with error(s). Showing 1 out of 1 error(s).
Status Message: The Resource ‘Microsoft.Storage/storageAccounts/backupsacdukcjkaykm’ under resource group was not found.
I check my bicep template and all is fine. However I look up the storage accounts documentation and check the API versions. I see that there’s a later API version than the one I’m using so update to the latest.
I just had to change line 1 in the code below
Now when I deploy, it works fine.