Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public static ResourceGroup GetOrAddResourceGroup(this IConstruct construct)
/// <returns>The see <see cref="Subscription"/>.</returns>
public static Subscription GetOrCreateSubscription(this IConstruct construct, Guid? subscriptionId = null)
{
return construct.Subscription ?? (subscriptionId != null ? new Subscription(construct, subscriptionId) : construct.GetSingleResource<Subscription>())!;
return construct.Subscription ??
(subscriptionId != null
? new Subscription(construct, subscriptionId)
: construct.GetSingleResource<Subscription>() ?? new Subscription(construct));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ public Subscription(IConstruct scope, Guid? guid = default)
}

/// <inheritdoc/>
protected override string GetAzureName(IConstruct scope, string resourceName)
protected override string GetAzureName(IConstruct scope, string? resourceName)
{
return resourceName is not null ? resourceName : Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID") ?? throw new InvalidOperationException("No environment variable named 'AZURE_SUBSCRIPTION_ID' found");
return resourceName is not null
? resourceName
: Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID") ?? "subscription()";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
targetScope = 'subscription'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_RKFHPNHNS 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg-TEST'
location: 'westus'
tags: {
Expand All @@ -11,7 +11,7 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'

module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = {
name: 'rg_TEST_module'
scope: resourceGroup_I6QNkoPsb
scope: resourceGroup_RKFHPNHNS
}

output appConfigurationStore_sgecYnln3_endpoint string = rg_TEST_module.outputs.appConfigurationStore_sgecYnln3_endpoint
output appConfigurationStore_kRqdpAmmZ_endpoint string = rg_TEST_module.outputs.appConfigurationStore_kRqdpAmmZ_endpoint
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

resource appConfigurationStore_sgecYnln3 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
resource appConfigurationStore_kRqdpAmmZ 'Microsoft.AppConfiguration/configurationStores@2023-03-01' = {
name: 'store-TEST'
location: 'westus'
sku: {
Expand All @@ -9,4 +9,4 @@ resource appConfigurationStore_sgecYnln3 'Microsoft.AppConfiguration/configurati
}
}

output appConfigurationStore_sgecYnln3_endpoint string = appConfigurationStore_sgecYnln3.properties.endpoint
output appConfigurationStore_kRqdpAmmZ_endpoint string = appConfigurationStore_kRqdpAmmZ.properties.endpoint
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ targetScope = 'subscription'
param enableSoftDelete string = 'True'


resource resourceGroup_AVG5HpqPz 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_g8nI7jPJ2 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg1-TEST'
location: 'westus'
tags: {
'azd-env-name': 'TEST'
}
}

resource resourceGroup_hu2r8JaSi 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_azggXhH7X 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg2-TEST'
location: 'westus'
tags: {
'azd-env-name': 'TEST'
}
}

resource resourceGroup_Q4i0lpa1h 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_9Y3rUN36f 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg3-TEST'
location: 'westus'
tags: {
Expand All @@ -30,7 +30,7 @@ resource resourceGroup_Q4i0lpa1h 'Microsoft.Resources/resourceGroups@2023-07-01'

module rg1_TEST_module './resources/rg1_TEST_module/rg1_TEST_module.bicep' = {
name: 'rg1_TEST_module'
scope: resourceGroup_AVG5HpqPz
scope: resourceGroup_g8nI7jPJ2
params: {
enableSoftDelete: enableSoftDelete
SERVICE_API_IDENTITY_PRINCIPAL_ID: rg3_TEST_module.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
Expand All @@ -39,15 +39,15 @@ module rg1_TEST_module './resources/rg1_TEST_module/rg1_TEST_module.bicep' = {

module rg2_TEST_module './resources/rg2_TEST_module/rg2_TEST_module.bicep' = {
name: 'rg2_TEST_module'
scope: resourceGroup_hu2r8JaSi
scope: resourceGroup_azggXhH7X
params: {
STORAGE_PRINCIPAL_ID: rg1_TEST_module.outputs.STORAGE_PRINCIPAL_ID
}
}

module rg3_TEST_module './resources/rg3_TEST_module/rg3_TEST_module.bicep' = {
name: 'rg3_TEST_module'
scope: resourceGroup_Q4i0lpa1h
scope: resourceGroup_9Y3rUN36f
}

output STORAGE_PRINCIPAL_ID string = rg1_TEST_module.outputs.STORAGE_PRINCIPAL_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param enableSoftDelete string = 'True'
param SERVICE_API_IDENTITY_PRINCIPAL_ID string


resource appServicePlan_viooTTlOI 'Microsoft.Web/serverfarms@2021-02-01' = {
resource appServicePlan_7ufAVFULu 'Microsoft.Web/serverfarms@2021-02-01' = {
name: 'appServicePlan-TEST'
location: 'westus'
sku: {
Expand All @@ -17,12 +17,12 @@ resource appServicePlan_viooTTlOI 'Microsoft.Web/serverfarms@2021-02-01' = {
}
}

resource webSite_dOTaZfna6 'Microsoft.Web/sites@2021-02-01' = {
resource webSite_7VDxFxfHl 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
serverFarmId: '/subscriptions/subscription()/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'node|18-lts'
alwaysOn: true
Expand All @@ -40,12 +40,12 @@ resource webSite_dOTaZfna6 'Microsoft.Web/sites@2021-02-01' = {
}
}

resource applicationSettingsResource_MAMFSSuFs 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_dOTaZfna6
resource applicationSettingsResource_MbDOVsFgO 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_7VDxFxfHl
name: 'appsettings'
}

resource keyVault_BRsYQF4qT 'Microsoft.KeyVault/vaults@2023-02-01' = {
resource keyVault_j1ww9730M 'Microsoft.KeyVault/vaults@2023-02-01' = {
name: 'kv-TEST'
location: 'westus'
properties: {
Expand All @@ -59,8 +59,8 @@ resource keyVault_BRsYQF4qT 'Microsoft.KeyVault/vaults@2023-02-01' = {
}
}

resource keyVaultAddAccessPolicy_lQ2z7dHpX 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = {
parent: keyVault_BRsYQF4qT
resource keyVaultAddAccessPolicy_Jv1vsDkxL 'Microsoft.KeyVault/vaults/accessPolicies@2023-02-01' = {
parent: keyVault_j1ww9730M
name: 'add'
properties: {
accessPolicies: [
Expand All @@ -78,6 +78,6 @@ resource keyVaultAddAccessPolicy_lQ2z7dHpX 'Microsoft.KeyVault/vaults/accessPoli
}
}

output STORAGE_PRINCIPAL_ID string = webSite_dOTaZfna6.identity.principalId
output LOCATION string = webSite_dOTaZfna6.location
output vaultUri string = keyVault_BRsYQF4qT.properties.vaultUri
output STORAGE_PRINCIPAL_ID string = webSite_7VDxFxfHl.identity.principalId
output LOCATION string = webSite_7VDxFxfHl.location
output vaultUri string = keyVault_j1ww9730M.properties.vaultUri
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
param STORAGE_PRINCIPAL_ID string


resource webSite_80I4ejz5T 'Microsoft.Web/sites@2021-02-01' = {
resource webSite_otUunDMEJ 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
principalId: STORAGE_PRINCIPAL_ID
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
serverFarmId: '/subscriptions/subscription()/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'node|18-lts'
alwaysOn: true
Expand All @@ -28,7 +28,7 @@ resource webSite_80I4ejz5T 'Microsoft.Web/sites@2021-02-01' = {
}
}

resource applicationSettingsResource_eTrLWYWog 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_80I4ejz5T
resource applicationSettingsResource_ou87c8ivP 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_otUunDMEJ
name: 'appsettings'
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

resource webSite_Y34mQ7HgU 'Microsoft.Web/sites@2021-02-01' = {
resource webSite_ERn8dnbTV 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
serverFarmId: '/subscriptions/subscription()/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'node|18-lts'
alwaysOn: true
Expand All @@ -22,13 +22,13 @@ resource webSite_Y34mQ7HgU 'Microsoft.Web/sites@2021-02-01' = {
}
}

resource applicationSettingsResource_1XX3wQExf 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_Y34mQ7HgU
resource applicationSettingsResource_wmfJEHJsI 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_ERn8dnbTV
name: 'appsettings'
}

resource webSiteConfigLogs_vhJa9LaNc 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_Y34mQ7HgU
resource webSiteConfigLogs_OF3i4zuus 'Microsoft.Web/sites/config@2021-02-01' = {
parent: webSite_ERn8dnbTV
name: 'logs'
properties: {
applicationLogs: {
Expand All @@ -52,4 +52,4 @@ resource webSiteConfigLogs_vhJa9LaNc 'Microsoft.Web/sites/config@2021-02-01' = {
}
}

output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_Y34mQ7HgU.identity.principalId
output SERVICE_API_IDENTITY_PRINCIPAL_ID string = webSite_ERn8dnbTV.identity.principalId
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
targetScope = 'subscription'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_RKFHPNHNS 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg-TEST'
location: 'westus'
tags: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
targetScope = 'subscription'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_RKFHPNHNS 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg-TEST'
location: 'westus'
tags: {
Expand All @@ -11,5 +11,5 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'

module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = {
name: 'rg_TEST_module'
scope: resourceGroup_I6QNkoPsb
scope: resourceGroup_RKFHPNHNS
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

resource storageAccount_9Dvxxgn8O 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct58eee912f50347d'
resource storageAccount_XILrw4Skb 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct758c880e1f9a497'
location: 'westus'
sku: {
name: 'Premium_LRS'
Expand All @@ -10,8 +10,8 @@ resource storageAccount_9Dvxxgn8O 'Microsoft.Storage/storageAccounts@2022-09-01'
}
}

resource blobService_zJM6Ics0G 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_9Dvxxgn8O
resource blobService_MbIr6CaiQ 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_XILrw4Skb
name: 'default'
properties: {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
targetScope = 'subscription'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_RKFHPNHNS 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg-TEST'
location: 'westus'
tags: {
Expand All @@ -11,5 +11,5 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'

module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = {
name: 'rg_TEST_module'
scope: resourceGroup_I6QNkoPsb
scope: resourceGroup_RKFHPNHNS
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

resource storageAccount_96H1GOZhY 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct3d08551686934f0'
resource storageAccount_hdYM4y68e 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoaccte57722fb9872441'
location: 'westus'
sku: {
name: 'Premium_LRS'
Expand All @@ -10,8 +10,8 @@ resource storageAccount_96H1GOZhY 'Microsoft.Storage/storageAccounts@2022-09-01'
}
}

resource blobService_lUTdsAAld 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_96H1GOZhY
resource blobService_Od7SLNmXY 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_hdYM4y68e
name: 'default'
properties: {
deleteRetentionPolicy: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param sqlAdminPassword string
param appUserPassword string


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
resource resourceGroup_RKFHPNHNS 'Microsoft.Resources/resourceGroups@2023-07-01' = {
name: 'rg-TEST'
location: 'westus'
tags: {
Expand All @@ -20,7 +20,7 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'

module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = {
name: 'rg_TEST_module'
scope: resourceGroup_I6QNkoPsb
scope: resourceGroup_RKFHPNHNS
params: {
sqlAdminPassword: sqlAdminPassword
appUserPassword: appUserPassword
Expand Down
Loading