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-bicep-container-image.md
+20-30Lines changed: 20 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,11 @@ ms.topic: how-to
13
13
14
14
# Configure container image to execute deployments with ARM and Bicep
15
15
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).
17
17
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.
19
21
20
22
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.
21
23
@@ -24,12 +26,21 @@ The ADE CLI is a tool that allows you to build custom images by using ADE base i
24
26
## Prerequisites
25
27
26
28
- 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).
27
31
28
32
## Create and build a Docker image
29
33
30
34
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.
31
35
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
33
44
34
45
Include a FROM statement within a created DockerFile for your new image pointing to a sample image hosted on Microsoft Artifact Registry.
35
46
@@ -99,7 +110,7 @@ if [[ $ADE_TEMPLATE_FILE == *.json ]]; then
99
110
fi
100
111
fi
101
112
```
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.
103
114
```bash
104
115
echo"Signing into Azure using MSI"
105
116
whiletrue;do
@@ -135,7 +146,7 @@ az deployment group create --resource-group "$ADE_RESOURCE_GROUP_NAME" \
135
146
--template-file "$DIR/empty.json"
136
147
```
137
148
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:
139
150
```bash
140
151
if [ $?-eq 0 ];then# deployment successfully created
141
152
whiletrue;do
@@ -216,34 +227,13 @@ When authoring environment definitions to use your custom image in their deploym
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
229
231
230
-
1. Review the error details in the **Error Details** section.
:::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
240
235
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}
Copy file name to clipboardExpand all lines: articles/deployment-environments/how-to-configure-extensibility-generic-container-image.md
+10-49Lines changed: 10 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,11 @@ ms.topic: how-to
13
13
14
14
# Configure a container image to execute deployments
15
15
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).
17
17
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.
19
21
20
22
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.
21
23
@@ -24,6 +26,8 @@ The ADE CLI is a tool that allows you to build custom images by using ADE base i
24
26
## Prerequisites
25
27
26
28
- 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).
27
31
28
32
## Create and build a container image
29
33
@@ -36,9 +40,9 @@ To build an image configured for ADE, follow these steps:
36
40
1. Build and push your image to your container registry, and ensure it's accessible to ADE.
37
41
1. Reference your image in the `runner` property of your environment definition.
38
42
39
-
### Select an image by using the FROM statement
43
+
### Select a sample container image by using the FROM statement
40
44
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.
42
46
43
47
Here's an example FROM statement, referencing the sample core image:
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:
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}
0 commit comments