Diagnostics - Execute Site Analysis
Description for Execute Analysis
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute?api-version=2025-03-01
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute?startTime={startTime}&endTime={endTime}&timeGrain={timeGrain}&api-version=2025-03-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
analysis
|
path | True |
string |
Analysis Resource Name |
|
diagnostic
|
path | True |
string |
Category Name |
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._\(\)]+[^\.]$ |
Name of the resource group to which the resource belongs. |
|
site
|
path | True |
string |
Site Name |
|
subscription
|
path | True |
string |
Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). |
|
api-version
|
query | True |
string |
API Version |
|
end
|
query |
string (date-time) |
End Time |
|
|
start
|
query |
string (date-time) |
Start Time |
|
|
time
|
query |
string pattern: PT[1-9][0-9]+[SMH] |
Time Grain |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
OK |
|
| Other Status Codes |
App Service error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
| Execute site analysis |
| Execute site slot analysis |
Execute site analysis
Sample request
POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/Sample-WestUSResourceGroup/providers/Microsoft.Web/sites/SampleApp/diagnostics/availability/analyses/apprestartanalyses/execute?api-version=2025-03-01
Sample response
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/Sample-WestUSResourceGroup/providers/Microsoft.Web/sites/SampleApp/diagnostics/availability/analyses/apprestartanalyses",
"name": "apprestartanalysis",
"properties": {
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"abnormalTimePeriods": [
{
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"events": [
{
"startTime": "2017-11-06T22:21:50Z",
"endTime": "2017-11-06T22:21:48Z",
"message": "Your application process was restarted as application environment variables changed. This can most likely occur due to update in app settings or swap operation. This event occurred multiple times during the day.",
"source": null,
"priority": 0,
"metaData": [
[
{
"name": "feature",
"value": "auditlogs"
},
{
"name": "displayedName",
"value": "Check Audit Logs"
}
]
],
"type": "ServiceIncident",
"solutions": []
}
],
"solutions": []
}
],
"payload": [
{
"source": "workerprocessrecycle",
"metrics": [
{
"name": "All Application Stop Events",
"unit": null,
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"timeGrain": "00:05:00",
"values": [
{
"timestamp": "2017-11-06T00:00:00Z",
"roleInstance": "RD00155D3C15BE",
"total": 2
},
{
"timestamp": "2017-11-06T00:00:00Z",
"total": 2,
"isAggregated": true
},
{
"timestamp": "2017-11-06T00:10:00Z",
"roleInstance": "RD00155D3C15C1",
"total": 2
},
{
"timestamp": "2017-11-06T00:10:00Z",
"roleInstance": "RD00155D3BE0FB",
"total": 2
},
{
"timestamp": "2017-11-06T00:10:00Z",
"total": 4,
"isAggregated": true
}
]
},
{
"name": "User Events",
"unit": "",
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"timeGrain": "00:05:00",
"values": [
{
"timestamp": "2017-11-06T22:20:00Z",
"total": 3,
"isAggregated": true
},
{
"timestamp": "2017-11-06T22:20:00Z",
"roleInstance": "RD00155D3C09FC",
"total": 1
},
{
"timestamp": "2017-11-06T22:20:00Z",
"roleInstance": "RD00155D3C2ADC",
"total": 1
},
{
"timestamp": "2017-11-06T22:20:00Z",
"roleInstance": "RD00155D3C214E",
"total": 1
}
]
}
],
"data": [],
"detectorMetaData": null
}
],
"nonCorrelatedDetectors": []
}
}
Execute site slot analysis
Sample request
POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/Sample-WestUSResourceGroup/providers/Microsoft.Web/sites/SampleApp/diagnostics/availability/analyses/apprestartanalyses/execute?api-version=2025-03-01
Sample response
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/Sample-WestUSResourceGroup/providers/Microsoft.Web/sites/SampleApp/slots/staging/diagnostics/availability/analyses/apprestartanalyses",
"name": "apprestartanalysis",
"properties": {
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"abnormalTimePeriods": [
{
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"events": [
{
"startTime": "2017-11-06T22:21:50Z",
"endTime": "2017-11-06T22:21:48Z",
"message": "Your application process was restarted as application environment variables changed. This can most likely occur due to update in app settings or swap operation. This event occurred multiple times during the day.",
"source": null,
"priority": 0,
"metaData": [
[
{
"name": "feature",
"value": "auditlogs"
},
{
"name": "displayedName",
"value": "Check Audit Logs"
}
]
],
"type": "ServiceIncident",
"solutions": []
}
],
"solutions": []
}
],
"payload": [
{
"source": "workerprocessrecycle",
"metrics": [
{
"name": "All Application Stop Events",
"unit": null,
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"timeGrain": "00:05:00",
"values": [
{
"timestamp": "2017-11-06T00:00:00Z",
"roleInstance": "RD00155D3C15BE",
"total": 2
},
{
"timestamp": "2017-11-06T00:00:00Z",
"total": 2,
"isAggregated": true
},
{
"timestamp": "2017-11-06T00:10:00Z",
"roleInstance": "RD00155D3C15C1",
"total": 2
},
{
"timestamp": "2017-11-06T00:10:00Z",
"roleInstance": "RD00155D3BE0FB",
"total": 2
},
{
"timestamp": "2017-11-06T00:10:00Z",
"total": 4,
"isAggregated": true
}
]
},
{
"name": "User Events",
"unit": "",
"startTime": "2017-11-05T22:50:00Z",
"endTime": "2017-11-06T22:50:00Z",
"timeGrain": "00:05:00",
"values": [
{
"timestamp": "2017-11-06T22:20:00Z",
"total": 3,
"isAggregated": true
},
{
"timestamp": "2017-11-06T22:20:00Z",
"roleInstance": "RD00155D3C09FC",
"total": 1
},
{
"timestamp": "2017-11-06T22:20:00Z",
"roleInstance": "RD00155D3C2ADC",
"total": 1
},
{
"timestamp": "2017-11-06T22:20:00Z",
"roleInstance": "RD00155D3C214E",
"total": 1
}
]
}
],
"data": [],
"detectorMetaData": null
}
],
"nonCorrelatedDetectors": []
}
}
Definitions
| Name | Description |
|---|---|
|
Abnormal |
Class representing Abnormal Time Period identified in diagnosis |
|
Analysis |
Class Representing Detector Evidence used for analysis |
|
Data |
Class representing data source used by the detectors |
|
Default |
App Service error response. |
| Details | |
|
Detector |
Class representing Abnormal Time Period detected. |
|
Detector |
Class representing detector definition |
|
Diagnostic |
Class representing a diagnostic analysis done on an application |
|
Diagnostic |
Class representing Diagnostic Metric |
|
Diagnostic |
Class representing Diagnostic Metric information |
| Error |
Error model. |
|
Issue |
Represents the type of the Detector |
|
Name |
Name value pair. |
|
Response |
|
| Solution |
Class Representing Solution for problems detected. |
|
Solution |
Type of Solution |
AbnormalTimePeriod
Class representing Abnormal Time Period identified in diagnosis
| Name | Type | Description |
|---|---|---|
| endTime |
string (date-time) |
End time of the downtime |
| events |
List of Possible Cause of downtime |
|
| solutions |
Solution[] |
List of proposed solutions |
| startTime |
string (date-time) |
Start time of the downtime |
AnalysisData
Class Representing Detector Evidence used for analysis
| Name | Type | Description |
|---|---|---|
| data |
Additional Source Data |
|
| detectorDefinition |
Detector Definition |
|
| detectorMetaData |
Detector Meta Data |
|
| metrics |
Source Metrics |
|
| source |
string |
Name of the Detector |
DataSource
Class representing data source used by the detectors
| Name | Type | Description |
|---|---|---|
| dataSourceUri |
Datasource Uri Links |
|
| instructions |
string[] |
Instructions if any for the data source |
DefaultErrorResponse
App Service error response.
| Name | Type | Description |
|---|---|---|
| error |
Error model. |
Details
| Name | Type | Description |
|---|---|---|
| code |
string |
Standardized string to programmatically identify the error. |
| message |
string |
Detailed error description and debugging information. |
| target |
string |
Detailed error description and debugging information. |
DetectorAbnormalTimePeriod
Class representing Abnormal Time Period detected.
| Name | Type | Description |
|---|---|---|
| endTime |
string (date-time) |
End time of the correlated event |
| message |
string |
Message describing the event |
| metaData |
Downtime metadata |
|
| priority |
number (double) |
Represents the rank of the Detector |
| solutions |
Solution[] |
List of proposed solutions |
| source |
string |
Represents the name of the Detector |
| startTime |
string (date-time) |
Start time of the correlated event |
| type |
Represents the type of the Detector |
DetectorDefinition
Class representing detector definition
| Name | Type | Description |
|---|---|---|
| description |
string |
Description of the detector |
| displayName |
string |
Display name of the detector |
| isEnabled |
boolean |
Flag representing whether detector is enabled or not. |
| rank |
number (double) |
Detector Rank |
DiagnosticAnalysis
Class representing a diagnostic analysis done on an application
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource Id. |
| kind |
string |
Kind of resource. |
| name |
string |
Resource Name. |
| properties.abnormalTimePeriods |
List of time periods. |
|
| properties.endTime |
string (date-time) |
End time of the period |
| properties.nonCorrelatedDetectors |
Data by each detector for detectors that did not corelate |
|
| properties.payload |
Data by each detector |
|
| properties.startTime |
string (date-time) |
Start time of the period |
| type |
string |
Resource type. |
DiagnosticMetricSample
Class representing Diagnostic Metric
| Name | Type | Description |
|---|---|---|
| isAggregated |
boolean |
Whether the values are aggregates across all workers or not |
| maximum |
number (double) |
Maximum of the metric sampled during the time period |
| minimum |
number (double) |
Minimum of the metric sampled during the time period |
| roleInstance |
string |
Role Instance. Null if this counter is not per instance This is returned and should be whichever instance name we desire to be returned i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis |
| timestamp |
string (date-time) |
Time at which metric is measured |
| total |
number (double) |
Total value of the metric. If multiple measurements are made this will have sum of all. |
DiagnosticMetricSet
Class representing Diagnostic Metric information
| Name | Type | Description |
|---|---|---|
| endTime |
string (date-time) |
End time of the period |
| name |
string |
Name of the metric |
| startTime |
string (date-time) |
Start time of the period |
| timeGrain |
string |
Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D |
| unit |
string |
Metric's unit |
| values |
Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} |
Error
Error model.
| Name | Type | Description |
|---|---|---|
| code |
string |
Standardized string to programmatically identify the error. |
| details |
Details[] |
Detailed errors. |
| innererror |
string |
More information to debug error. |
| message |
string |
Detailed error description and debugging information. |
| target |
string |
Detailed error description and debugging information. |
IssueType
Represents the type of the Detector
| Value | Description |
|---|---|
| ServiceIncident | |
| AppDeployment | |
| AppCrash | |
| RuntimeIssueDetected | |
| AseDeployment | |
| UserIssue | |
| PlatformIssue | |
| Other |
NameValuePair
Name value pair.
| Name | Type | Description |
|---|---|---|
| name |
string |
Pair name. |
| value |
string |
Pair value. |
ResponseMetaData
| Name | Type | Description |
|---|---|---|
| dataSource |
Source of the Data |
Solution
Class Representing Solution for problems detected.
| Name | Type | Description |
|---|---|---|
| data |
Solution Data. |
|
| description |
string |
Description of the solution |
| displayName |
string |
Display Name of the solution |
| id |
number (double) |
Solution Id. |
| metadata |
Solution Metadata. |
|
| order |
number (double) |
Order of the solution. |
| type |
Type of Solution |
SolutionType
Type of Solution
| Value | Description |
|---|---|
| QuickSolution | |
| DeepInvestigation | |
| BestPractices |