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-bicep-container-image.md
+67-5Lines changed: 67 additions & 5 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 container image to execute deployments with ARM and Bicep
15
15
16
-
In this article, you learn how to build custom Azure Resource Manager (ARM) and Bicep container images to deploy your environment definitions in Azure Deployment Environments (ADE).
16
+
In this article, you learn how to build custom Azure Resource Manager (ARM) and Bicep 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* or *main.bicep*, and a manifest file named *environment.yaml*. ADE uses containers to deploy environment definitions, and natively supports the 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 container registry like Azure Container Registry (ACR) or Docker Hub. 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.
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.
217
+
You must build your Docker image and push it to your container registry to make it available for use in ADE.
218
+
219
+
You can build your image using the Docker CLI, or by using a script provided by ADE.
218
220
219
221
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.
239
+
In order to use custom images, you need to store them in a container registry. Azure Container Instances (ACR) is highly recommended for that. Due to its tight integration with ADE, the image can be published without allowing public anonymous pull access.
240
+
241
+
It's also possible to store the image in a different container registry such as Docker Hub, but in that case it needs to be publicly accessible.
238
242
239
-
Azure Container Registry is an Azure offering that stores container images and similar artifacts.
243
+
> [!Caution]
244
+
> Enabling anonymous (unauthenticated) pull access makes all registry content publicly available for read (pull) actions.
245
+
246
+
To use a custom image stored in ACR, you need to ensure that ADE has appropriate permissions to access your image. Anonymous pull access is disabled by default in ACR.
240
247
241
248
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).
242
249
250
+
#### Use a public registry with anonymous pull
251
+
243
252
To set up your registry to have anonymous image pull enabled, run the following commands in the Azure CLI:
244
253
245
254
```azurecli
@@ -255,6 +264,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 certain networks and assigning specific roles.
270
+
271
+
##### Limit network access
272
+
273
+
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*.
274
+
275
+
To disable access from public networks:
276
+
277
+
1.[Create an ACR instance](/azure/container-registry/container-registry-get-started-azure-cli) or use an existing one.
278
+
1. In the Azure portal, go to the ACR that you want to configure.
279
+
1. On the left menu, under **Settings**, select **Networking**.
280
+
1. On the Networking page, on the **Public access** tab, under **Public network access**, select **Disabled**.
281
+
282
+
:::image type="content" source="media/how-to-configure-extensibility-bicep-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.":::
283
+
284
+
1. Under **Firewall exception**, check that **Allow trusted Microsoft services to access this container registry** is selected, and then select **Save**.
285
+
286
+
:::image type="content" source="media/how-to-configure-extensibility-bicep-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.":::
287
+
288
+
##### Assign the AcrPull role
289
+
290
+
Creating environments by using container images uses the ADE infrastructure, including projects and environment types. 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.
291
+
292
+
To assign the AcrPull role to the Project Environment Type:
293
+
294
+
1. In the Azure portal, go to the ACR that you want to configure.
295
+
1. On the left menu, select **Access Control (IAM)**.
296
+
1. Select **Add** > **Add role assignment**.
297
+
1. Assign the following role. For detailed steps, see [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
298
+
299
+
| Setting | Value |
300
+
| --- | --- |
301
+
|**Role**| Select **AcrPull**. |
302
+
|**Assign access to**| Select **User, group, or service principal**. |
303
+
|**Members**| Enter the name of the project environment type that needs to access the image in the container. |
304
+
305
+
The project environment type displays like the following example:
306
+
307
+
:::image type="content" source="media/how-to-configure-extensibility-bicep-container-image/container-registry-access-control.png" alt-text="Screenshot of the Select members pane, showing a list of project environment types with part of the name highlighted.":::
308
+
309
+
In this configuration, ADE uses the Managed Identity for the PET, whether system assigned or user assigned.
310
+
311
+
> [!Tip]
312
+
> This role assignment has to be made for every project environment type. It can be automated through the Azure CLI.
313
+
When you're ready to push your image to your registry, run the following command:
0 commit comments