Share via


Diagnostics - Execute Site Detector

Description for Execute Detector

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute?api-version=2025-03-01
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute?startTime={startTime}&endTime={endTime}&timeGrain={timeGrain}&api-version=2025-03-01

URI Parameters

Name In Required Type Description
detectorName
path True

string

Detector Resource Name

diagnosticCategory
path True

string

Category Name

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[-\w\._\(\)]+[^\.]$

Name of the resource group to which the resource belongs.

siteName
path True

string

Site Name

subscriptionId
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

endTime
query

string (date-time)

End Time

startTime
query

string (date-time)

Start Time

timeGrain
query

string

pattern: PT[1-9][0-9]+[SMH]

Time Grain

Responses

Name Type Description
200 OK

DiagnosticDetectorResponse

OK

Other Status Codes

DefaultErrorResponse

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 detector
Execute site slot detector

Execute site detector

Sample request

POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/Sample-WestUSResourceGroup/providers/Microsoft.Web/sites/SampleApp/diagnostics/availability/detectors/sitecrashes/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/detectors/sitecrashes",
  "name": "sitecrashes",
  "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",
        "solutions": []
      }
    ]
  }
}

Execute site slot detector

Sample request

POST https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/Sample-WestUSResourceGroup/providers/Microsoft.Web/sites/SampleApp/diagnostics/availability/detectors/sitecrashes/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/detectors/sitecrashes",
  "name": "sitecrashes",
  "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",
        "solutions": []
      }
    ]
  }
}

Definitions

Name Description
DataSource

Class representing data source used by the detectors

DefaultErrorResponse

App Service error response.

Details
DetectorAbnormalTimePeriod

Class representing Abnormal Time Period detected.

DetectorDefinition

Class representing detector definition

DiagnosticDetectorResponse

Class representing Response from Diagnostic Detectors

DiagnosticMetricSample

Class representing Diagnostic Metric

DiagnosticMetricSet

Class representing Diagnostic Metric information

Error

Error model.

IssueType

Represents the type of the Detector

NameValuePair

Name value pair.

ResponseMetaData
Solution

Class Representing Solution for problems detected.

SolutionType

Type of Solution

DataSource

Class representing data source used by the detectors

Name Type Description
dataSourceUri

NameValuePair[]

Datasource Uri Links

instructions

string[]

Instructions if any for the data source

DefaultErrorResponse

App Service error response.

Name Type Description
error

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

NameValuePair[]

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

IssueType

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

DiagnosticDetectorResponse

Class representing Response from Diagnostic Detectors

Name Type Description
id

string

Resource Id.

kind

string

Kind of resource.

name

string

Resource Name.

properties.abnormalTimePeriods

DetectorAbnormalTimePeriod[]

List of Correlated events found by the detector

properties.data

NameValuePair[]

Additional Data that detector wants to send.

properties.detectorDefinition

DetectorDefinition

Detector's definition

properties.endTime

string (date-time)

End time of the period

properties.issueDetected

boolean

Flag representing Issue was detected.

properties.metrics

DiagnosticMetricSet[]

Metrics provided by the detector

properties.responseMetaData

ResponseMetaData

Meta Data

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

DiagnosticMetricSample[]

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

DataSource

Source of the Data

Solution

Class Representing Solution for problems detected.

Name Type Description
data

NameValuePair[]

Solution Data.

description

string

Description of the solution

displayName

string

Display Name of the solution

id

number (double)

Solution Id.

metadata

NameValuePair[]

Solution Metadata.

order

number (double)

Order of the solution.

type

SolutionType

Type of Solution

SolutionType

Type of Solution

Value Description
QuickSolution
DeepInvestigation
BestPractices