fix: updated get values from Azure deployment outputs#995
Open
vishalsvs7 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the post-deployment build_and_push_images.sh script to retrieve required values from an Azure resource group’s deployment outputs (instead of only relying on azd env), and adds validation/reporting for missing outputs.
Changes:
- Enhances
get_values_from_az_deployment()to fetch deployment outputs once and extract required output values with clearer missing-value reporting. - Adds a required-values list and prints a sorted list of missing Azure deployment outputs when extraction fails.
- Updates ACR public network configuration toggling flags used during remote builds.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+100
to
+104
| extract_value() { | ||
| echo "$deploymentOutputs" | grep -i -A 3 "\"$1\"" | grep '"value"' | sed 's/.*"value": *"\([^"]*\)".*/\1/' | ||
| local primary_key="$1" | ||
| local fallback_key="$2" | ||
| local value | ||
|
|
| frontendAppName=$(extract_value "frontenD_APP_NAME" "FRONTEND_APP_NAME") | ||
|
|
||
| # Define required values with their display names | ||
| declare -A required_values=( |
| ) | ||
|
|
||
| # Validate required values | ||
| missing_values=() |
Comment on lines
+181
to
+185
| case "$original_acr_public_access" in | ||
| "enabled"|"Enabled") restore_value=true ;; | ||
| "disabled"|"Disabled") restore_value=false ;; | ||
| *) restore_value="$original_acr_public_access" ;; | ||
| esac |
| --name "$acrName" \ | ||
| --resource-group "$resourceGroupName" \ | ||
| --public-network-access Enabled \ | ||
| --public-network-enabled true \ |
Comment on lines
+165
to
+170
| az acr update \ | ||
| --name "$acrName" \ | ||
| --resource-group "$resourceGroupName" \ | ||
| --public-network-enabled true \ | ||
| --default-action Allow \ | ||
| --output none |
| --name "$acrName" \ | ||
| --resource-group "$resourceGroupName" \ | ||
| --public-network-access "$original_acr_public_access" \ | ||
| --public-network-enabled $restore_value \ |
Comment on lines
+89
to
+90
| deploymentName=$(az group show --name "$resourceGroupName" --query "tags.DeploymentName" -o tsv) | ||
| echo "Deployment Name (from tag): $deploymentName" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Getting values from Azure deployment outputs
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation