Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 8 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,21 @@ 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)
{
// for subscriptions we cannot use the Id.Name as
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
@@ -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 Down
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
@@ -1,6 +1,6 @@

resource storageAccount_XyWBeAbL6 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct7909f77b383a447'
resource storageAccount_lhz250vzx 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacct0be0d45f98a343c'
location: 'westus'
sku: {
name: 'Premium_LRS'
Expand All @@ -10,11 +10,9 @@ resource storageAccount_XyWBeAbL6 'Microsoft.Storage/storageAccounts@2022-09-01'
}
}

resource blobService_SduEdkgbK 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_XyWBeAbL6
resource blobService_JBIiUqDdA 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_lhz250vzx
name: 'default'
properties: {
cors: {
}
}
}
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_uVkMHo5HI 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: 'photoacctedca28ca81d643d'
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_z01YdOOpK 'Microsoft.Storage/storageAccounts/blobServices@2022-09-01' = {
parent: storageAccount_uVkMHo5HI
name: 'default'
properties: {
cors: {
}
deleteRetentionPolicy: {
enabled: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ targetScope = 'subscription'

@secure()
@description('SQL Server administrator password')
param sqlAdminPassword string
param sqlAdminPassword string = 'password'

@secure()
@description('Application user password')
param appUserPassword string
param appUserPassword string = 'password'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@secure()
@description('SQL Server administrator password')
param sqlAdminPassword string
param sqlAdminPassword string = 'password'

@secure()
@description('Application user password')
param appUserPassword string
param appUserPassword string = 'password'


resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' = {
Expand All @@ -21,17 +21,13 @@ resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' = {
resource webSite_W5EweSXEq 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-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 Expand Up @@ -213,17 +209,13 @@ SCRIPT_END
resource webSite_4pzZqR2OO 'Microsoft.Web/sites@2021-02-01' = {
name: 'backEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'dotnetcore|6.0'
alwaysOn: true
appCommandLine: ''
experiments: {
}
cors: {
allowedOrigins: [
'https://portal.azure.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ targetScope = 'subscription'

@secure()
@description('SQL Server administrator password')
param sqlAdminPassword string
param sqlAdminPassword string = 'password'

@secure()
@description('Application user password')
param appUserPassword string
param appUserPassword string = 'password'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@secure()
@description('SQL Server administrator password')
param sqlAdminPassword string
param sqlAdminPassword string = 'password'

@secure()
@description('Application user password')
param appUserPassword string
param appUserPassword string = 'password'


resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' = {
Expand Down Expand Up @@ -77,17 +77,13 @@ resource keyVaultSecret_7eiFxkj0r 'Microsoft.KeyVault/vaults/secrets@2023-02-01'
resource webSite_W5EweSXEq 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-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 Expand Up @@ -213,17 +209,13 @@ SCRIPT_END
resource webSite_4pzZqR2OO 'Microsoft.Web/sites@2021-02-01' = {
name: 'backEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'dotnetcore|6.0'
alwaysOn: true
appCommandLine: ''
experiments: {
}
cors: {
allowedOrigins: [
'https://portal.azure.com'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ targetScope = 'subscription'

@secure()
@description('SQL Server administrator password')
param sqlAdminPassword string
param sqlAdminPassword string = 'password'

@secure()
@description('Application user password')
param appUserPassword string
param appUserPassword string = 'password'


resource resourceGroup_I6QNkoPsb 'Microsoft.Resources/resourceGroups@2023-07-01' = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@secure()
@description('SQL Server administrator password')
param sqlAdminPassword string
param sqlAdminPassword string = 'password'

@secure()
@description('Application user password')
param appUserPassword string
param appUserPassword string = 'password'


resource appServicePlan_kjMZSF1FP 'Microsoft.Web/serverfarms@2021-02-01' = {
Expand Down Expand Up @@ -80,17 +80,13 @@ resource keyVaultSecret_7eiFxkj0r 'Microsoft.KeyVault/vaults/secrets@2023-02-01'
resource webSite_W5EweSXEq 'Microsoft.Web/sites@2021-02-01' = {
name: 'frontEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-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 Expand Up @@ -216,17 +212,13 @@ SCRIPT_END
resource webSite_4pzZqR2OO 'Microsoft.Web/sites@2021-02-01' = {
name: 'backEnd-TEST'
location: 'westus'
identity: {
}
kind: 'app,linux'
properties: {
serverFarmId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-TEST/providers/Microsoft.Web/serverfarms/appServicePlan-TEST'
siteConfig: {
linuxFxVersion: 'dotnetcore|6.0'
alwaysOn: true
appCommandLine: ''
experiments: {
}
cors: {
allowedOrigins: [
'https://portal.azure.com'
Expand Down
Loading