Skip to content

Conversation

@Harsh-Microsoft
Copy link
Contributor

Purpose

Added a fallback mechanism in Deployment/resourcedeployment.ps1 so that if deployment is not available, resource names and properties are reconstructed using the SolutionSuffix tag.

This pull request introduces improvements to the deployment resource mapping logic and updates the infrastructure templates for better reliability and compatibility. The most significant changes are the enhancement of the fallback mechanism in the deployment result mapping script, the addition of a new tag for resource group identification, and updates to the ARM template API versions.

Deployment script improvements:

  • Enhanced the MapResultAz method in Deployment/resourcedeployment.ps1 to add robust error handling and a fallback mechanism: if deployment outputs are not available, the script now reconstructs resource names and endpoints using the SolutionSuffix tag, ensuring deployments can still be mapped even if outputs are missing. [1] [2]

Infrastructure template updates:

  • Added a SolutionSuffix tag to the resource group in both infra/main.bicep and infra/main.json, enabling the fallback mechanism in the deployment script and improving resource identification. [1] [2]
  • Updated the Bicep-generated ARM templates (infra/main.json) to use a newer Bicep version and changed the apiVersion for multiple Microsoft.Resources/deployments resources from 2022-09-01 to 2025-04-01, ensuring compatibility with the latest Azure features and APIs. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]
  • Updated references to output values in infra/main.json to use the new API version in the listOutputsWithSecureValues function for Cosmos DB connection strings.

Template metadata:

  • Updated the Bicep template generator version and template hash in infra/main.json to reflect the new Bicep version. [1] [2] [3]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link

Copilot AI left a 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 introduces a robust fallback mechanism for deployment resource mapping when deployment outputs are unavailable. The changes ensure that deployments can still be mapped even if deployment history is lost or incomplete by using resource group tags to reconstruct resource names and properties.

Key Changes:

  • Enhanced the MapResultAz method in Deployment/resourcedeployment.ps1 with a two-tier approach: first attempting to retrieve values from deployment outputs, then falling back to reconstructing resource names using the SolutionSuffix tag
  • Added the SolutionSuffix tag to resource group tags in both Bicep and ARM templates to enable the fallback mechanism
  • Updated ARM template API versions from 2022-09-01 to 2025-04-01 for multiple Microsoft.Resources/deployments resources

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
Deployment/resourcedeployment.ps1 Implemented comprehensive fallback mechanism in MapResultAz method with error handling, resource name reconstruction, and endpoint generation when deployment outputs are unavailable
infra/main.bicep Added SolutionSuffix tag to resource group tags to support the PowerShell fallback mechanism
infra/main.json Updated Bicep generator version, added SolutionSuffix tag, and changed API versions for deployment resources from 2022-09-01 to 2025-04-01

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants