Skip to main content

service_diagnostic_settings

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

Overview

Nameservice_diagnostic_settings
TypeResource
Idazure.monitor.service_diagnostic_settings

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
eventHubAuthorizationRuleIdstringThe resource Id for the event hub namespace authorization rule.
locationstringResource location. Required.
logsarraythe list of logs settings.
metricsarraythe list of metric settings.
serviceBusRuleIdstringThe service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming Diagnostic Logs. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
storageAccountIdstringThe resource ID of the storage account to which you would like to send Diagnostic Logs.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
workspaceIdstringThe workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_uriGets the active diagnostic settings for the specified resource. WARNING: This method will be deprecated in future releases.
create_or_updateinsertresource_uri, locationCreate or update new diagnostic settings for the specified resource. WARNING: This method will be deprecated in future releases.
updateupdateresource_uriUpdates an existing ServiceDiagnosticSettingsResource. To update other fields use the CreateOrUpdate method. WARNING: This method will be deprecated in future releases.
create_or_updatereplaceresource_uri, locationCreate or update new diagnostic settings for the specified resource. WARNING: This method will be deprecated in future releases.

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.

NameDatatypeDescription
resource_uristringThe fully qualified Azure Resource manager identifier of the resource. Required.

SELECT examples

Gets the active diagnostic settings for the specified resource. WARNING: This method will be deprecated in future releases.

SELECT
id,
name,
eventHubAuthorizationRuleId,
location,
logs,
metrics,
serviceBusRuleId,
storageAccountId,
systemData,
tags,
type,
workspaceId
FROM azure.monitor.service_diagnostic_settings
WHERE resource_uri = '{{ resource_uri }}' -- required
;

INSERT examples

Create or update new diagnostic settings for the specified resource. WARNING: This method will be deprecated in future releases.

INSERT INTO azure.monitor.service_diagnostic_settings (
properties,
location,
tags,
resource_uri
)
SELECT
'{{ properties }}',
'{{ location }}' /* required */,
'{{ tags }}',
'{{ resource_uri }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Updates an existing ServiceDiagnosticSettingsResource. To update other fields use the CreateOrUpdate method. WARNING: This method will be deprecated in future releases.

UPDATE azure.monitor.service_diagnostic_settings
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_uri = '{{ resource_uri }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

REPLACE examples

Create or update new diagnostic settings for the specified resource. WARNING: This method will be deprecated in future releases.

REPLACE azure.monitor.service_diagnostic_settings
SET
properties = '{{ properties }}',
location = '{{ location }}',
tags = '{{ tags }}'
WHERE
resource_uri = '{{ resource_uri }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;