New-AzureRmContainerRegistry
Creates a container registry.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
New-AzureRmContainerRegistry
[-ResourceGroupName] <String>
[-Name] <String>
[-Sku] <String>
[-Location <String>]
[-EnableAdminUser]
[-Tag <Hashtable>]
[-StorageAccountName <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzureRmContainerRegistry cmdlet creates a container registry.
Examples
Example 1: Create a container registry with a new storage account.
PS C:\>New-AzureRmContainerRegistry -ResourceGroupName "MyResourceGroup" -Name "MyRegistry" -Sku "Basic"
Container registry location: eastus
Registry Name Sku LoginServer CreationDate Provisioni AdminUserE StorageAccountN
ngState nabled ame
------------- --- ----------- ------------ ---------- ---------- ---------------
myregistry Premium myregistry.azurecr.io 10/31/2017 6:49:31 PM Succeeded True
This command creates a container registry with a new storage account in the resource group `MyResourceGroup`.
Example 2: Create a container registry with admin user enabled.
PS C:\>New-AzureRmContainerRegistry -ResourceGroupName "MyResourceGroup" -Name "MyRegistry" -Sku "Basic" -EnableAdminUser
Container registry location: eastus
Registry Name Sku LoginServer CreationDate Provisioni AdminUserE StorageAccountN
ngState nabled ame
------------- --- ----------- ------------ ---------- ---------- ---------------
myregistry Premium myregistry.azurecr.io 10/31/2017 6:49:31 PM Succeeded True
This command creates a container registry with admin user enabled.
Example 3: Create a container registry with an existing storage account.
PS C:\>New-AzureRmContainerRegistry -ResourceGroupName "MyResourceGroup" -Name "MyRegistry" -Sku "Basic" -StorageAccountName "mystorageaccount"
Container registry location: eastus
Registry Name Sku LoginServer CreationDate Provisioni AdminUserE StorageAccountN
ngState nabled ame
------------- --- ----------- ------------ ---------- ---------- ---------------
myregistry Premium myregistry.azurecr.io 10/31/2017 6:49:31 PM Succeeded True
This command creates a container registry with an existing storage account `mystorageaccount` in the same subscription.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableAdminUser
Enable admin user for the container registry.
Type: | SwitchParameter |
Aliases: | EnableAdmin |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Location
Container Registry Location. Default to the location of the resource group.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Container Registry Name.
Type: | String |
Aliases: | ContainerRegistryName, RegistryName, ResourceName |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Resource Group Name.
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Sku
Container Registry SKU. Allowed values: Basic.
Type: | String |
Aliases: | ContainerRegistrySku, RegistrySku |
Accepted values: | Classic, Basic, Premium, Standard |
Position: | 2 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StorageAccountName
The name of an existing storage account.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Tag
Container Registry Tags.Key-value pairs in the form of a hash table. For example: @{key0="value0";key1=$null;key2="value2"}
Type: | Hashtable |
Aliases: | Tags |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |