Skip to content

Commit 5e4977d

Browse files
author
RoseHJM
committed
Merge branch 'ade-runner' of https://github.com/RoseHJM/azure-docs-pr into ade-runner
2 parents f3a218f + 6203b68 commit 5e4977d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,22 @@ deploymentParameters=$(echo "$ADE_OPERATION_PARAMETERS" | jq --compact-output '{
8181

8282
Next, to resolve any linked templates used within an ARM JSON-based template, you can decompile the main template file, which resolves all the local infrastructure files used into many Bicep modules. Then, rebuild those modules back into a single ARM template with the linked templates embedded into the main ARM template as nested templates. This step is only necessary during the deployment operation. The main template file can be specified using the `$ADE_TEMPLATE_FILE` set during the core image's entrypoint, and you should reset this variable with the recompiled template file. See the following example:
8383
```bash
84-
hasRelativePath=$( cat $ADE_TEMPLATE_FILE | jq '[.. | objects | select(has("templateLink") and (.templateLink | has("relativePath")))] | any' )
84+
if [[ $ADE_TEMPLATE_FILE == *.json ]]; then
8585

86-
if [ "$hasRelativePath" = "true" ]; then
87-
echo "Resolving linked ARM templates"
86+
hasRelativePath=$( cat $ADE_TEMPLATE_FILE | jq '[.. | objects | select(has("templateLink") and (.templateLink | has("relativePath")))] | any' )
8887

89-
bicepTemplate="${ADE_TEMPLATE_FILE/.json/.bicep}"
90-
generatedTemplate="${ADE_TEMPLATE_FILE/.json/.generated.json}"
88+
if [ "$hasRelativePath" = "true" ]; then
89+
echo "Resolving linked ARM templates"
9190

92-
az bicep decompile --file "$ADE_TEMPLATE_FILE"
93-
az bicep build --file "$bicepTemplate" --outfile "$generatedTemplate"
91+
bicepTemplate="${ADE_TEMPLATE_FILE/.json/.bicep}"
92+
generatedTemplate="${ADE_TEMPLATE_FILE/.json/.generated.json}"
9493

95-
# Correctly reassign ADE_TEMPLATE_FILE without the $ prefix during assignment
96-
ADE_TEMPLATE_FILE="$generatedTemplate"
94+
az bicep decompile --file "$ADE_TEMPLATE_FILE"
95+
az bicep build --file "$bicepTemplate" --outfile "$generatedTemplate"
96+
97+
# Correctly reassign ADE_TEMPLATE_FILE without the $ prefix during assignment
98+
ADE_TEMPLATE_FILE="$generatedTemplate"
99+
fi
97100
fi
98101
```
99102
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.

0 commit comments

Comments
 (0)