Microsoft.ApiManagement service/apis/diagnostics 2018-06-01-preview

The service/apis/diagnostics resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.ApiManagement/service/apis/diagnostics resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.ApiManagement/service/apis/diagnostics@2018-06-01-preview' = {
  name: 'string'
  parent: parentSymbolicName
  properties: {
    alwaysLog: 'allErrors'
    backend: {
      request: {
        body: {
          bytes: int
        }
        headers: [ 'string' ]
      }
      response: {
        body: {
          bytes: int
        }
        headers: [ 'string' ]
      }
    }
    enableHttpCorrelationHeaders: bool
    frontend: {
      request: {
        body: {
          bytes: int
        }
        headers: [ 'string' ]
      }
      response: {
        body: {
          bytes: int
        }
        headers: [ 'string' ]
      }
    }
    loggerId: 'string'
    sampling: {
      percentage: int
      samplingType: 'fixed'
    }
  }
}

Property values

service/apis/diagnostics

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.ApiManagement/service/apis/diagnostics'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2018-06-01-preview'
name The resource name

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
parentSymbolicName
properties Diagnostic Entity Properties DiagnosticContractProperties

DiagnosticContractProperties

Name Description Value
alwaysLog Specifies for what type of messages sampling settings should not apply. 'allErrors'
backend Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. PipelineDiagnosticSettings
enableHttpCorrelationHeaders Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true. bool
frontend Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. PipelineDiagnosticSettings
loggerId Resource Id of a target logger. string (required)
sampling Sampling settings for Diagnostic. SamplingSettings

PipelineDiagnosticSettings

Name Description Value
request Http message diagnostic settings. HttpMessageDiagnostic
response Http message diagnostic settings. HttpMessageDiagnostic

HttpMessageDiagnostic

Name Description Value
body Body logging settings. BodyDiagnosticSettings
headers Array of HTTP Headers to log. string[]

BodyDiagnosticSettings

Name Description Value
bytes Number of request body bytes to log. int

SamplingSettings

Name Description Value
percentage Rate of sampling for fixed-rate sampling. int
samplingType Sampling type. 'fixed'