Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion sdk/provisioning/Azure.Provisioning/src/Construct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private BinaryData SerializeModule(ModelReaderWriterOptions options)

foreach (var resource in GetResources(false))
{
if (resource is Tenant || resource is Subscription)
if (resource is Tenant)
{
continue;
}
Expand Down
8 changes: 7 additions & 1 deletion sdk/provisioning/Azure.Provisioning/src/ModuleConstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ internal class ModuleConstruct : Construct
public ModuleConstruct(ModuleResource resource)
: base(
resource.Scope,
resource.Resource is Subscription ? resource.Resource.Name : resource.Resource.Id.Name.Replace('-', '_'),
GetScopeName(resource.Resource),
ResourceToConstructScope(resource.Resource),
tenant: GetTenant(resource.Resource),
subscription: GetSubscription(resource.Resource),
resourceGroup: resource.Resource as ResourceGroup)
{
}

private static string GetScopeName(Resource resource)
{
var prefix = resource is Subscription ? resource.Name : resource.Id.Name.Replace('-', '_');
return $"{prefix}_module";
}

public bool IsRoot { get; set; }

private static Tenant? GetTenant(Resource resource)
Expand Down
2 changes: 1 addition & 1 deletion sdk/provisioning/Azure.Provisioning/src/Resource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private BinaryData SerializeModule(ModelReaderWriterOptions options)

stream.WriteLine($"resource {Name} '{ResourceType}@{Version}' = {{");

if (this.IsChildResource() && this is not DeploymentScript)
if (this.IsChildResource() && this is not DeploymentScript && this is not Subscription)
{
stream.WriteLine($" parent: {Parent!.Name}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'
}
}

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

output appConfigurationStore_sgecYnln3_endpoint string = rg_TEST.outputs.appConfigurationStore_sgecYnln3_endpoint
output appConfigurationStore_sgecYnln3_endpoint string = rg_TEST_module.outputs.appConfigurationStore_sgecYnln3_endpoint
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
targetScope = 'tenant'


module subscription_O0vZNnri3 './resources/subscription_O0vZNnri3/subscription_O0vZNnri3.bicep' = {
name: 'subscription_O0vZNnri3'
resource subscription_O0vZNnri3 'Microsoft.Resources/subscriptions@2022-12-01' = {
id: '/subscriptions/8286d046-9740-a3e4-95cf-ff46699c73c4'
subscriptionId: '8286d046-9740-a3e4-95cf-ff46699c73c4'
tenantId: '00000000-0000-0000-0000-000000000000'
}

resource subscription_i7MQMw1U7 'Microsoft.Resources/subscriptions@2022-12-01' = {
id: '/subscriptions/3410cda1-5b13-a34e-6f84-a54adf7a0ea0'
subscriptionId: '3410cda1-5b13-a34e-6f84-a54adf7a0ea0'
tenantId: '00000000-0000-0000-0000-000000000000'
}

module subscription_O0vZNnri3_module './resources/subscription_O0vZNnri3_module/subscription_O0vZNnri3_module.bicep' = {
name: 'subscription_O0vZNnri3_module'
scope: subscription('subscription_O0vZNnri3')
}

module subscription_i7MQMw1U7 './resources/subscription_i7MQMw1U7/subscription_i7MQMw1U7.bicep' = {
name: 'subscription_i7MQMw1U7'
module subscription_i7MQMw1U7_module './resources/subscription_i7MQMw1U7_module/subscription_i7MQMw1U7_module.bicep' = {
name: 'subscription_i7MQMw1U7_module'
scope: subscription('subscription_i7MQMw1U7')
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
targetScope = 'subscription'

@description('Enable soft delete')
param enableSoftDelete string
param enableSoftDelete string = 'True'


resource resourceGroup_AVG5HpqPz 'Microsoft.Resources/resourceGroups@2023-07-01' = {
Expand All @@ -28,29 +28,29 @@ resource resourceGroup_Q4i0lpa1h 'Microsoft.Resources/resourceGroups@2023-07-01'
}
}

module rg1_TEST './resources/rg1_TEST/rg1_TEST.bicep' = {
name: 'rg1_TEST'
module rg1_TEST_module './resources/rg1_TEST_module/rg1_TEST_module.bicep' = {
name: 'rg1_TEST_module'
scope: resourceGroup_AVG5HpqPz
params: {
enableSoftDelete: enableSoftDelete
SERVICE_API_IDENTITY_PRINCIPAL_ID: rg3_TEST.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
SERVICE_API_IDENTITY_PRINCIPAL_ID: rg3_TEST_module.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
}
}

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

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

output STORAGE_PRINCIPAL_ID string = rg1_TEST.outputs.STORAGE_PRINCIPAL_ID
output LOCATION string = rg1_TEST.outputs.LOCATION
output vaultUri string = rg1_TEST.outputs.vaultUri
output SERVICE_API_IDENTITY_PRINCIPAL_ID string = rg3_TEST.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
output STORAGE_PRINCIPAL_ID string = rg1_TEST_module.outputs.STORAGE_PRINCIPAL_ID
output LOCATION string = rg1_TEST_module.outputs.LOCATION
output vaultUri string = rg1_TEST_module.outputs.vaultUri
output SERVICE_API_IDENTITY_PRINCIPAL_ID string = rg3_TEST_module.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@description('Enable soft delete')
param enableSoftDelete string
param enableSoftDelete string = 'True'

@secure()
@description('')
Expand All @@ -20,17 +20,13 @@ resource appServicePlan_viooTTlOI 'Microsoft.Web/serverfarms@2021-02-01' = {
resource webSite_dOTaZfna6 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'node|18-lts'
alwaysOn: true
appCommandLine: './entrypoint.sh -o ./env-config.js && pm2 serve /home/site/wwwroot --no-daemon --spa'
experiments: {
}
cors: {
allowedOrigins: [
'https://portal.azure.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resource webSite_80I4ejz5T 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
principalId: STORAGE_PRINCIPAL_ID
}
kind: 'app,linux'
properties: {
Expand All @@ -14,8 +15,6 @@ resource webSite_80I4ejz5T 'Microsoft.Web/sites@2021-02-01' = {
linuxFxVersion: 'node|18-lts'
alwaysOn: true
appCommandLine: './entrypoint.sh -o ./env-config.js && pm2 serve /home/site/wwwroot --no-daemon --spa'
experiments: {
}
cors: {
allowedOrigins: [
'https://portal.azure.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
resource webSite_Y34mQ7HgU 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'node|18-lts'
alwaysOn: true
appCommandLine: './entrypoint.sh -o ./env-config.js && pm2 serve /home/site/wwwroot --no-daemon --spa'
experiments: {
}
cors: {
allowedOrigins: [
'https://portal.azure.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'
}
}

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

resource storageAccount_nyqKj4fVa 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct783bf4edd65646e'
location: 'westus'
sku: {
name: 'Premium_LRS'
}
kind: 'StorageV2'
properties: {
}
}

resource blobService_CjbeMfMgo 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_nyqKj4fVa
name: 'default'
properties: {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'
}
}

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

resource storageAccount_F00UduuIF 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct05f2f60511ac497'
resource storageAccount_PdjzkDDBx 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct1434f94e82d1418'
location: 'westus'
sku: {
name: 'Premium_LRS'
Expand All @@ -10,12 +10,10 @@ resource storageAccount_F00UduuIF 'Microsoft.Storage/storageAccounts@2022-09-01'
}
}

resource blobService_L1IVWfLBd 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_F00UduuIF
resource blobService_uNPuvG8H2 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_PdjzkDDBx
name: 'default'
properties: {
cors: {
}
deleteRetentionPolicy: {
enabled: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01'
}
}

module rg_TEST './resources/rg_TEST/rg_TEST.bicep' = {
name: 'rg_TEST'
module rg_TEST_module './resources/rg_TEST_module/rg_TEST_module.bicep' = {
name: 'rg_TEST_module'
scope: resourceGroup_I6QNkoPsb
params: {
sqlAdminPassword: sqlAdminPassword
appUserPassword: appUserPassword
}
}

output SERVICE_API_IDENTITY_PRINCIPAL_ID string = rg_TEST.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
output vaultUri string = rg_TEST.outputs.vaultUri
output SERVICE_API_IDENTITY_PRINCIPAL_ID string = rg_TEST_module.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
output vaultUri string = rg_TEST_module.outputs.vaultUri
Loading