Edit

Share via


Connect-AzContainerRegistry

Login to an azure container registry.

Syntax

WithoutNameAndPasswordParameterSet (Default)

Connect-AzContainerRegistry
    -Name <String>
    [-ExposeToken]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

WithNameAndPasswordParameterSet

Connect-AzContainerRegistry
    -Name <String>
    -UserName <String>
    -Password <String>
    [-ExposeToken]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

Login to an azure container registry.

Examples

Example 1

Connect-AzContainerRegistry -Name $RegistryName

Login to ACR with no credentials when already login to azure account.

Example 2

Connect-AzContainerRegistry -Name $RegistryName -UserName $RegistryName -Password $AdminPassWord

Login to ACR with admin username/password when admin user was enabled.

Example 3

Connect-AzContainerRegistry -Name $RegistryName -UserName $ServicePrincipal -Password $ServicePrincipalPassword

Login to ACR with service principal application ID and password.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExposeToken

Expose access token instead of automatically logging in through Docker CLI.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Azure Container Registry Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RegistryName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Password

Password For Azure Container Registry.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WithNameAndPasswordParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-UserName

User Name For Azure Container Registry.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WithNameAndPasswordParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

Boolean