Azure / Azure/azure-quickstart-templates
Webtests deployment not working
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[Template Name goes here](Template link goes here)
dynamic-web-tests
https://github.com/Azure/azure-quickstart-templates/tree/c99d83208f566f75bcd3301e645f5982c4b0a7c3/201-dynamic-web-tests
### Issue Details
When deploying the template (after changing the values) the webtests deployment fails. The error we get is a basic request with no detail `BadRequest`
### Repro steps
1. Fill in the parameters file as needed
2. deploy to azure
you'll notice that the appinsights will succeed and the web test will fail.
template
```{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "String",
"metadata": {
"description": "The name of the app insights instance that you wish to create."
}
},
"tests": {
"type": "Array",
"metadata": {
"description": "The list of web tests to run. See the README for the schema of test descriptor object."
}
},
"emails": {
"type": "Array",
"metadata": {
"description": "A list of strings representing the email addresses to send alerts to."
}
},
"location": {
"defaultValue": "[resourceGroup().location]",
"type": "String",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {},
"resources": [
{
"type": "microsoft.insights/components",
"kind": "web",
"name": "[parameters('appName')]",
"apiVersion": "2015-05-01",
"location": "[parameters('location')]",
"tags": {
"AppInsightsApp": "MyApp"
},
"properties": {
"Application_Type": "web",
"Flow_Type": "Redfield",
"Request_Source": "Unknown",
"Name": "testapp",
"ApplicationId": "[parameters('appName')]"
}
},
{
"type": "microsoft.insights/webtests",
"name": "[parameters('tests')[0].name]",
"apiVersion": "2015-05-01",
"location": "[parameters('location')]",
"tags": {
"[concat('hidden-link:', resourceId('microsoft.insights/components/', parameters('appName')))]": "Resource"
},
"properties": {
"Name": "[parameters('tests')[0].name]",
"Description": "[parameters('tests')[0].description]",
"Enabled": true,
"Frequency": "[parameters('tests')[0].frequency_secs]",
"Timeout": "[parameters('tests')[0].timeout_secs]",
"Kind": "ping",
"Locations": "[parameters('tests')[0].locations]",
"Configuration": {
"WebTest": "[concat(' ')]"
},
"SyntheticMonitorId": "[parameters('tests')[0].name]"
},
"dependsOn": [
"[concat('microsoft.insights/components/', parameters('appName'))]"
]
},
{
"type": "Microsoft.Insights/alertRules",
"name": "[concat(parameters('tests')[0].name, 'alert')]",
"apiVersion": "2015-04-01",
"location": "[parameters('location')]",
"tags": {
"[concat('hidden-link:', resourceId('microsoft.insights/components/', parameters('appName')))]": "Resource",
"[concat('hidden-link:', resourceId('microsoft.insights/webtests/', parameters('tests')[0].name))]": "Resource"
},
"properties": {
"name": "[parameters('tests')[0].name]",
"description": "[parameters('tests')[0].description]",
"isEnabled": true,
"condition": {
"$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.LocationThresholdRuleCondition, Microsoft.WindowsAzure.Management.Mon.Client",
"odata.type": "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition",
"dataSource": {
"$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource, Microsoft.WindowsAzure.Management.Mon.Client",
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
"resourceUri": "[resourceId('microsoft.insights/webtests/', parameters('tests')[0].name)]",
"metricName": "GSMT_AvRaW"
},
"windowSize": "PT15M",
"failedLocationCount": "[parameters('tests')[0].failedLocationCount]"
},
"action": {
"$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleEmailAction, Microsoft.WindowsAzure.Management.Mon.Client",
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
"sendToServiceOwners": true,
"customEmails": "[parameters('emails')]"
}
},
"dependsOn": [
"[concat('microsoft.insights/components/', parameters('appName'))]",
"[concat('microsoft.insights/webtests/', parameters('tests')[0].name)]"
]
}
]
}
```
parameters
```
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"value": "GEN-UNIQUE"
},
"tests": {
"value": [
{
"name": "GEN-UNIQUE-8",
"url": "http://www.microsoft.com",
"expected": 200,
"frequency_secs": 300,
"timeout_secs": 30,
"failedLocationCount": 1,
"description": "a description for test1",
"guid": "GEN-GUID",
"locations": [
{
"Id": "us-il-ch1-azr"
}
]
}
]
},
"emails": {
"value": [
"jeff@websystem3.com"
]
},
"location": {
"value": "eastus"
}
}
}
```
Please let me know what else you need.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the 201-dynamic-web-tests template and its deployment parameters, then reproduce the failure using the supplied values and inspect the Azure webtests resource response beyond the generic BadRequest. Compare the webtests resource properties with the expected schema; done means the App Insights component, web test, and alert deploy successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100