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/azure-resource-manager/bicep/deployment-script-vnet-private-endpoint.md
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,32 +3,32 @@ title: Access a private virtual network from a Bicep deployment script
3
3
description: Learn how to run and test Bicep deployment scripts in private networks.
4
4
ms.custom: devx-track-bicep
5
5
ms.topic: how-to
6
-
ms.date: 12/13/2023
6
+
ms.date: 06/04/2024
7
7
---
8
8
9
9
# Run Bicep deployment script privately over a private endpoint
10
10
11
-
With the `2023-08-01` API version of the `Microsoft.Resources/deploymentScripts` resource it is possible to run deployment scripts privately in an Azure Container Instance.
11
+
With the [`Microsoft.Resources/deploymentScripts`](/azure/templates/microsoft.resources/deploymentscripts?pivots=deployment-language-bicep) resource API version `2023-08-01`, you can run deployment scripts privately within an Azure Container Instance (ACI).
12
12
13
-
This means that the Azure Container Instance created by the deployment script resource is running in a virtual network and is assigned a private IP address. The Azure Container Instance connects to a new or existing storage account over a private endpoint.
13
+
## Configure the environment
14
14
15
-
The `2023-08-01` API version introduces the `subnetIds` property under`containerSettings` to specify that the Azure Container Instance must be deployed in a subnet in the virtual network.
15
+
In this setup, the ACI created by deployment script runs within a virtual network and obtains a private IP address. It then establishes a connection to a new or pre-existing storage account via a private endpoint. The`containerSettings/subnetIds` property specifies the ACI that must be deployed in a subnet of the virtual network.
16
16
17
-
:::image type="content" source="./media/deployment-script-vnet-pe/bicep-deployment-script-pe-design.png" alt-text="Screenshot of high-level architecture showing how the infrastructure is connected to run deployment scripts privately.":::
17
+
:::image type="content" source="./media/deployment-script-vnet-private-endpoint/bicep-deployment-script-vnet-private-endpoint-diagram.jpg" alt-text="Screenshot of high-level architecture showing how the infrastructure is connected to run deployment scripts privately.":::
18
18
19
-
To run deployment scripts privately you need the following infrastructure as seen in the architecture image above:
19
+
To run deployment scripts privately you need the following infrastructure as seen in the architecture diagram:
20
20
21
21
- Create a virtual network with two subnets:
22
-
- Subnet for private endpoint
23
-
- Subnet for Azure Container Instance, this subnet needs a `Microsoft.ContainerInstance/containerGroups` delegation.
22
+
- A subnet for the private endpoint.
23
+
- A subnet for the ACI, this subnet needs a `Microsoft.ContainerInstance/containerGroups` delegation.
24
24
- Create a storage account with public network access `disabled`
25
25
- Create a private endpoint configured with the `file` sub-resource on the storage account
26
26
- Create a private DNS zone `privatelink.file.core.windows.net` and register the private endpoint IP address as an A record. Link the private DNS zone to the created virtual network.
27
-
- Create a user-assigned managed identity with `Storage File Data Privileged Contributor` permissions on the storage account and specify it in the `identity` property in the deployment script resource. To assign the identity, see [Identity](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deployment-script-develop#identity).
27
+
- Create a user-assigned managed identity with `Storage File Data Privileged Contributor` permissions on the storage account and specify it in the `identity` property in the deployment script resource. To assign the identity, see [Identity](/azure/azure-resource-manager/bicep/deployment-script-develop#identity).
28
28
29
-
The Azure Container Instance is deployed implicitly by the deployment script resource.
29
+
The ACI is deployed implicitly by the deployment script resource.
30
30
31
-
The following Bicep template shows the Bicep code needed to configure the infrastructure required for running a deployment script privately:
31
+
The following Bicep file configures the infrastructure required for running a deployment script privately:
32
32
33
33
```bicep
34
34
@maxLength(10) // Required maximum length, because the storage account has a maximum of 26 characters
The Azure Container Instance downloads container images from the Microsoft Container Registry. If you make use of a firewall whitelist the URL [mcr.microsoft.com](http://mcr.microsoft.com) to download the image successfully. If the container image cannot be downloaded it will go into a `waiting` state and will eventually throw a timeout error.
196
+
The ACI downloads container images from the Microsoft Container Registry. If you use a firewall, whitelist the URL [mcr.microsoft.com](http://mcr.microsoft.com) to download the image. Failure to download the container image will result in the ACI entering a `waiting` state, eventually leading to a timeout error.
0 commit comments