Microsoft.ApiManagement service/apis/diagnostics

Template format

To create a Microsoft.ApiManagement/service/apis/diagnostics resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.ApiManagement/service/apis/diagnostics",
  "apiVersion": "2020-06-01-preview",
  "properties": {
    "alwaysLog": "allErrors",
    "loggerId": "string",
    "sampling": {
      "samplingType": "fixed",
      "percentage": "number"
    },
    "frontend": {
      "request": {
        "headers": [
          "string"
        ],
        "body": {
          "bytes": "integer"
        },
        "dataMasking": {
          "queryParams": [
            {
              "value": "string",
              "mode": "string"
            }
          ],
          "headers": [
            {
              "value": "string",
              "mode": "string"
            }
          ]
        }
      },
      "response": {
        "headers": [
          "string"
        ],
        "body": {
          "bytes": "integer"
        },
        "dataMasking": {
          "queryParams": [
            {
              "value": "string",
              "mode": "string"
            }
          ],
          "headers": [
            {
              "value": "string",
              "mode": "string"
            }
          ]
        }
      }
    },
    "backend": {
      "request": {
        "headers": [
          "string"
        ],
        "body": {
          "bytes": "integer"
        },
        "dataMasking": {
          "queryParams": [
            {
              "value": "string",
              "mode": "string"
            }
          ],
          "headers": [
            {
              "value": "string",
              "mode": "string"
            }
          ]
        }
      },
      "response": {
        "headers": [
          "string"
        ],
        "body": {
          "bytes": "integer"
        },
        "dataMasking": {
          "queryParams": [
            {
              "value": "string",
              "mode": "string"
            }
          ],
          "headers": [
            {
              "value": "string",
              "mode": "string"
            }
          ]
        }
      }
    },
    "logClientIp": "boolean",
    "httpCorrelationProtocol": "string",
    "verbosity": "string",
    "operationNameFormat": "string"
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.ApiManagement/service/apis/diagnostics object

Name Type Required Value
name string Yes Diagnostic identifier. Must be unique in the current API Management service instance.
type enum Yes diagnostics
-or-
Microsoft.ApiManagement/service/apis/diagnostics

See Set name and type for child resources.
apiVersion enum Yes 2020-06-01-preview
properties object Yes Diagnostic entity contract properties. - DiagnosticContractProperties object

DiagnosticContractProperties object

Name Type Required Value
alwaysLog enum No Specifies for what type of messages sampling settings should not apply. - allErrors
loggerId string Yes Resource Id of a target logger.
sampling object No Sampling settings for Diagnostic. - SamplingSettings object
frontend object No Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. - PipelineDiagnosticSettings object
backend object No Diagnostic settings for incoming/outgoing HTTP messages to the Backend - PipelineDiagnosticSettings object
logClientIp boolean No Log the ClientIP. Default is false.
httpCorrelationProtocol enum No Sets correlation protocol to use for Application Insights diagnostics. - None, Legacy, W3C
verbosity enum No The verbosity level applied to traces emitted by trace policies. - verbose, information, error
operationNameFormat enum No The format of the Operation Name for Application Insights telemetries. Default is Name. - Name or Url

SamplingSettings object

Name Type Required Value
samplingType enum No Sampling type. - fixed
percentage number No Rate of sampling for fixed-rate sampling.

PipelineDiagnosticSettings object

Name Type Required Value
request object No Diagnostic settings for request. - HttpMessageDiagnostic object
response object No Diagnostic settings for response. - HttpMessageDiagnostic object

HttpMessageDiagnostic object

Name Type Required Value
headers array No Array of HTTP Headers to log. - string
body object No Body logging settings. - BodyDiagnosticSettings object
dataMasking object No Data masking settings. - DataMasking object

BodyDiagnosticSettings object

Name Type Required Value
bytes integer No Number of request body bytes to log.

DataMasking object

Name Type Required Value
queryParams array No Masking settings for Url query parameters - DataMaskingEntity object
headers array No Masking settings for headers - DataMaskingEntity object

DataMaskingEntity object

Name Type Required Value
value string No The name of an entity to mask (e.g. a name of a header or a query parameter).
mode enum No Data masking mode. - Mask or Hide