Skip to main content

diagnostic_settings

Creates, updates, deletes, gets or lists a diagnostic_settings resource.

Overview

Namediagnostic_settings
TypeResource
Idazure.monitor.diagnostic_settings

Fields

NameDatatypeDescription
idtextAzure resource Id
nametextAzure resource name
event_hub_authorization_rule_idtextfield from the properties object
event_hub_nametextfield from the properties object
locationtextResource location
log_analytics_destination_typetextfield from the properties object
logstextfield from the properties object
marketplace_partner_idtextfield from the properties object
metricstextfield from the properties object
resourceUritextfield from the properties object
service_bus_rule_idtextfield from the properties object
storage_account_idtextfield from the properties object
system_datatextfield from the properties object
tagstextGets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.
typetextAzure resource type
workspace_idtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, resourceUriGets the active diagnostic settings for the specified resource.
listSELECTresourceUriGets the active diagnostic settings list for the specified resource.
create_or_updateINSERTname, resourceUriCreates or updates diagnostic settings for the specified resource.
deleteDELETEname, resourceUriDeletes existing diagnostic settings for the specified resource.

SELECT examples

Gets the active diagnostic settings list for the specified resource.

SELECT
id,
name,
event_hub_authorization_rule_id,
event_hub_name,
location,
log_analytics_destination_type,
logs,
marketplace_partner_id,
metrics,
resourceUri,
service_bus_rule_id,
storage_account_id,
system_data,
tags,
type,
workspace_id
FROM azure.monitor.vw_diagnostic_settings
WHERE resourceUri = '{{ resourceUri }}';

INSERT example

Use the following StackQL query and manifest file to create a new diagnostic_settings resource.

/*+ create */
INSERT INTO azure.monitor.diagnostic_settings (
name,
resourceUri,
location,
tags,
properties
)
SELECT
'{{ name }}',
'{{ resourceUri }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

DELETE example

Deletes the specified diagnostic_settings resource.

/*+ delete */
DELETE FROM azure.monitor.diagnostic_settings
WHERE name = '{{ name }}'
AND resourceUri = '{{ resourceUri }}';