Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Connect-AzContainerRegistry
- Module:
- Az.ContainerRegistry Module
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.
Example 4
$cred = Connect-AzContainerRegistry -Name $RegistryName -ExposeToken
$token = ($cred.accessToken | ConvertFrom-SecureString -AsPlainText)
$loginServer = $cred.loginServer
docker login $loginServer -u 00000000-0000-0000-0000-000000000000 --password $token
Login to ACR with native containerize tool.
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
-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
-Name
Azure Container Registry Name.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | RegistryName |
Parameter sets
-Password
Password For Azure Container Registry.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-UserName
User Name For Azure Container Registry.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
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
Azure PowerShell
Feedback
Was this page helpful?
