Azure - Bicep deployment DeploymentActive - Unable to edit or replace deployment
Hi, I'm seeing this error daily when deploying Bicep from Azure DevOps. {"customHtml":{"htmlTemplate":"<code><div><div>Unable to edit or replace deployment 'config1740623100': previous deployment from '2/28/2024 2:25:03 AM' is still active (expiration time is '3/6/2024 2:25:02 AM'). Please see <a target="_blank" class="msportalfx-ext-link" href="https://aka.ms/arm-deploy-resources">https://aka.ms/arm-deploy-resources</a> for usage details.</div></div><div><div>Unable to edit or replace deployment 'deployment-1740623100-uksouth': previous deployment from '2/28/2024 2:25:03 AM' is still active (expiration time is '3/6/2024 2:25:02 AM'). Please see <a target="_blank" class="msportalfx-ext-link" href="https://aka.ms/arm-deploy-resources">https://aka.ms/arm-deploy-resources</a> for usage details.</div></div></code>","viewModel":null}} CLI Tasks example Timestamp:
- powershell: |
$timestamp = Get-Date -Format "yyyyMMddTHHmmssss"
Write-Host "##vso[task.setvariable variable=timestamp;isoutput=true]$timestamp"
name: setTimestamp
Deployment:
- task: AzureCLI@2
inputs:
azureSubscription: '${{ parameters.SubscriptionConnectionId }}'
scriptType: 'bash'
scriptLocation: 'inlineScript'
workingDirectory: $(System.ArtifactsDirectory)
inlineScript: |
az deployment group create \
--name $(setTimestamp.timestamp) \
--resource-group ${{ parameters.ResourceGroup }} \
--template-file ${{parameters.TemplateRelativeFileLocation}} \
--parameters ${{parameters.ParametersRelativeFileLocation}} ${{parameters.OptionalArguments}}
Bicep snippet example:
module storageAccount '../storage/storage-account.bicep' = {
name: 'deployment-${convertedEpoch}-${location}'
How can i resolve this issue? I'm using unique deployment names for the az cli and also, unique module names. Kind regards Matt