Skip to content

Commit 556d126

Browse files
author
RoseHJM
committed
Renumbering tabbed content
1 parent 436c9fa commit 556d126

File tree

2 files changed

+48
-37
lines changed

2 files changed

+48
-37
lines changed

articles/deployment-environments/how-to-configure-extensibility-model-custom-image.md

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ An [environment definition](configure-environment-definition.md) comprises at le
4040
::: zone-end
4141

4242
::: 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.
4444
::: zone-end
4545

4646
## Prerequisites
@@ -103,8 +103,6 @@ Creating a custom container image allows you to customize your deployments to fi
103103

104104
After you complete the image customization, you must build the image and push it to your container registry.
105105

106-
### Create and customize a container image
107-
108106
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).
109107

110108
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:
133131
1. Create operation shell scripts that use the Pulumi CLI.
134132
::: zone-end
135133

136-
#### 1. Create a custom image based on a sample image
134+
**1. Create a custom image based on a sample image**
137135

138136
Create a DockerFile that includes a FROM statement pointing to a sample image hosted on Microsoft Artifact Registry.
139137

@@ -145,7 +143,7 @@ FROM mcr.microsoft.com/deployment-environments/runners/core:latest
145143

146144
This statement pulls the most recently published core image, and makes it a basis for your custom image.
147145

148-
#### 2. Install required packages
146+
**2. Install required packages**
149147
::: zone pivot="arm-bicep"
150148
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:
151149

@@ -180,7 +178,7 @@ RUN curl -fsSL https://get.pulumi.com | sh
180178
ENV PATH="${PATH}:/root/.pulumi/bin"
181179
```
182180

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.
184182

185183
Here's an example of installing Node.js and TypeScript:
186184

@@ -195,7 +193,7 @@ The ADE sample images are based on the Azure CLI image, and have the ADE CLI and
195193

196194
To install any more packages you need within your image, use the RUN statement.
197195

198-
#### 3. Configure operation shell scripts
196+
**3. Configure operation shell scripts**
199197

200198
Within the sample images, operations are determined and executed based on the operation name. Currently, the two operation names supported are *deploy* and *delete*.
201199

@@ -211,7 +209,7 @@ RUN find /scripts/ -type f -iname "*.sh" -exec chmod +x {} \;
211209

212210
::: zone pivot="arm-bicep"
213211

214-
#### 4. Create operation shell scripts to deploy ARM or Bicep templates
212+
**4. Create operation shell scripts to deploy ARM or Bicep templates**
215213

216214
To ensure you can successfully deploy ARM or Bicep infrastructure through ADE, you must:
217215
1. Convert ADE parameters to ARM-acceptable parameters
@@ -319,7 +317,7 @@ echo "{\"outputs\": $deploymentOutput}" > $ADE_OUTPUTS
319317

320318
::: zone pivot="terraform"
321319

322-
#### 4. Create operation shell scripts that use the Terraform CLI
320+
**4. Create operation shell scripts that use the Terraform CLI**
323321

324322
There are three steps to deploy infrastructure via Terraform:
325323
1. `terraform init` - initializes the Terraform CLI to perform actions within the working directory
@@ -407,7 +405,7 @@ export PULUMI_CONFIG_PASSPHRASE=
407405
pulumi login file://$ADE_STORAGE
408406
```
409407

410-
To log in to Pulumi Cloud instead, set your Pulumi access token as an environment variable, and run the following commands:
408+
To sign in to Pulumi Cloud instead, set your Pulumi access token as an environment variable, and run the following commands:
411409

412410
```bash
413411
export PULUMI_ACCESS_TOKEN=YOUR_PULUMI_ACCESS_TOKEN
@@ -459,18 +457,26 @@ echo "{\"outputs\": ${stackout:-{\}}}" > $ADE_OUTPUTS
459457
```
460458
::: zone-end
461459

462-
## Make the custom image accessible to ADE
460+
## Make the custom image available to ADE
461+
462+
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.
463465

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.
465470

466471
::: zone pivot="arm-bicep,terraform"
467-
You can build your image using the Docker CLI, or by using a script provided by ADE.
468472

469473
Select the appropriate tab to learn more about each approach.
470474

471-
### [Build the image with Docker CLI](#tab/build-the-image-with-docker-cli/)
475+
### [Public registry](#tab/public-registry/)
472476

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:
474480

475481
```docker
476482
docker build . -t {YOUR_REGISTRY}.azurecr.io/{YOUR_REPOSITORY}:{YOUR_TAG}
@@ -482,20 +488,7 @@ For example, if you want to save your image under a repository within your regis
482488
docker build . -t {YOUR_REGISTRY}.azurecr.io/customImage:1.0.0
483489
```
484490

485-
### Push the Docker image to a registry
486-
487-
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**
499492

500493
To set up your registry to have anonymous image pull enabled, run the following commands in the Azure CLI:
501494

@@ -511,12 +504,29 @@ When you're ready to push your image to your registry, run the following command
511504
```docker
512505
docker push {YOUR_REGISTRY}.azurecr.io/{YOUR_IMAGE_LOCATION}:{YOUR_TAG}
513506
```
507+
### [Private registry](#tab/private-registry/)
514508

515-
#### Use ACR with secured access
509+
**1. Build the image**
510+
511+
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:
512+
513+
```docker
514+
docker build . -t {YOUR_REGISTRY}.azurecr.io/{YOUR_REPOSITORY}:{YOUR_TAG}
515+
```
516+
517+
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:
518+
519+
```docker
520+
docker build . -t {YOUR_REGISTRY}.azurecr.io/customImage:1.0.0
521+
```
522+
523+
**2. Use a private registry with secured access**
516524

517525
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.
518526

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**
520530

521531
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*.
522532

@@ -533,7 +543,7 @@ To disable access from public networks:
533543

534544
:::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.":::
535545

536-
##### Assign the AcrPull role
546+
**2.2 Assign the AcrPull role**
537547

538548
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.
539549

@@ -564,13 +574,14 @@ When you're ready to push your image to your registry, run the following command
564574
```docker
565575
docker push {YOUR_REGISTRY}.azurecr.io/{YOUR_IMAGE_LOCATION}:{YOUR_TAG}
566576
```
567-
577+
---
568578

569579
## [Build a container image with a script](#tab/build-a-container-image-with-a-script/)
570580

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.
582+
571583
[!INCLUDE [custom-image-script](includes/custom-image-script.md)]
572584

573-
---
574585
::: zone-end
575586

576587
::: zone pivot="pulumi"
@@ -588,7 +599,7 @@ For example, if you want to save your image under a repository within your regis
588599
docker build . -t {YOUR_REGISTRY}.azurecr.io/customImage:1.0.0
589600
```
590601

591-
### Push the Docker image to a registry
602+
### Push the custom image to a registry
592603

593604
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.
594605

@@ -600,7 +611,7 @@ You can use Pulumi to create an Azure Container Registry and publish your image
600611

601612
#### Create an Azure Container Registry and publish your image manually via CLI
602613

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.
604615

605616
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.
606617

articles/deployment-environments/includes/custom-image-script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: rosemalcolm
66
ms.date: 05/23/2024
77
---
88

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`.
1010

1111
To use the script, you must:
1212

0 commit comments

Comments
 (0)