Skip to content

fix: resolve Event Grid MI delivery authorization failure#2277

Open
Vamshi-Microsoft wants to merge 4 commits into
Azure-Samples:dev-v2from
Vamshi-Microsoft:psl-vk-remove-eventtopicMI
Open

fix: resolve Event Grid MI delivery authorization failure#2277
Vamshi-Microsoft wants to merge 4 commits into
Azure-Samples:dev-v2from
Vamshi-Microsoft:psl-vk-remove-eventtopicMI

Conversation

@Vamshi-Microsoft

@Vamshi-Microsoft Vamshi-Microsoft commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Purpose

This pull request makes a series of improvements to the v2/infra/main.bicep file, focusing on code readability, maintainability, and resource provisioning reliability. The main themes are: reformatting long lines for better readability, restructuring resource and variable assignments for clarity, and introducing a more reliable pattern for Event Grid system topic provisioning to avoid deployment race conditions.

Key changes include:

Resource provisioning reliability:

  • Introduced a new three-step provisioning pattern for Event Grid system topics to ensure the system-assigned managed identity is available before role assignment and event subscription creation. This prevents deployment errors caused by role assignment propagation delays.

Readability and maintainability improvements:

  • Reformatted long inline expressions and object initializations (such as conditional assignments and array/object definitions) to use multi-line, indented blocks for improved readability throughout the file. This includes variable assignments, module parameters, and environment variable definitions. [1] [2] [3] [4] [5] [6] [7] [8] [9]

  • Reformatted all roleDefinitionId assignments in resource role assignments to use multi-line calls to subscriptionResourceId, improving consistency and making the code easier to scan and modify. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Environment variable and configuration improvements:

  • Updated environment variable definitions for container apps and function apps to use multi-line object syntax for clarity, and standardized the Application Insights connection string variable name for backend container apps to match host expectations. [1] [2] [3]

These changes collectively improve the reliability of infrastructure deployments and make the codebase easier to read and maintain.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

…ription

 Restructure the new-topic Event Grid path in main.bicep into a three-step
 vanilla-first pattern. declare the
 system topic as a plain resource with a system-assigned MI, grant it the
 Storage Queue Data Message Sender role at account scope, then configure the
 subscription via the AVM module with dependsOn on both — so the role exists
 before Event Grid's synchronous MI-delivery preflight runs
@Vamshi-Microsoft Vamshi-Microsoft changed the title fix: Added Storage Queue Data Message Sender role assignment to the UAMI in the storageAccount module, enabling Event Grid queue delivery via UAMI. fix: resolve Event Grid MI delivery authorization failure Jun 25, 2026
…structuring role assignment and subscription creation order
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.

1 participant