Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fb9ad03

Browse files
committedOct 27, 2017
[acr] authentication how-to updates
1 parent a5902e6 commit fb9ad03

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed
 

‎articles/container-registry/container-registry-authentication.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ ms.custom: H1Hack27Feb2017
2424

2525
There are several ways to authenticate with an Azure container registry, each of which applicable to one or more registry usage scenarios.
2626

27-
You can manually log in to a registry to work with images directly, which we'll call [individual login](#individual-login-with-AAD), and your applications and container orchestrators can perform unattended, or "headless," authentication by using a [service principal](#service-principal).
27+
You can log in to a registry directly, which we'll call [individual login](#individual-login), and your applications and container orchestrators can perform unattended, or "headless," authentication by using a [service principal](#service-principal).
2828

29-
Anonymous access is not available on Azure container registries. For public images, you can use [Docker Hub](https://docs.docker.com/docker-hub/).
29+
Azure Container Registry does not support anonymous login. For public images, you can use [Docker Hub](https://docs.docker.com/docker-hub/).
3030

31-
## Individual login with Azure Active Directory
31+
## Individual login
3232

33-
Authenticate to your registry by executing the [az acr login](/cli/azure/acr?view=azure-cli-latest#az_acr_login) command in the [Azure CLI](/cli/azure/install-azure-cli):
33+
Authenticate to your registry with the [az acr login](/cli/azure/acr?view=azure-cli-latest#az_acr_login) command in the [Azure CLI](/cli/azure/install-azure-cli):
3434

3535
```azurecli
3636
az acr login --name <acrName>
@@ -42,18 +42,6 @@ When you log in with `az acr login`, the CLI creates an AAD [service principal](
4242

4343
You can assign a [service principal](../active-directory/develop/active-directory-application-objects.md) to your registry and use it for basic Docker authentication. Using a service principal is recommended for most authentication scenarios, including "headless" authentication from applications or container orchestrators.
4444

45-
To login directly with a service principal, provide the app ID and password of the service principal to the `docker login` command:
46-
47-
```
48-
docker login myregistry.azurecr.io -u xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p myPassword
49-
```
50-
51-
Once logged in, Docker caches the credentials, so you don't need to remember the app ID.
52-
53-
> [!TIP]
54-
> You can regenerate the password of a service principal by running the `az ad sp reset-credentials` command.
55-
>
56-
5745
Service principals allow [role-based access](../active-directory/role-based-access-control-configure.md) to a registry. Available roles are:
5846
* **Reader**: pull only access
5947
* **Contributor**: pull and push
@@ -65,26 +53,45 @@ You can assign multiple service principals to a registry, which allows you to de
6553

6654
* Continuous integration and deployment solutions (such as Visual Studio Team Services or Jenkins) that build container images and push them to a registry.
6755

56+
> [!TIP]
57+
> You can regenerate the password of a service principal by running the `az ad sp reset-credentials` command.
58+
>
59+
60+
You can also login directly with a service principal. Provide the app ID and password of the service principal to the `docker login` command:
61+
62+
```
63+
docker login myregistry.azurecr.io -u xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -p myPassword
64+
```
65+
66+
Once logged in, Docker caches the credentials, so you don't need to remember the app ID.
67+
6868
## Admin account
6969

70-
With each registry you create, an admin account is created automatically. By default, the admin account is disabled, but you can enable it and manage the credentials in the [Azure portal](container-registry-get-started-portal.md#create-a-container-registry) or by using the Azure CLI.
70+
Each container registry includes an admin user account, which is disabled by default. You can enable the admin user and manage its credentials in the [Azure portal](container-registry-get-started-portal.md#create-a-container-registry), or by using the Azure CLI.
7171

72-
The admin account is provided with two passwords, both of which can be regenerated. Two passwords allow you to maintain connections to the registry by using one password while you regenerate the other. If the admin account is enabled, you can pass the user name and either password to the `docker login` command for basic authentication to the registry. For example:
72+
The admin account is provided with two passwords, both of which can be regenerated. Two passwords allow you to maintain connection to the registry by using one password while you regenerate the other. If the admin account is enabled, you can pass the user name and either password to the `docker login` command for basic authentication to the registry. For example:
7373

7474
```
7575
docker login myregistry.azurecr.io -u myAdminName -p myPassword1
7676
```
7777

78-
You can use the `--admin-enabled` parameter of the Azure CLI command [az acr update](/cli/azure/acr?view=azure-cli-latest#az_acr_update) to enable the admin user for an existing registry:
78+
To enable the admin user for an existing registry, you can use the `--admin-enabled` parameter of the [az acr update](/cli/azure/acr?view=azure-cli-latest#az_acr_update) command in the Azure CLI:
7979

8080
```azurecli
8181
az acr update -n <acrName> --admin-enabled true
8282
```
8383

84+
You can enable the admin user in the Azure portal by navigating your registry, selecting **Access keys** under **SETTINGS**, then **Enable** under **Admin user**.
85+
86+
![Enable admin user UI in the Azure portal][auth-portal-01]
87+
8488
> [!IMPORTANT]
8589
> The admin account is designed for a single user to access the registry, mainly for testing purposes. We do not recommend sharing the admin account credentials with multiple users. All users authenticating with the admin account appear as a single user to the registry. Changing or disabling this account disables registry access for all users who use its credentials.
8690
>
8791
8892
### Next steps
8993
* [Push your first image using the Docker CLI](container-registry-get-started-docker-cli.md).
9094
* For more information about authentication in the Container Registry preview, see the [blog post](https://blogs.msdn.microsoft.com/stevelasker/2016/11/17/azure-container-registry-user-accounts/).
95+
96+
<!-- IMAGES -->
97+
[auth-portal-01]: ./media/container-registry-authentication/auth-portal-01.png
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.