Azure - Bicep deployment DeploymentActive - Unable to edit or replace deployment

Matthew Lee 0 Reputation points
2024-02-28T15:10:40.1833333+00:00

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

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,084 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.