Skip to content

Commit 2792b04

Browse files
authored
Merge pull request #283472 from RoseHJM/ade-private-repos-pulumi
ADE - private repos updates - Pulumi
2 parents 1000f89 + 9eef704 commit 2792b04

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

articles/deployment-environments/how-to-configure-extensibility-pulumi-container-image.md

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ description: Learn how to use the ADE extensibility model to build and utilize c
55
ms.service: azure-deployment-environments
66
ms.custom: build-2024, devx-track-azurecli
77
author: MikhailShilkov
8-
ms.date: 05/10/2024
8+
ms.author: rosemalcolm
9+
ms.date: 08/02/2024
910
ms.topic: how-to
1011
#customer intent: As a developer, I want to learn how to build and utilize custom images with my environment definitions for deployment environments.
1112
---
@@ -14,9 +15,9 @@ ms.topic: how-to
1415

1516
In this article, you learn how to utilize [Pulumi](https://pulumi.com) for deployments in Azure Deployment Environments (ADE). You learn how to use a standard image provided by Pulumi or how to configure a custom image to provision infrastructure using the Pulumi Infrastructure-as-Code (IaC) framework.
1617

17-
ADE supports an extensibility model that enables you to create custom images that you can use in your environment definitions. To use this extensibility model, you can create your own custom images, and store them in a public container registry. You can then reference these images in your environment definitions to deploy your environments.
18+
ADE supports an extensibility model that enables you to create custom images that you can use in your environment definitions. To use this extensibility model, you can create your own custom 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.
1819

19-
An environment definition comprises at least two files: a Pulumi project file, *Pulumi.yaml*, and a manifest file named *environment.yaml*. It may also contain a user program written in your preferred programming language: C#, TypeScript, Python, etc. ADE uses containers to deploy environment definitions.
20+
An [environment definition](configure-environment-definition.md) comprises at least two files: a Pulumi project file, *Pulumi.yaml*, and a manifest file named *environment.yaml*. It may also contain a user program written in your preferred programming language: C#, TypeScript, Python, etc. ADE uses containers to deploy environment definitions.
2021

2122
## Prerequisites
2223

@@ -193,7 +194,18 @@ You can use Pulumi to create an Azure Container Registry and publish your image
193194
194195
#### Create an Azure Container Registry and publish your image manually via CLI
195196
196-
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).
197+
In order to use custom images, you need to store them in a container registry. Azure Container Registry (ACR) is highly recommended for that. Due to its tight integration with ADE, the image can be published without allowing public anonymous pull access.
198+
199+
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.
200+
201+
> [!Caution]
202+
> Enabling anonymous (unauthenticated) pull access makes all registry content publicly available for read (pull) actions.
203+
204+
To use a custom image stored in the ACR, you need to ensure that ADE has appropriate permissions to 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 pull access.
205+
206+
To create an instance of the ACR, 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).
207+
208+
#### Use a public registry with anonymous pull
197209
198210
To set up your registry to have anonymous image pull enabled, run the following commands in the Azure CLI:
199211
@@ -210,6 +222,59 @@ When you're ready to push your image to your registry, run the following command
210222
docker push {YOUR_REGISTRY}.azurecr.io/{YOUR_IMAGE_LOCATION}:{YOUR_TAG}
211223
```
212224
225+
#### Use ACR with secured access
226+
227+
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.
228+
229+
##### Limit network access
230+
231+
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*.
232+
233+
To disable access from public networks:
234+
235+
1. [Create an ACR instance](/azure/container-registry/container-registry-get-started-azure-cli) or use an existing one.
236+
1. In the Azure portal, go to the ACR that you want to configure.
237+
1. On the left menu, under **Settings**, select **Networking**.
238+
1. On the Networking page, on the **Public access** tab, under **Public network access**, select **Disabled**.
239+
240+
:::image type="content" source="media/how-to-configure-extensibility-pulumi-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.":::
241+
242+
1. Under **Firewall exception**, check that **Allow trusted Microsoft services to access this container registry** is selected, and then select **Save**.
243+
244+
:::image type="content" source="media/how-to-configure-extensibility-pulumi-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.":::
245+
246+
##### Assign the AcrPull role
247+
248+
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.
249+
250+
To assign the AcrPull role to the Project Environment Type:
251+
252+
1. In the Azure portal, go to the ACR that you want to configure.
253+
1. On the left menu, select **Access Control (IAM)**.
254+
1. Select **Add** > **Add role assignment**.
255+
1. Assign the following role. For detailed steps, see [Assign Azure roles using the Azure portal](../role-based-access-control/role-assignments-portal.yml).
256+
257+
| Setting | Value |
258+
| --- | --- |
259+
| **Role** | Select **AcrPull**. |
260+
| **Assign access to** | Select **User, group, or service principal**. |
261+
| **Members** | Enter the name of the project environment type that needs to access the image in the container. |
262+
263+
The project environment type displays like the following example:
264+
265+
:::image type="content" source="media/how-to-configure-extensibility-pulumi-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.":::
266+
267+
In this configuration, ADE uses the Managed Identity for the PET, whether system assigned or user assigned.
268+
269+
> [!Tip]
270+
> This role assignment has to be made for every project environment type. It can be automated through the Azure CLI.
271+
272+
When you're ready to push your image to your registry, run the following command:
273+
274+
```docker
275+
docker push {YOUR_REGISTRY}.azurecr.io/{YOUR_IMAGE_LOCATION}:{YOUR_TAG}
276+
```
277+
213278
### Connect the image to your environment definition
214279
215280
When authoring environment definitions to use your custom image in their deployment, edit the `runner` property on the manifest file (environment.yaml or manifest.yaml).
Loading
Loading
Loading

0 commit comments

Comments
 (0)