App Service Authentication Is Not Set
- Query id: 83130a07-235b-4a80-918b-a370e53f0bd9
- Query name: App Service Authentication Is Not Set
- Platform: AzureResourceManager
- Severity: Medium
- Category: Access Control
- CWE: 778
- URL: Github
Description¶
Azure App Service should have App Service Authentication set
Documentation
Code samples¶
Code samples with security vulnerabilities¶
Positive test num. 1 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: false
}
}
Positive test num. 2 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"resources": [
{
"type": "config",
"name": "authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": false
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
}
]
}
Positive test num. 3 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
alwaysOn: true
}
}
Positive test num. 4 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"resources": [
{
"type": "config",
"name": "authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"alwaysOn": true
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
}
]
}
Positive test num. 5 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: false
}
}
Positive test num. 6 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
},
{
"type": "Microsoft.Web/sites/config",
"name": "webApp1/authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": false
}
}
]
}
Positive test num. 7 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
alwaysOn: false
}
}
Positive test num. 8 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
},
{
"type": "Microsoft.Web/sites/config",
"name": "webApp1/authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"alwaysOn": false
}
}
]
}
Positive test num. 9 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: false
}
}
Positive test num. 10 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"resources": [
{
"type": "config",
"name": "authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": false
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 11 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
alwaysOn: true
}
}
Positive test num. 12 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"resources": [
{
"type": "config",
"name": "authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"alwaysOn": true
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 13 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: false
}
}
Positive test num. 14 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
},
{
"type": "Microsoft.Web/sites/config",
"name": "webApp1/authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": false
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Positive test num. 15 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
alwaysOn: false
}
}
Positive test num. 16 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
},
{
"type": "Microsoft.Web/sites/config",
"name": "webApp1/authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"alwaysOn": false
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Code samples without security vulnerabilities¶
Negative test num. 1 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: true
}
}
Negative test num. 2 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"resources": [
{
"type": "config",
"name": "authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": true
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
}
]
}
Negative test num. 3 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: true
}
}
Negative test num. 4 - json file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
},
{
"type": "Microsoft.Web/sites/config",
"name": "webApp1/authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": true
}
}
]
}
Negative test num. 5 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: true
}
}
Negative test num. 6 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"resources": [
{
"type": "config",
"name": "authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": true
}
}
],
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}
Negative test num. 7 - bicep file
resource appServicePlan1 'Microsoft.Web/serverfarms@2018-02-01' = {
name: 'appServicePlan1'
location: resourceGroup().location
sku: {
name: 'F1'
capacity: 1
}
tags: {
displayName: 'appServicePlan1'
}
properties: {
name: 'appServicePlan1'
}
}
resource webApp1 'Microsoft.Web/sites@2020-12-01' = {
name: 'webApp1'
location: resourceGroup().location
tags: {
'hidden-related:${resourceGroup().id}/providers/Microsoft.Web/serverfarms/appServicePlan1': 'Resource'
displayName: 'webApp1'
}
properties: {
name: 'webApp1'
serverFarmId: appServicePlan1.id
}
}
resource webApp1_authsettings 'Microsoft.Web/sites/config@2020-12-01' = {
parent: webApp1
name: 'authsettings'
properties: {
enabled: true
}
}
Negative test num. 8 - json file
{
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"name": "appServicePlan1",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "appServicePlan1"
},
"properties": {
"name": "appServicePlan1"
}
},
{
"name": "webApp1",
"type": "Microsoft.Web/sites",
"apiVersion": "2020-12-01",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/appServicePlan1')]": "Resource",
"displayName": "webApp1"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
],
"properties": {
"name": "webApp1",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'appServicePlan1')]"
}
},
{
"type": "Microsoft.Web/sites/config",
"name": "webApp1/authsettings",
"apiVersion": "2020-12-01",
"dependsOn": [ "[resourceId('Microsoft.Web/sites', 'webApp1')]" ],
"properties": {
"enabled": true
}
}
],
"outputs": {}
},
"parameters": {}
},
"kind": "template",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "myTemplate"
}