-
Notifications
You must be signed in to change notification settings - Fork 463
fix: Added a fallback to post-deployment scripts to derive resource values from solution-suffix naming when deployment outputs are missing #749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-v4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the robustness of post-deployment scripts by adding a fallback mechanism to retrieve resource configuration when deployment outputs are unavailable, and introduces delays to allow Azure resource configuration changes to propagate.
- Added fallback functions to reconstruct resource names from the
SolutionSuffixtag when deployment outputs are missing - Updated Bicep templates to include the
SolutionSuffixtag in resource group tags - Added 60-second delays after enabling public access for storage accounts and search services
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| infra/main.bicep | Added SolutionSuffix tag to resource group tags for fallback mechanism |
| infra/main_custom.bicep | Added SolutionSuffix tag to resource group tags for fallback mechanism |
| infra/scripts/Selecting-Team-Config-And-Data.ps1 | Added Get-ValuesUsingSolutionSuffix function and fallback logic; added sleep delays after enabling public access |
| infra/scripts/selecting_team_config_and_data.sh | Added get_values_using_solution_suffix function and fallback logic; added sleep delays after enabling public access |
Comments suppressed due to low confidence (4)
infra/scripts/selecting_team_config_and_data.sh:487
- The sleep statement is placed before checking if the command succeeded. If the az storage account update command fails, the script will still wait 60 seconds before checking the exit code and reporting the error. Move the sleep statement to after the error check (after line 487) to fail fast when the command errors.
sleep 60
if [[ $? -ne 0 ]]; then
echo "Error: Failed to enable public access for storage account."
exit 1
fi
infra/scripts/selecting_team_config_and_data.sh:501
- The sleep statement is placed before checking if the command succeeded. If the az search service update command fails, the script will still wait 60 seconds before checking the exit code and reporting the error. Move the sleep statement to after the error check (after line 501) to fail fast when the command errors.
sleep 60
if [[ $? -ne 0 ]]; then
echo "Error: Failed to enable public access for search service."
exit 1
fi
infra/scripts/Selecting-Team-Config-And-Data.ps1:512
- The sleep statement is placed before checking if the command succeeded. If the az storage account update command fails, the script will still wait 60 seconds before checking the exit code and reporting the error. Move the sleep statement to after the error check (after line 512) to fail fast when the command errors.
Start-Sleep -Seconds 60
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to enable public access for storage account."
exit 1
}
infra/scripts/Selecting-Team-Config-And-Data.ps1:527
- The sleep statement is placed before checking if the command succeeded. If the az search service update command fails, the script will still wait 60 seconds before checking the exit code and reporting the error. Move the sleep statement to after the error check (after line 527) to fail fast when the command errors.
Start-Sleep -Seconds 60
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to enable public access for search service."
exit 1
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Purpose
This pull request enhances the robustness of the infrastructure deployment scripts by introducing a fallback mechanism for retrieving resource configuration values using the
SolutionSuffixtag when deployment outputs are unavailable. It also adds short delays after enabling public access for certain Azure resources to ensure changes propagate correctly. The most important changes are:Fallback Logic for Resource Configuration Retrieval:
Get-ValuesUsingSolutionSuffixin PowerShell andget_values_using_solution_suffixin Bash) to reconstruct resource names and critical values from theSolutionSuffixtag in the resource group, improving reliability when deployment outputs are missing. [1] [2]SolutionSuffix, with user-friendly error messages and guidance if both methods fail. [1] [2]Infrastructure Tagging:
main.bicepandmain_custom.bicep) to include theSolutionSuffixtag in resource group tags, enabling the fallback mechanism. [1] [2]Operational Reliability Improvements:
Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information