Skip to content

Commit d6448d5

Browse files
Merge pull request #1133 from microsoft/bugfix/avm-deployment-dev
fix: improve error handling in image build script
2 parents 5b42552 + 5351d3b commit d6448d5

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

infra/main.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.44.1.10279",
9-
"templateHash": "15739232766064275104"
9+
"templateHash": "13731968440732364764"
1010
},
1111
"name": "Multi-Agent Custom Automation Engine - Deployment Router",
1212
"description": "Deployment router for the Multi-Agent Custom Automation Engine accelerator. Routes to either the AVM or vanilla Bicep orchestrator and preserves a unified deployment contract."
@@ -561,7 +561,7 @@
561561
"_generator": {
562562
"name": "bicep",
563563
"version": "0.44.1.10279",
564-
"templateHash": "6625237371109264103"
564+
"templateHash": "15518088603134439540"
565565
},
566566
"name": "Multi-Agent Custom Automation Engine - AVM",
567567
"description": "AVM orchestrator for the Multi-Agent Custom Automation Engine accelerator. Deploys the same logical resources and preserves the same outputs as infra\\main.bicep using local AVM wrapper modules."
@@ -957,7 +957,7 @@
957957
"solutionSuffix": "[toLower(trim(replace(replace(replace(replace(replace(replace(format('{0}{1}', parameters('solutionName'), parameters('solutionUniqueText')), '-', ''), '_', ''), '.', ''), '/', ''), ' ', ''), '*', '')))]",
958958
"allTags": "[union(createObject('azd-env-name', parameters('solutionName')), parameters('tags'))]",
959959
"existingTags": "[coalesce(resourceGroup().tags, createObject())]",
960-
"resourceTags": "[union(variables('existingTags'), variables('allTags'), createObject('TemplateName', 'MACAE', 'Type', if(parameters('enablePrivateNetworking'), 'WAF', 'Non-WAF'), 'CreatedBy', parameters('createdBy'), 'DeploymentName', deployment().name, 'SolutionSuffix', variables('solutionSuffix'), 'SecurityControl', 'Ignore'))]",
960+
"resourceTags": "[union(variables('existingTags'), variables('allTags'), createObject('TemplateName', 'MACAE', 'Type', if(parameters('enablePrivateNetworking'), 'WAF', 'Non-WAF'), 'CreatedBy', parameters('createdBy'), 'DeploymentName', deployment().name, 'SolutionSuffix', variables('solutionSuffix')))]",
961961
"useExistingLogAnalytics": "[not(empty(parameters('existingLogAnalyticsWorkspaceId')))]",
962962
"existingLawSubscription": "[if(variables('useExistingLogAnalytics'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[2], '')]",
963963
"existingLawResourceGroup": "[if(variables('useExistingLogAnalytics'), split(parameters('existingLogAnalyticsWorkspaceId'), '/')[4], '')]",

infra/scripts/post-provision/build_and_push_images.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ update_container_app_image_and_port() {
4747
--resource-group "${RESOURCE_GROUP}" \
4848
--output json |
4949
jq \
50+
--arg app_name "${app_name}" \
5051
--arg container_name "${container_name}" \
5152
--arg image "${image}" \
5253
--arg registry_server "${registry_server}" \
5354
--argjson target_port "${target_port}" \
54-
'(.identity.userAssignedIdentities | keys[0]) as $identity_resource_id
55+
'if any(.properties.template.containers[]?; .name == $container_name) then
56+
.
57+
else
58+
error("Container \($container_name) was not found in Container App \($app_name)")
59+
end
60+
| (.identity.userAssignedIdentities | keys[0]) as $identity_resource_id
5561
| if $identity_resource_id == null then error("Container App does not have a user-assigned identity for ACR image pulls") else . end
5662
| (.properties.template.containers[] | select(.name == $container_name).image) = $image
5763
| .properties.configuration.ingress.targetPort = $target_port

0 commit comments

Comments
 (0)