fix: Added a fallback to post-deployment scripts to derive resource values from solution-suffix naming when deployment outputs are missing#711
Open
Harsh-Microsoft wants to merge 2 commits intodevfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a fallback mechanism to retrieve resource configuration values from the solutionSuffix tag when deployment outputs are unavailable or deleted. The changes enhance the resilience of post-deployment scripts (process_sample_data.sh and process_custom_data.sh) by automatically attempting the fallback method when deployment outputs cannot be retrieved, eliminating the need for manual value entry in most cases.
Key changes include:
- Addition of
get_values_from_solution_suffix()function to both scripts that constructs resource names using Azure naming conventions and the solutionSuffix tag - Updated error handling to automatically fall back to the tag-based method when deployment outputs are missing
- Addition of
SolutionSuffixtag to resource group in both Bicep template and generated ARM template to support the fallback mechanism
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| infra/scripts/process_sample_data.sh | Adds fallback function to derive resource values from solutionSuffix tag and naming conventions; updates deployment outputs retrieval to handle missing deployments gracefully; adds usecase to summary output |
| infra/scripts/process_custom_data.sh | Adds fallback function to derive resource values from solutionSuffix tag and naming conventions; updates deployment outputs retrieval to handle missing deployments gracefully |
| infra/main.bicep | Adds SolutionSuffix to resource group tags to support fallback mechanism |
| infra/main.json | Updates template hash; adds SolutionSuffix to resource group tags; reorders DNS zone dependencies (cosmetic, auto-generated) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…h and process_sample_data.sh
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
This pull request introduces a robust fallback mechanism to the deployment and sample data processing scripts, allowing resource values to be retrieved using the
solutionSuffixfrom resource group tags when deployment outputs are unavailable. It also ensures that thesolutionSuffixis consistently tagged in resources, and improves the reliability of resource dependency ordering in the ARM template. These changes make the deployment process more resilient to missing or deleted deployments and maintain consistency in resource naming and metadata.Script enhancements for resiliency and automation:
get_values_from_solution_suffixto bothprocess_custom_data.shandprocess_sample_data.sh, enabling resource name and property generation using thesolutionSuffixtag and Azure naming conventions when deployment outputs are missing. This includes logic to fetch managed identity client IDs, endpoints, and resource IDs, and prompts for manual use case entry if not found in tags. [1] [2]Infrastructure and template consistency:
SolutionSuffixproperty to resource group tags in both the Bicep (main.bicep) and generated ARM template (main.json), ensuring the tag is always available for fallback logic and resource identification. [1] [2]Other technical updates:
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information