Skip to content
Discussion options

You must be logged in to vote

You need to use the Complete deployment mode to remove resources. It will remove resources not declared in the template.

If I deploy a template that looks like this to create a container registry:

resource containerRegistry 'Microsoft.ContainerRegistry/registries@2021-06-01-preview' = {
  name: 'mynewacrsteffe'
  location: 'westeurope'
  sku: {
    name: 'Basic'
  }
  properties: {
    adminUserEnabled: false
  }
}

I can remove the container registry from Azure by removing the resource from the template or commenting it out like you mentioned and deploy the template again using Complete mode.

Deploying this template using New-AzResourceGroupDeployment -ResourceGroupName acr-rg -TemplateFi…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@idrisscharai
Comment options

@brwilkinson
Comment options

Answer selected by idrisscharai
Comment options

You must be logged in to vote
1 reply
@slavizh
Comment options

Comment options

You must be logged in to vote
1 reply
@slavizh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants