Skip to content

Commit b7a6deb

Browse files
authored
Merge pull request #274246 from RoseHJM/ade-extensibility-iterations
ADE - iterations on Extensibility Model articles
2 parents 74f89c6 + 6cf88d3 commit b7a6deb

7 files changed

+109
-110
lines changed

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

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ ms.topic: how-to
1313

1414
# Configure container image to execute deployments with ARM and Bicep
1515

16-
In this article, you learn how to build and utilize custom images within your environment definitions for deployments 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 in Azure Deployment Environments (ADE).
1717

18-
ADE supports an extensibility model that enables you to create custom images that you can use in your environment definitions. To leverage this extensibility model, you can create your own custom images, and store them in a container registry like the [Microsoft Artifact Registry](https://mcr.microsoft.com/)(also known as the Microsoft Container Registry). You can then reference these images in your environment definitions to deploy your environments.
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+
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.
1921

2022
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.
2123

@@ -24,12 +26,21 @@ The ADE CLI is a tool that allows you to build custom images by using ADE base i
2426
## Prerequisites
2527

2628
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
29+
- Azure Deployment Environments set up in your Azure subscription.
30+
- To set up ADE, follow the [Quickstart: Create and configure a dev center for Azure Deployment Environments](quickstart-create-and-configure-devcenter.md).
2731

2832
## Create and build a Docker image
2933

3034
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.
3135

32-
### FROM statement
36+
To build an image configured for ADE, follow these steps:
37+
1. Base your image on an ADE-authored sample image or the image of your choice by using the FROM statement.
38+
1. Install any necessary packages for your image by using the RUN statement.
39+
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.
42+
43+
### Select a sample container image by using the FROM statement
3344

3445
Include a FROM statement within a created DockerFile for your new image pointing to a sample image hosted on Microsoft Artifact Registry.
3546

@@ -99,7 +110,7 @@ if [[ $ADE_TEMPLATE_FILE == *.json ]]; then
99110
fi
100111
fi
101112
```
102-
To provide the permissions a deployment requires to execute the deployment and deletion of resources within the subscription, use the privileged managed identity associated with the ADE project environment type. If your deployment needs special permissions to complete, such as particular roles, assign those roles to the project environment type's identity. Sometimes, the managed identity isn't immediately available when entering the container; you can retry until the login is successful.
113+
To provide the permissions a deployment requires to execute the deployment and deletion of resources within the subscription, use the privileged managed identity associated with the ADE project environment type. If your deployment needs special permissions to complete, such as particular roles, assign those roles to the project environment type's identity. Sometimes, the managed identity isn't immediately available when entering the container; you can retry until the sign-in is successful.
103114
```bash
104115
echo "Signing into Azure using MSI"
105116
while true; do
@@ -135,7 +146,7 @@ az deployment group create --resource-group "$ADE_RESOURCE_GROUP_NAME" \
135146
--template-file "$DIR/empty.json"
136147
```
137148

138-
You can check the provisioning state and details by running the below commands. ADE uses some special functions to read and provide additional context based on the provisioning details, which you can find in the [Runner-Images](https://github.com/Azure/deployment-environments/tree/custom-runner-private-preview/Runner-Images) folder. A simple implementation could be as follows:
149+
You can check the provisioning state and details by running the below commands. ADE uses some special functions to read and provide more context based on the provisioning details, which you can find in the [Runner-Images](https://github.com/Azure/deployment-environments/tree/custom-runner-private-preview/Runner-Images) folder. A simple implementation could be as follows:
139150
```bash
140151
if [ $? -eq 0 ]; then # deployment successfully created
141152
while true; do
@@ -216,34 +227,13 @@ When authoring environment definitions to use your custom image in their deploym
216227
runner: "{YOUR_REGISTRY}.azurecr.io/{YOUR_REPOSITORY}:{YOUR_TAG}"
217228
```
218229
219-
## Access operation logs and error details
220-
221-
ADE stores error details for a failed deployment the *$ADE_ERROR_LOG* file.
222-
223-
To troubleshoot a failed deployment:
224-
225-
1. Sign in to the [Developer Portal](https://devportal.microsoft.com/).
226-
1. Identify the environment that failed to deploy, and select **See details**.
227-
228-
:::image type="content" source="media/how-to-configure-extensibility-bicep-container-image/failed-deployment-card.png" alt-text="Screenshot showing failed deployment error details, specifically an invalid name for a storage account." lightbox="media/how-to-configure-extensibility-bicep-container-image/failed-deployment-card.png":::
230+
## Build a container image with a script
229231
230-
1. Review the error details in the **Error Details** section.
232+
[!INCLUDE [custom-image-script](includes/custom-image-script.md)]
231233
232-
:::image type="content" source="media/how-to-configure-extensibility-bicep-container-image/deployment-error-details.png" alt-text="Screenshot showing a failed deployment of an environment with the See Details button displayed." lightbox="media/how-to-configure-extensibility-bicep-container-image/deployment-error-details.png":::
233-
234-
Additionally, you can use the Azure CLI to view an environment's error details using the following command:
235-
```bash
236-
az devcenter dev environment show --environment-name {YOUR_ENVIRONMENT_NAME} --project {YOUR_PROJECT_NAME}
237-
```
238-
239-
To view the operation logs for an environment deployment or deletion, use the Azure CLI to retrieve the latest operation for your environment, and then view the logs for that operation ID.
234+
## Access operation logs and error details
240235
241-
```bash
242-
# Get list of operations on the environment, choose the latest operation
243-
az devcenter dev environment list-operation --environment-name {YOUR_ENVIRONMENT_NAME} --project {YOUR_PROJECT_NAME}
244-
# Using the latest operation ID, view the operation logs
245-
az devcenter dev environment show-logs-by-operation --environment-name {YOUR_ENVIRONMENT_NAME} --project {YOUR_PROJECT_NAME} --operation-id {LATEST_OPERATION_ID}
246-
```
236+
[!INCLUDE [custom-image-logs-errors](includes/custom-image-logs-errors.md)]
247237
248238
## Related content
249239

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

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ ms.topic: how-to
1313

1414
# Configure a container image to execute deployments
1515

16-
In this article, you learn how to build and utilize custom images within your environment definitions for deployments in Azure Deployment Environments (ADE).
16+
In this article, you learn how to build custom container images to deploy your environment definitions in Azure Deployment Environments (ADE).
1717

18-
ADE uses an extensibility model to enable you to create custom images to use in your environment definitions. By using the extensibility model, you can create your own custom images, and store them in a container registry like the [Azure Container Registry](/azure/container-registry/container-registry-intro). You can then reference these images in your environment definitions to deploy your environments.
18+
An environment definition comprises at least two files: a template file, like *azuredeploy.json*, and a manifest file named *environment.yaml*. ADE uses containers to deploy environment definitions, and natively supports the Azure Resource Manager (ARM) and Bicep IaC frameworks.
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.
1921

2022
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.
2123

@@ -24,6 +26,8 @@ The ADE CLI is a tool that allows you to build custom images by using ADE base i
2426
## Prerequisites
2527

2628
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
29+
- Azure Deployment Environments set up in your Azure subscription.
30+
- To set up ADE, follow the [Quickstart: Create and configure a dev center for Azure Deployment Environments](quickstart-create-and-configure-devcenter.md).
2731

2832
## Create and build a container image
2933

@@ -36,9 +40,9 @@ To build an image configured for ADE, follow these steps:
3640
1. Build and push your image to your container registry, and ensure it's accessible to ADE.
3741
1. Reference your image in the `runner` property of your environment definition.
3842

39-
### Select an image by using the FROM statement
43+
### Select a sample container image by using the FROM statement
4044

41-
To build a Docker image to utilize ADE deployments and access the ADE CLI, you should base your image on one of the ADE-authored images. Including a FROM statement within a created DockerFile for your new image that points to an ADE-authored sample image hosted on Microsoft Artifact Registry. When using ADE-authored images, it's recommended you build your custom image on the ADE core image.
45+
To build a Docker image to utilize ADE deployments and access the ADE CLI, you should base your image on one of the ADE-authored images. Including a FROM statement within a created DockerFile for your new image that points to an ADE-authored sample image hosted on Microsoft Artifact Registry. When using ADE-authored images, you should base your custom image on the ADE core image.
4246

4347
Here's an example FROM statement, referencing the sample core image:
4448

@@ -121,54 +125,11 @@ runner: "{YOUR_REGISTRY}.azurecr.io/{YOUR_REPOSITORY}:{YOUR_TAG}"
121125
122126
## Build a container image with a script
123127
124-
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`.
125-
126-
To use the script, you must:
127-
128-
1. Configure a Dockerfile and scripts folder to support the ADE extensibility model.
129-
1. Supply a registry name and directory for your custom image.
130-
1. Have the Azure CLI and Docker Desktop installed and in your PATH variables.
131-
1. Have permissions to push to the specified registry.
132-
133-
You can run the script [here](https://github.com/Azure/deployment-environments/blob/custom-runner-private-preview/Runner-Images/quickstart-image-build.ps1).
134-
135-
You can call the script using the following command in PowerShell:
136-
```powershell
137-
.\quickstart-image-build.ps1 -Registry '{YOUR_REGISTRY}' -Directory '{DIRECTORY_TO_YOUR_IMAGE}'
138-
```
139-
Additionally, if you would like to push to a specific repository and tag name, you can run:
140-
```powershell
141-
.\quickstart-image.build.ps1 -Registry '{YOUR_REGISTRY}' -Directory '{DIRECTORY_TO_YOUR_IMAGE}' -Repository '{YOUR_REPOSITORY}' -Tag '{YOUR_TAG}'
142-
```
128+
[!INCLUDE [custom-image-script](includes/custom-image-script.md)]
143129
144130
## Access operation logs and error details
145131
146-
ADE stores error details for a failed deployment in the *$ADE_ERROR_LOG* file within the container.
147-
148-
To troubleshoot a failed deployment:
149-
150-
1. Sign in to the [Developer Portal](https://devportal.microsoft.com/).
151-
1. Identify the environment that failed to deploy, and select **See details**.
152-
153-
:::image type="content" source="media/how-to-configure-extensibility-generic-container-image/failed-deployment-card.png" alt-text="Screenshot showing failed deployment error details, specifically an invalid name for a storage account." lightbox="media/how-to-configure-extensibility-generic-container-image/failed-deployment-card.png":::
154-
155-
1. Review the error details in the **Error Details** section.
156-
157-
:::image type="content" source="media/how-to-configure-extensibility-generic-container-image/deployment-error-details.png" alt-text="Screenshot showing a failed deployment of an environment with the See Details button displayed." lightbox="media/how-to-configure-extensibility-generic-container-image/deployment-error-details.png":::
158-
159-
Additionally, you can use the Azure CLI to view an environment's error details using the following command:
160-
```bash
161-
az devcenter dev environment show --environment-name {YOUR_ENVIRONMENT_NAME} --project {YOUR_PROJECT_NAME}
162-
```
163-
164-
To view the operation logs for an environment deployment or deletion, use the Azure CLI to retrieve the latest operation for your environment, and then view the logs for that operation ID.
165-
166-
```bash
167-
# Get list of operations on the environment, choose the latest operation
168-
az devcenter dev environment list-operation --environment-name {YOUR_ENVIRONMENT_NAME} --project {YOUR_PROJECT_NAME}
169-
# Using the latest operation ID, view the operation logs
170-
az devcenter dev environment show-logs-by-operation --environment-name {YOUR_ENVIRONMENT_NAME} --project {YOUR_PROJECT_NAME} --operation-id {LATEST_OPERATION_ID}
171-
```
132+
[!INCLUDE [custom-image-logs-errors](includes/custom-image-logs-errors.md)]
172133
173134
## Related content
174135

0 commit comments

Comments
 (0)