api_diagnostic
Creates, updates, deletes, gets or lists an api_diagnostic resource.
Overview
| Name | api_diagnostic |
| Type | Resource |
| Id | azure.api_management.api_diagnostic |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_service
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
alwaysLog | string | Specifies for what type of messages sampling settings should not apply. "allErrors" (allErrors) |
backend | object | Diagnostic settings for incoming/outgoing HTTP messages to the Backend. |
frontend | object | Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. |
httpCorrelationProtocol | string | Sets correlation protocol to use for Application Insights diagnostics. Known values are: "None", "Legacy", and "W3C". (None, Legacy, W3C) |
largeLanguageModel | object | Large Language Models diagnostic settings. |
logClientIp | boolean | Log the ClientIP. Default is false. |
loggerId | string | Resource Id of a target logger. Required. |
metrics | boolean | Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. |
operationNameFormat | string | The format of the Operation Name for Application Insights telemetries. Default is Name. Known values are: "Name" and "Url". (Name, Url) |
sampling | object | Sampling settings for Diagnostic. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
verbosity | string | The verbosity level applied to traces emitted by trace policies. Known values are: "verbose", "information", and "error". (verbose, information, error) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
alwaysLog | string | Specifies for what type of messages sampling settings should not apply. "allErrors" (allErrors) |
backend | object | Diagnostic settings for incoming/outgoing HTTP messages to the Backend. |
frontend | object | Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. |
httpCorrelationProtocol | string | Sets correlation protocol to use for Application Insights diagnostics. Known values are: "None", "Legacy", and "W3C". (None, Legacy, W3C) |
largeLanguageModel | object | Large Language Models diagnostic settings. |
logClientIp | boolean | Log the ClientIP. Default is false. |
loggerId | string | Resource Id of a target logger. Required. |
metrics | boolean | Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. |
operationNameFormat | string | The format of the Operation Name for Application Insights telemetries. Default is Name. Known values are: "Name" and "Url". (Name, Url) |
sampling | object | Sampling settings for Diagnostic. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
verbosity | string | The verbosity level applied to traces emitted by trace policies. Known values are: "verbose", "information", and "error". (verbose, information, error) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, service_name, api_id, diagnostic_id, subscription_id | Gets the details of the Diagnostic for an API specified by its identifier. | |
list_by_service | select | resource_group_name, service_name, api_id, subscription_id | $filter, $top, $skip | Lists all diagnostics of an API. |
create_or_update | insert | resource_group_name, service_name, api_id, diagnostic_id, subscription_id | Creates a new Diagnostic for an API or updates an existing one. | |
update | update | resource_group_name, service_name, api_id, diagnostic_id, subscription_id | Updates the details of the Diagnostic for an API specified by its identifier. | |
create_or_update | replace | resource_group_name, service_name, api_id, diagnostic_id, subscription_id | Creates a new Diagnostic for an API or updates an existing one. | |
delete | delete | resource_group_name, service_name, api_id, diagnostic_id, subscription_id | Deletes the specified Diagnostic from an API. | |
get_entity_tag | exec | resource_group_name, service_name, api_id, diagnostic_id, subscription_id | Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_id | string | API identifier. Must be unique in the current API Management service instance. Required. |
diagnostic_id | string | Diagnostic identifier. Must be unique in the current API Management service instance. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
service_name | string | The name of the API Management service. Required. |
subscription_id | string | |
$filter | string | | Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |. Default value is None. |
$skip | integer | Number of records to skip. Default value is None. |
$top | integer | Number of records to return. Default value is None. |
SELECT examples
- get
- list_by_service
Gets the details of the Diagnostic for an API specified by its identifier.
SELECT
id,
name,
alwaysLog,
backend,
frontend,
httpCorrelationProtocol,
largeLanguageModel,
logClientIp,
loggerId,
metrics,
operationNameFormat,
sampling,
systemData,
type,
verbosity
FROM azure.api_management.api_diagnostic
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND api_id = '{{ api_id }}' -- required
AND diagnostic_id = '{{ diagnostic_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all diagnostics of an API.
SELECT
id,
name,
alwaysLog,
backend,
frontend,
httpCorrelationProtocol,
largeLanguageModel,
logClientIp,
loggerId,
metrics,
operationNameFormat,
sampling,
systemData,
type,
verbosity
FROM azure.api_management.api_diagnostic
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND api_id = '{{ api_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
;
INSERT examples
- create_or_update
- Manifest
Creates a new Diagnostic for an API or updates an existing one.
INSERT INTO azure.api_management.api_diagnostic (
properties,
resource_group_name,
service_name,
api_id,
diagnostic_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ service_name }}',
'{{ api_id }}',
'{{ diagnostic_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: api_diagnostic
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the api_diagnostic resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the api_diagnostic resource.
- name: api_id
value: "{{ api_id }}"
description: Required parameter for the api_diagnostic resource.
- name: diagnostic_id
value: "{{ diagnostic_id }}"
description: Required parameter for the api_diagnostic resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the api_diagnostic resource.
- name: properties
description: |
Diagnostic entity contract properties.
value:
alwaysLog: "{{ alwaysLog }}"
loggerId: "{{ loggerId }}"
sampling:
samplingType: "{{ samplingType }}"
percentage: {{ percentage }}
frontend:
request:
headers:
- "{{ headers }}"
body:
bytes: {{ bytes }}
dataMasking:
queryParams:
- value: "{{ value }}"
mode: "{{ mode }}"
headers:
- value: "{{ value }}"
mode: "{{ mode }}"
response:
headers:
- "{{ headers }}"
body:
bytes: {{ bytes }}
dataMasking:
queryParams:
- value: "{{ value }}"
mode: "{{ mode }}"
headers:
- value: "{{ value }}"
mode: "{{ mode }}"
backend:
request:
headers:
- "{{ headers }}"
body:
bytes: {{ bytes }}
dataMasking:
queryParams:
- value: "{{ value }}"
mode: "{{ mode }}"
headers:
- value: "{{ value }}"
mode: "{{ mode }}"
response:
headers:
- "{{ headers }}"
body:
bytes: {{ bytes }}
dataMasking:
queryParams:
- value: "{{ value }}"
mode: "{{ mode }}"
headers:
- value: "{{ value }}"
mode: "{{ mode }}"
largeLanguageModel:
logs: "{{ logs }}"
requests:
messages: "{{ messages }}"
maxSizeInBytes: {{ maxSizeInBytes }}
responses:
messages: "{{ messages }}"
maxSizeInBytes: {{ maxSizeInBytes }}
logClientIp: {{ logClientIp }}
httpCorrelationProtocol: "{{ httpCorrelationProtocol }}"
verbosity: "{{ verbosity }}"
operationNameFormat: "{{ operationNameFormat }}"
metrics: {{ metrics }}
UPDATE examples
- update
Updates the details of the Diagnostic for an API specified by its identifier.
UPDATE azure.api_management.api_diagnostic
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND diagnostic_id = '{{ diagnostic_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Creates a new Diagnostic for an API or updates an existing one.
REPLACE azure.api_management.api_diagnostic
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND diagnostic_id = '{{ diagnostic_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the specified Diagnostic from an API.
DELETE FROM azure.api_management.api_diagnostic
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND diagnostic_id = '{{ diagnostic_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- get_entity_tag
Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier.
EXEC azure.api_management.api_diagnostic.get_entity_tag
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@api_id='{{ api_id }}' --required,
@diagnostic_id='{{ diagnostic_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;