azureazure-bicepazure-container-registry

How to upgrade the existing container registry from basic to premium?


Bicep Code for ACR provisioning:

resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-07-01' = {
  name: 'acrprccivivek01'
  location: 'centralindia'
  sku: {
    name: 'Basic'
  }
}

Deployment Code and Result:

PS C:\Windows\System32> New-AzResourceGroupDeployment -Name 'BasciACRDeployment' -TemplateFile 'D:\LearnBicep\storageAcc.bicep' -ResourceGroupName 'vivekchak-rg' -Mode Incremental

DeploymentName          : BasciACRDeployment
ResourceGroupName       : vivekchak-rg
ProvisioningState       : Succeeded
Timestamp               : 12/27/2024 7:46:43 AM
Mode                    : Incremental
TemplateLink            :
Parameters              :
Outputs                 :
DeploymentDebugLogLevel :

we have deployed the basic azure container registry using above bicep and observed that it is not having networking features.

Can we upgrade the ACR from basic to premium using the same bicep template or not possible?

I just want to ask the experts here before trying on my project subscription.


Solution

  • Can we upgrade the ACR from basic to premium using the same bicep template or not possible?

    Yes, you can upgrade the ACR from Basic to Premium by using the same template and changing Basic to Premium

    Note: Make sure to take a backup of the ACR images before upgrading

        resource containerRegistry 'Microsoft.ContainerRegistry/registries@2023-07-01' = {
          name: 'acrprccivivek01'
          location: 'centralindia'
          sku: {
            name: 'Premium'
          }
        }
    
    New-AzResourceGroupDeployment -Name  'BasciACRDeployment' -TemplateFile  '/home/user/Acr.bicep' -ResourceGroupName  'Automation_RG'
    

    After running the code, the container registry has been upgraded to Premium successfully

    enter image description here