什么是相当于 az acr login 的 powershell

what is the powershell equivalent to az acr login

我们如何使用 powershell 登录到 Azure 容器注册表。提供的示例仅适用于 仅适用于 Azure CLI

az acr login --name <acrName>

A​​zure Container registry中没有单独的powershell登录,如果要使用powershell登录,我们应该get the admin credentials for the registry first and run docker login登录。

可以参考下面的命令

$creds = Get-AzureRmContainerRegistryCredential -Registry $registry
$creds.Password | docker login $registry.LoginServer -u $creds.Username --password-stdin

更多详细信息,请参阅此article

Connect-AzContainerRegistry -Name MyContainerRegistry

Microsoft Docs

作为官方 Az Powershell 模块的一部分提供。请注意,较旧的 AzureRM 模块不包含此功能。