Reputation: 738
I have a script that automates Azure subscription creation by opening PRs across two different GitHub repositories.
Repo 1 - subscription.yaml
---
name: "Contoso - NonProd - Sub-Test-51"
subscriptionId: "subscription_guid_placeholder"
default_subscription_access_entra_group: "azure-sub-entra_id_placeholder"
tags:
owner_team: "infra-team"
parent_management_group_id: "/providers/Microsoft.Management/managementGroups/CONTOSO-NONPROD"
Repo 2 - azure-sub-subscription_guid_placeholder.yaml
---
description = Users with access to `Contoso - NonProd - Sub-Test-51` Azure subscription
group = contoso/infra-team-members
subscription.yaml
.subscriptionId
field in subscription.yaml
.subscriptionId
GUID (sub_id.split('-')[-1]
), e.g., azure-sub-4e2c4a261dde.yaml
.sub_name
, sub_id
, and file_path
during deployment.subscriptionId
values in later deployments.subscriptionId
values in subsequent deployments.Tbh this might not even be possible would be good to know if anybody knows the best way to achieve this while keeping everything within a single PR?
Upvotes: 0
Views: 44