You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/deployment-environments/how-to-configure-extensibility-generic-container-image.md
+66-6Lines changed: 66 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,11 @@ ms.topic: how-to
13
13
14
14
# Configure a container image to execute deployments
15
15
16
-
In this article, you learn how to build custom container images to deploy your environment definitions in Azure Deployment Environments (ADE).
16
+
In this article, you learn how to build custom container images to deploy your [environment definitions](configure-environment-definition.md) in Azure Deployment Environments (ADE).
17
17
18
18
An environment definition comprises at least two files: a template file, like *azuredeploy.json*, and a manifest file named *environment.yaml*. ADE uses containers to deploy environment definitions, and natively supports the Azure Resource Manager (ARM) and Bicep IaC frameworks.
19
19
20
-
The ADE extensibility model enables you to create custom container images to use with your environment definitions. By using the extensibility model, you can create your own custom container images, and store them in a container registry like DockerHub. You can then reference these images in your environment definitions to deploy your environments.
20
+
The ADE extensibility model enables you to create custom container images to use with your environment definitions. By using the extensibility model, you can create your own custom container images, and store them in a public container registry like DockerHub, or a private container registry like Azure Container Registry (ACR). You can then reference these images in your environment definitions to deploy your environments.
21
21
22
22
The ADE team provides a selection of images to get you started, including a core image, and an Azure Resource Manager (ARM)/Bicep image. You can access these sample images in the [Runner-Images](https://aka.ms/deployment-environments/runner-images) folder.
23
23
@@ -112,7 +112,9 @@ RUN find /scripts/ -type f -iname "*.sh" -exec chmod +x {} \;
112
112
113
113
## Make the custom image accessible to ADE
114
114
115
-
You must build your Docker image and push it to your container registry to make it available for use in ADE. You can build your image using the Docker CLI, or by using a script provided by ADE.
115
+
You must build your Docker image and push it to a container registry to make it available for use in ADE.
116
+
117
+
You can build your image using the Docker CLI, or by using a script provided by ADE.
116
118
117
119
Select the appropriate tab to learn more about each approach.
In order to use custom images, you need to set up a publicly accessible image registry with anonymous image pull enabled. This way, Azure Deployment Environments can access your custom image to execute in our container.
137
+
In order to use custom images, you need to store them in a registry. You can use a public container registry like DockerHub, or the Azure Container Registry (ACR), which is a private registry.
138
+
139
+
To use a custom image stored in a public registry, you need to enable anonymous image pull. This way, Azure Deployment Environments can access your custom image to execute in our container.
136
140
137
-
Azure Container Registry is an Azure offering that stores container images and similar artifacts.
141
+
> [!Caution]
142
+
> Enabling anonymous (unauthenticated) pull access makes all registry content publicly available for read (pull) actions.
138
143
139
-
To create a registry, which can be done through the Azure CLI, the Azure portal, PowerShell commands, and more, follow one of the [quickstarts](/azure/container-registry/container-registry-get-started-azure-cli).
144
+
To use a custom image stored in the ACR, you need to ensure that ADE can access your image. When you create an ACR instance, it's secure by default and only allows authenticated users to gain access. With this configuration, you don't have to enable anonymous image pull access.
145
+
146
+
#### Use a public registry with anonymous pull
140
147
141
148
To set up your registry to have anonymous image pull enabled, run the following commands in the Azure CLI:
142
149
@@ -152,6 +159,59 @@ When you're ready to push your image to your registry, run the following command
By default, access to pull or push content from an Azure container registry is only available to authenticated users. You can further secure access to ACR by limiting access from public networks and assigning specific roles.
165
+
166
+
##### Limit network access
167
+
168
+
To secure network access to your ACR, you can limit access to your own networks, or disable public network access entirely. If you limit network access, you must enable the firewall exception *Allow trusted Microsoft services to access this container registry*. ADE uses the Azure Container Instances service, which is a trusted Microsoft service.
169
+
170
+
To disable access from public networks:
171
+
172
+
1.[Create an ACR instance](/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli) or use an existing one.
173
+
1. In the Azure portal, go to the ACR that you want to configure.
174
+
1. On the left menu, under **Settings**, select **Networking**.
175
+
1. On the Networking page, on the **Public access** tab, under **Public network access**, select **Disabled**.
176
+
177
+
:::image type="content" source="media/how-to-configure-extensibility-generic-container-image/container-registry-network-settings.png" alt-text="Screenshot of the Azure portal, showing the ACR network settings, with Public access and Disabled highlighted.":::
178
+
179
+
1. Under **Firewall exception**, check that **Allow trusted Microsoft services to access this container registry** is selected, and then select **Save**.
180
+
181
+
:::image type="content" source="media/how-to-configure-extensibility-generic-container-image/container-registry-network-disable-public.png" alt-text="Screenshot of the ACR network settings, with Allow trusted Microsoft services to access this container registry and Save highlighted.":::
182
+
183
+
##### Assign the AcrPull role
184
+
185
+
Creating environments by using container images uses the ADE infrastructure. Each project has one or more project environment types, which need read access to the container image that defines the environment to be deployed. To access the images within your ACR securely, assign the AcrPull role to each project environment type.
186
+
187
+
To assign the AcrPull role to the Project Environment Type:
188
+
189
+
1. In the Azure portal, go to the ACR that you want to configure.
190
+
1. On the left menu, select **Access Control (IAM)**.
191
+
1. Select **Add** > **Add role assignment**.
192
+
1. Assign the following role. For detailed steps, see [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
193
+
194
+
| Setting | Value |
195
+
| --- | --- |
196
+
|**Role**| Select **AcrPull**. |
197
+
|**Assign access to**| Select **User, group, or service principal**. |
198
+
|**Members**| Enter the name of the project environment type that needs to access the image in the container. |
199
+
200
+
The project environment type displays like the following example:
201
+
202
+
:::image type="content" source="media/how-to-configure-extensibility-generic-container-image/container-registry-access-control-pet.png" alt-text="Screenshot of the Select members pane, showing a list of project environment types with part of the name highlighted.":::
203
+
204
+
In this configuration, ADE uses the Managed Identity for the PET, whether system assigned or user assigned.
205
+
206
+
> [!Tip]
207
+
> This role assignment has to be made for every project environment type. It can be automated through the Azure CLI.
208
+
209
+
When you're ready to push your image to your registry, run the following command:
0 commit comments