Fix subscriptionIds for no network deployment scenario #1574
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.
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 thesubscriptionIds
variable.This PR fixes/adds/changes/removes
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
Deploying with no networking now skips creating RG and UAMI for the connectivity subscription.
Testing URLs
Azure Public
As part of this Pull Request I have
main
branch/docs/wiki/whats-new.md
)