Skip to content
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

Fix subscriptionIds for no network deployment scenario #1574

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

arjenhuitema
Copy link
Contributor

@arjenhuitema arjenhuitema commented Feb 13, 2024

Overview/Summary

Fixes an issue where the deployment of the UAMI Resource Group fails with the following error:

{"code":"InvalidTemplateDeployment","message":"The template deployment failed with error: 'Authorization failed for template resource 'rg-ama-prod-001' of type 'Microsoft.Resources/resourceGroups'. The client '-----' with object id '-----' does not have permission to perform action 'Microsoft.Resources/subscriptions/rg-ama-prod-001/write' at scope '/subscriptions//resourceGroups/rg-ama-prod-001'.'."}

When networking is not deployed the connectivitySubscriptionId remains empty and it is included as empty in the subscriptionIds variable.

This PR fixes/adds/changes/removes

  1. Adds an if statement checking whether the paramater connectivitySubscriptionId is empty. Based on the outcome, it now either creates an array of managementSubscriptionId and identitySubscriptionId, or the previous 2 and connectivitySubscriptionId.

Breaking Changes

None

Testing Evidence

Deployment

image

Deploying with no networking now skips creating RG and UAMI for the connectivity subscription.

image

Testing URLs

Azure Public

Deploy To Azure

As part of this Pull Request I have

  • Checked for duplicate Pull Requests
  • Associated it with relevant issues, for tracking and closure.
  • Ensured my code/branch is up-to-date with the latest changes in the main branch
  • Performed testing and provided evidence.
  • Ensured contribution guidance is followed.
  • Updated relevant and associated documentation.
  • Updated the "What's New?" wiki page (located: /docs/wiki/whats-new.md)

Copy link
Collaborator

@jtracey93 jtracey93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jtracey93 jtracey93 merged commit eaa0792 into main Feb 14, 2024
4 of 6 checks passed
@jtracey93 jtracey93 deleted the patch-rguami-nonetworking branch February 14, 2024 08:28
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