Skip to content

Commit 9bb3223

Browse files
authored
Merge pull request #275796 from RoseHJM/ade-extensibilty-model-restructure-bicep
ADE - Extensibility Bicep - Restructure
2 parents e6a6c9d + 6727a0f commit 9bb3223

File tree

2 files changed

+55
-14
lines changed

2 files changed

+55
-14
lines changed

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

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use the ADE extensibility model to build and utilize c
55
ms.service: deployment-environments
66
author: RoseHJM
77
ms.author: rosemalcolm
8-
ms.date: 04/13/2024
8+
ms.date: 05/28/2024
99
ms.topic: how-to
1010

1111
#customer intent: As a developer, I want to learn how to build and utilize custom images within my environment definitions for deployment environments.
@@ -21,24 +21,55 @@ The ADE extensibility model enables you to create custom container images to use
2121

2222
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.
2323

24-
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).
25-
2624
## Prerequisites
2725

2826
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2927
- Azure Deployment Environments set up in your Azure subscription.
3028
- To set up ADE, follow the [Quickstart: Configure Azure Deployment Environments](quickstart-create-and-configure-devcenter.md).
3129

32-
## Create and build a Docker image
30+
## Use container images with ADE
31+
32+
You can take one of the following approaches to use container images with ADE:
33+
- **Use the standard container image:** For simple scenarios, use the standard Bicep container image provided by ADE.
34+
- **Create a custom container image:** For more complex scenarios, create a custom container image that meets your specific requirements.
35+
36+
Regardless of which approach you choose, you must specify the container image in your environment definition to deploy your Azure resources.
37+
38+
## Use the standard Bicep container image
39+
40+
ADE supports Bicep natively, so you can configure an environment definition that deploys Azure resources for a deployment environment by adding the template files (azuredeploy.json and environment.yaml) to your catalog. ADE then uses the standard Bicep container image to create the deployment environment.
41+
42+
In the environment.yaml file, the runner property specifies the location of the container image you want to use. To use the sample image published on the Microsoft Artifact Registry, use the respective identifiers runner, as listed in the following table.
43+
44+
The following example shows a runner that references the sample Bicep container image:
45+
```yaml
46+
name: WebApp
47+
version: 1.0.0
48+
summary: Azure Web App Environment
49+
description: Deploys a web app in Azure without a datastore
50+
runner: Bicep
51+
templatePath: azuredeploy.json
52+
```
53+
You can see the standard Bicep container image in the ADE sample repository under the [Runner-Images folder for the ARM-Bicep](https://github.com/Azure/deployment-environments/tree/main/Runner-Images/ARM-Bicep) image.
54+
55+
For more information about how to create environment definitions that use the ADE container images to deploy your Azure resources, see [Add and configure an environment definition](configure-environment-definition.md).
56+
57+
## Create a custom Bicep container image
58+
59+
Creating a custom container image allows you to customize your deployments to fit your requirements. You can create custom images based on the ADE standard container images.
60+
61+
After you complete the image customization, you must build the image and push it to your container registry.
62+
63+
### Create and customize a container image with Docker
3364
3465
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.
3566
36-
To build an image configured for ADE, follow these steps:
67+
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).
68+
69+
To create an image configured for ADE, follow these steps:
3770
1. Base your image on an ADE-authored sample image or the image of your choice by using the FROM statement.
3871
1. Install any necessary packages for your image by using the RUN statement.
3972
1. Create a *scripts* folder at the same level as your Dockerfile, store your *deploy.sh* and *delete.sh* files within it, and ensure those scripts are discoverable and executable inside your created container. This step is necessary for your deployment to work using the ADE core image.
40-
1. Build and push your image to your container registry, and ensure it's accessible to ADE.
41-
1. Reference your image in the `runner` property of your environment definition.
4273
4374
### Select a sample container image by using the FROM statement
4475
@@ -181,8 +212,13 @@ fi
181212
echo "{\"outputs\": $deploymentOutput}" > $ADE_OUTPUTS
182213
```
183214

215+
## Make the custom image accessible to ADE
184216

185-
### Build the image
217+
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.
218+
219+
Select the appropriate tab to learn more about each approach.
220+
221+
### [Build the image with Docker CLI](#tab/build-the-image-with-docker-cli/)
186222

187223
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:
188224

@@ -196,7 +232,7 @@ For example, if you want to save your image under a repository within your regis
196232
docker build . -t {YOUR_REGISTRY}.azurecr.io/customImage:1.0.0
197233
```
198234

199-
## Push the Docker image to a registry
235+
### Push the Docker image to a registry
200236

201237
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.
202238

@@ -219,6 +255,12 @@ When you're ready to push your image to your registry, run the following command
219255
docker push {YOUR_REGISTRY}.azurecr.io/{YOUR_IMAGE_LOCATION}:{YOUR_TAG}
220256
```
221257

258+
## [Build a container image with a script](#tab/build-a-container-image-with-a-script/)
259+
260+
[!INCLUDE [custom-image-script](includes/custom-image-script.md)]
261+
262+
---
263+
222264
## Connect the image to your environment definition
223265

224266
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).
@@ -227,9 +269,7 @@ When authoring environment definitions to use your custom image in their deploym
227269
runner: "{YOUR_REGISTRY}.azurecr.io/{YOUR_REPOSITORY}:{YOUR_TAG}"
228270
```
229271
230-
## Build a container image with a script
231-
232-
[!INCLUDE [custom-image-script](includes/custom-image-script.md)]
272+
To learn more about how to create environment definitions that use the ADE container images to deploy your Azure resources, see [Add and configure an environment definition](configure-environment-definition.md).
233273
234274
## Access operation logs and error details
235275
@@ -238,3 +278,4 @@ runner: "{YOUR_REGISTRY}.azurecr.io/{YOUR_REPOSITORY}:{YOUR_TAG}"
238278
## Related content
239279
240280
- [ADE CLI Custom Runner Image reference](https://aka.ms/deployment-environments/ade-cli-reference)
281+
- [ADE CLI variables reference](reference-deployment-environment-variables.md)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Microsoft provides a quickstart script to help you get started. The script build
1010

1111
To use the script, you must:
1212

13-
1. Configure a Dockerfile and scripts folder to support the ADE extensibility model.
13+
1. Create a Dockerfile and scripts folder to support the ADE extensibility model.
1414
1. Supply a registry name and directory for your custom image.
1515
1. Have the Azure CLI and Docker Desktop installed and in your PATH variables.
1616
1. Have permissions to push to the specified registry.
1717

18-
You can run the script [here](https://github.com/Azure/deployment-environments/blob/main/Runner-Images/quickstart-image-build.ps1).
18+
You can view the script [here](https://github.com/Azure/deployment-environments/blob/main/Runner-Images/quickstart-image-build.ps1).
1919

2020
You can call the script using the following command in PowerShell:
2121
```powershell

0 commit comments

Comments
 (0)