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-model-custom-image.md
+47-36Lines changed: 47 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ An [environment definition](configure-environment-definition.md) comprises at le
40
40
::: zone-end
41
41
42
42
::: zone pivot="pulumi"
43
-
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.
43
+
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 might also contain a user program written in your preferred programming language: C#, TypeScript, Python, etc. ADE uses containers to deploy environment definitions.
44
44
::: zone-end
45
45
46
46
## Prerequisites
@@ -103,8 +103,6 @@ Creating a custom container image allows you to customize your deployments to fi
103
103
104
104
After you complete the image customization, you must build the image and push it to your container registry.
105
105
106
-
### Create and customize a container image
107
-
108
106
The ADE CLI is a tool that allows you to build custom images by using ADE base images. You can use the ADE CLI to customize your deployments and deletions to fit your workflow. The ADE CLI is preinstalled on the sample images. To learn more about the ADE CLI, see the [CLI Custom Runner Image reference](https://aka.ms/deployment-environments/ade-cli-reference).
109
107
110
108
In this example, you learn how to build a Docker image to utilize ADE deployments and access the ADE CLI, basing your image off of one of the ADE authored images.
@@ -133,7 +131,7 @@ To create an image configured for ADE, follow these steps:
133
131
1. Create operation shell scripts that use the Pulumi CLI.
134
132
::: zone-end
135
133
136
-
#### 1. Create a custom image based on a sample image
134
+
**1. Create a custom image based on a sample image**
137
135
138
136
Create a DockerFile that includes a FROM statement pointing to a sample image hosted on Microsoft Artifact Registry.
139
137
@@ -145,7 +143,7 @@ FROM mcr.microsoft.com/deployment-environments/runners/core:latest
145
143
146
144
This statement pulls the most recently published core image, and makes it a basis for your custom image.
147
145
148
-
#### 2. Install required packages
146
+
**2. Install required packages**
149
147
::: zone pivot="arm-bicep"
150
148
In this step, you install any packages you require in your image, including Bicep. You can install the Bicep package with the Azure CLI by using the RUN statement, as shown in the following example:
151
149
@@ -180,7 +178,7 @@ RUN curl -fsSL https://get.pulumi.com | sh
180
178
ENV PATH="${PATH}:/root/.pulumi/bin"
181
179
```
182
180
183
-
Depending on which programming language you intend to use for Pulumi programs, you might need to install one or more corresponding runtime. The Python runtime is already available in the base image.
181
+
Depending on which programming language you intend to use for Pulumi programs, you might need to install one or more corresponding runtimes. The Python runtime is already available in the base image.
184
182
185
183
Here's an example of installing Node.js and TypeScript:
186
184
@@ -195,7 +193,7 @@ The ADE sample images are based on the Azure CLI image, and have the ADE CLI and
195
193
196
194
To install any more packages you need within your image, use the RUN statement.
197
195
198
-
#### 3. Configure operation shell scripts
196
+
**3. Configure operation shell scripts**
199
197
200
198
Within the sample images, operations are determined and executed based on the operation name. Currently, the two operation names supported are *deploy* and *delete*.
201
199
@@ -211,7 +209,7 @@ RUN find /scripts/ -type f -iname "*.sh" -exec chmod +x {} \;
211
209
212
210
::: zone pivot="arm-bicep"
213
211
214
-
#### 4. Create operation shell scripts to deploy ARM or Bicep templates
212
+
**4. Create operation shell scripts to deploy ARM or Bicep templates**
215
213
216
214
To ensure you can successfully deploy ARM or Bicep infrastructure through ADE, you must:
217
215
1. Convert ADE parameters to ARM-acceptable parameters
In order to use custom images, you need to store them in a container registry. You can use a public container registry or a private container registry. Azure Container Registry (ACR) is highly recommended, due to its tight integration with ADE, the image can be published without allowing public anonymous pull access. You must build your custom container image and push it to a container registry to make it available for use in ADE.
463
+
464
+
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.
463
465
464
-
You must build your custom container image and push it to a container registry to make it available for use in ADE.
466
+
> [!Caution]
467
+
> Storing your container image in a registry with anonymous (unauthenticated) pull access makes it publicly accessible. Don't do that if your image contains any sensitive information. Instead, store it in Azure Container Registry (ACR) with anonymous pull access disabled.
468
+
469
+
To use a custom image stored in 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.
465
470
466
471
::: zone pivot="arm-bicep,terraform"
467
-
You can build your image using the Docker CLI, or by using a script provided by ADE.
468
472
469
473
Select the appropriate tab to learn more about each approach.
470
474
471
-
### [Build the image with Docker CLI](#tab/build-the-image-with-docker-cli/)
475
+
### [Public registry](#tab/public-registry/)
472
476
473
-
Before you build the image to be pushed to your registry, ensure the [Docker Engine is installed](https://docs.docker.com/desktop/) on your computer. Then, navigate to the directory of your Dockerfile, and run the following command:
477
+
**1. Build the image**
478
+
479
+
You can build your image using the Docker CLI. Ensure the [Docker Engine is installed](https://docs.docker.com/desktop/) on your computer. Then, navigate to the directory of your Dockerfile, and run the following command:
In order to use custom images, you need to store them in a container registry. You can use a public container registry or a private 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.
488
-
489
-
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.
490
-
491
-
> [!Caution]
492
-
> Storing your container image in a registry with anonymous (unauthenticated) pull access makes it publicly accessible. Don't do that if your image contains any sensitive information. Instead, store it in Azure Container Registry (ACR) with anonymous pull access disabled.
493
-
494
-
To use a custom image stored in 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.
495
-
496
-
To create an instance of 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).
497
-
498
-
#### Use a public registry with anonymous pull
491
+
**2. Use a public registry with anonymous pull**
499
492
500
493
To set up your registry to have anonymous image pull enabled, run the following commands in the Azure CLI:
501
494
@@ -511,12 +504,29 @@ When you're ready to push your image to your registry, run the following command
You can build your image using the Docker CLI. Ensure the [Docker Engine is installed](https://docs.docker.com/desktop/) on your computer. Then, navigate to the directory of your Dockerfile, and run the following command:
For example, if you want to save your image under a repository within your registry named `customImage`, and upload with the tag version of `1.0.0`, you would run:
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.
518
526
519
-
##### Limit network access
527
+
To create an instance of 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).
528
+
529
+
**2.1 Limit network access**
520
530
521
531
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*.
522
532
@@ -533,7 +543,7 @@ To disable access from public networks:
533
543
534
544
:::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.":::
535
545
536
-
##### Assign the AcrPull role
546
+
**2.2 Assign the AcrPull role**
537
547
538
548
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.
539
549
@@ -564,13 +574,14 @@ When you're ready to push your image to your registry, run the following command
## [Build a container image with a script](#tab/build-a-container-image-with-a-script/)
570
580
581
+
Rather than building your custom image and pushing it to a container registry yourself, you can use a script to build and push it to a specified container registry.
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.
594
605
@@ -600,7 +611,7 @@ You can use Pulumi to create an Azure Container Registry and publish your image
600
611
601
612
#### Create an Azure Container Registry and publish your image manually via CLI
602
613
603
-
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.
614
+
In order to use custom images, you need to store them in a container registry. Azure Container Registry (ACR) is highly recommended, due to its tight integration with ADE, the image can be published without allowing public anonymous pull access.
604
615
605
616
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.
Copy file name to clipboardExpand all lines: articles/deployment-environments/includes/custom-image-script.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: rosemalcolm
6
6
ms.date: 05/23/2024
7
7
---
8
8
9
-
Microsoft provides a quickstart script to help you get started. The script builds your image and pushes it to a specified Azure Container Registry (ACR) under the repository `ade` and the tag `latest`.
9
+
Microsoft provides a quickstart script to help you build your custom image and push it to a registry. The script builds your image and pushes it to a specified Azure Container Registry (ACR) under the repository `ade` and the tag `latest`.
0 commit comments