Azure / Azure/azure-quickstart-templates
specified subnet is not delegated to Microsoft.Web/serverfarms
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
--------------------MESSAGE FROM ADMIN, DELETE BEFORE SUBMITTING----------------------
Sorry to hear you had a bad experience with one of the templates :worried: But, in case you're just asking a question, we're happy to help. You can also check if the question might already have been asked here https://github.com/Azure/azure-quickstart-templates/issues?utf8=%E2%9C%93&q=is%3Aissue
We've created an outline of recommended sections to fill out that will help make this Pull Request awesome!
--------------------MESSAGE FROM ADMIN, DELETE BEFORE SUBMITTING----------------------
[Template Name goes here](Template link goes here)
### Issue Details
When deploying the template I get the error
{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"message":"Subnet xxxOVIacVNet in VNET subnet01 is missing a delegation to Microsoft.Web/serverFarms. Please add the delegation and try again."}]}
Here is how I'm using the template. I believe the error is coming from resources > subnet section where the delegation is defined.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string",
"defaultValue": "[uniqueString(resourceGroup().id)]",
"metadata": {
"description": "The name of the app to create."
}
},
"appServicePlanName": {
"type": "string",
"defaultValue": "[uniqueString(subscription().subscriptionId)]",
"metadata": {
"description": "The name of the app service plan to create."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location in which all resources should be deployed."
}
}
},
"variables": {
"vnetName": "vnet",
"vnetAddressPrefix": "10.0.0.0/16",
"subnetName": "myappservice",
"subnetAddressPrefix": "10.0.0.0/24",
"appServicePlanSku": "S1"
},
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-05-01",
"name": "[variables('vnetName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('vnetAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetAddressPrefix')]",
"delegations": [
{
"name": "delegation",
"properties": {
"serviceName": "Microsoft.Web/serverFarms"
}
}
]
}
}
]
}
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2019-08-01",
"name": "[parameters('appServicePlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[variables('appServicePlanSku')]"
},
"kind": "app"
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2019-08-01",
"name": "[parameters('appName')]",
"location": "[parameters('location')]",
"kind": "app",
"dependsOn": [
"[resourceId('Microsoft.Web/serverFarms', parameters('appServicePlanName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', variables('vnetName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverFarms', parameters('appServicePlanName'))]"
},
"resources": [
{
"name": "virtualNetwork",
"type": "config",
"apiVersion": "2019-08-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('appName'))]"
],
"properties": {
"subnetResourceId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('vnetName'), variables('subnetName'))]",
"swiftSupported": true
}
}
]
}
]
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the deployment from the pasted template, then inspect the Microsoft.Network/virtualNetworks subnet delegation and the Microsoft.Web/sites virtualNetwork config. Compare the deployment operation error with the declared Microsoft.Web/serverFarms delegation; done means the template deploys successfully without the missing-delegation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100