Skip to content

Commit 15a2a59

Browse files
author
Garo Yeriazarian
committed
Change target scope to resource group
1 parent 6e59e7f commit 15a2a59

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

infra/main.bicep

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
targetScope = 'subscription'
1+
targetScope = 'resourceGroup'
22

33
@minLength(1)
44
@maxLength(64)
@@ -19,7 +19,7 @@ param applicationInsightsName string = ''
1919
param appServicePlanName string = ''
2020
param keyVaultName string = ''
2121
param logAnalyticsName string = ''
22-
param resourceGroupName string = ''
22+
//param resourceGroupName string = ''
2323
param sqlServerName string = ''
2424
param webServiceName string = ''
2525
param apimServiceName string = ''
@@ -47,16 +47,16 @@ var resourceToken = toLower(uniqueString(subscription().id, environmentName, loc
4747
var tags = { 'azd-env-name': environmentName }
4848

4949
// Organize resources in a resource group
50-
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
51-
name: !empty(resourceGroupName) ? resourceGroupName : '${abbrs.resourcesResourceGroups}${environmentName}'
52-
location: location
53-
tags: tags
54-
}
50+
// resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
51+
// name: !empty(resourceGroupName) ? resourceGroupName : '${abbrs.resourcesResourceGroups}${environmentName}'
52+
// location: location
53+
// tags: tags
54+
// }
5555

5656
// The application frontend
5757
module web './app/web-appservice-avm.bicep' = {
5858
name: 'web'
59-
scope: rg
59+
//scope: rg
6060
params: {
6161
name: !empty(webServiceName) ? webServiceName : '${abbrs.webSitesAppService}web-${resourceToken}'
6262
location: location
@@ -70,7 +70,7 @@ module web './app/web-appservice-avm.bicep' = {
7070
// The application backend
7171
module api './app/api-appservice-avm.bicep' = {
7272
name: 'api'
73-
scope: rg
73+
//scope: rg
7474
params: {
7575
name: !empty(apiServiceName) ? apiServiceName : '${abbrs.webSitesAppService}api-${resourceToken}'
7676
location: location
@@ -94,7 +94,7 @@ module api './app/api-appservice-avm.bicep' = {
9494
// Give the API access to KeyVault
9595
module accessKeyVault 'br/public:avm/res/key-vault/vault:0.3.5' = {
9696
name: 'accesskeyvault'
97-
scope: rg
97+
//scope: rg
9898
params: {
9999
name: keyVault.outputs.name
100100
enableRbacAuthorization: false
@@ -138,7 +138,7 @@ module accessKeyVault 'br/public:avm/res/key-vault/vault:0.3.5' = {
138138
// The application database
139139
module sqlService './app/db-avm.bicep' = {
140140
name: 'sqldeploymentscript'
141-
scope: rg
141+
//scope: rg
142142
params: {
143143
location: location
144144
appUserPassword: appUserPassword
@@ -151,7 +151,7 @@ module sqlService './app/db-avm.bicep' = {
151151
// Create an App Service Plan to group applications under the same payment plan and SKU
152152
module appServicePlan 'br/public:avm/res/web/serverfarm:0.1.0' = {
153153
name: 'appserviceplan'
154-
scope: rg
154+
//scope: rg
155155
params: {
156156
name: !empty(appServicePlanName) ? appServicePlanName : '${abbrs.webServerFarms}${resourceToken}'
157157
sku: {
@@ -168,7 +168,7 @@ module appServicePlan 'br/public:avm/res/web/serverfarm:0.1.0' = {
168168
// Create a keyvault to store secrets
169169
module keyVault 'br/public:avm/res/key-vault/vault:0.3.5' = {
170170
name: 'keyvault'
171-
scope: rg
171+
//scope: rg
172172
params: {
173173
name: !empty(keyVaultName) ? keyVaultName : '${abbrs.keyVaultVaults}${resourceToken}'
174174
location: location
@@ -184,7 +184,7 @@ module keyVault 'br/public:avm/res/key-vault/vault:0.3.5' = {
184184
// Monitor application with Azure Monitor
185185
module monitoring 'br/public:avm/ptn/azd/monitoring:0.1.0' = {
186186
name: 'monitoring'
187-
scope: rg
187+
//scope: rg
188188
params: {
189189
applicationInsightsName: !empty(applicationInsightsName) ? applicationInsightsName : '${abbrs.insightsComponents}${resourceToken}'
190190
logAnalyticsName: !empty(logAnalyticsName) ? logAnalyticsName : '${abbrs.operationalInsightsWorkspaces}${resourceToken}'
@@ -197,7 +197,7 @@ module monitoring 'br/public:avm/ptn/azd/monitoring:0.1.0' = {
197197
// Creates Azure API Management (APIM) service to mediate the requests between the frontend and the backend API
198198
module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) {
199199
name: 'apim-deployment'
200-
scope: rg
200+
//scope: rg
201201
params: {
202202
name: !empty(apimServiceName) ? apimServiceName : '${abbrs.apiManagementService}${resourceToken}'
203203
publisherEmail: '[email protected]'
@@ -226,7 +226,7 @@ module apim 'br/public:avm/res/api-management/service:0.2.0' = if (useAPIM) {
226226
//Configures the API settings for an api app within the Azure API Management (APIM) service.
227227
module apimApi 'br/public:avm/ptn/azd/apim-api:0.1.0' = if (useAPIM) {
228228
name: 'apim-api-deployment'
229-
scope: rg
229+
//scope: rg
230230
params: {
231231
apiBackendUrl: api.outputs.SERVICE_API_URI
232232
apiDescription: 'This is a simple Todo API'

0 commit comments

Comments
 (0)