Diagnostic Settings - Get

Gets the active diagnostic settings for the specified resource.

GET https://management.azure.com/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}?api-version=2017-05-01-preview

URI Parameters

Name In Required Type Description
resourceUri
path True
  • string

The identifier of the resource.

name
path True
  • string

The name of the diagnostic setting.

api-version
query True
  • string

Client Api Version.

Responses

Name Type Description
200 OK

Successful request to get more information about diagnostic setting

Other Status Codes

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Gets the diagnostic setting

Sample Request

GET https://management.azure.com/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettings/mysetting?api-version=2017-05-01-preview

Sample Response

{
  "id": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/service",
  "type": "",
  "name": "mysetting",
  "properties": {
    "storageAccountId": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
    "workspaceId": "",
    "eventHubAuthorizationRuleId": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule",
    "metrics": [
      {
        "category": "WorkflowMetrics",
        "enabled": true,
        "retentionPolicy": {
          "enabled": false,
          "days": 0
        }
      }
    ],
    "logs": [
      {
        "category": "WorkflowRuntime",
        "enabled": true,
        "retentionPolicy": {
          "enabled": false,
          "days": 0
        }
      }
    ]
  }
}

Definitions

DiagnosticSettingsResource

The diagnostic setting resource.

ErrorResponse

Describes the format of Error response.

LogSettings

Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.

MetricSettings

Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.

RetentionPolicy

Specifies the retention policy for the log.

DiagnosticSettingsResource

The diagnostic setting resource.

Name Type Description
id
  • string

Azure resource Id

name
  • string

Azure resource name

properties.eventHubAuthorizationRuleId
  • string

The resource Id for the event hub authorization rule.

properties.eventHubName
  • string

The name of the event hub. If none is specified, the default event hub will be selected.

properties.logAnalyticsDestinationType
  • string

A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)

properties.logs

The list of logs settings.

properties.metrics

The list of metric settings.

properties.serviceBusRuleId
  • string

The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.

properties.storageAccountId
  • string

The resource ID of the storage account to which you would like to send Diagnostic Logs.

properties.workspaceId
  • string

The full ARM resource ID of the 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

type
  • string

Azure resource type

ErrorResponse

Describes the format of Error response.

Name Type Description
code
  • string

Error code

message
  • string

Error message indicating why the operation failed.

LogSettings

Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.

Name Type Description
category
  • string

Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.

enabled
  • boolean

a value indicating whether this log is enabled.

retentionPolicy

the retention policy for this log.

MetricSettings

Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.

Name Type Description
category
  • string

Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation.

enabled
  • boolean

a value indicating whether this category is enabled.

retentionPolicy

the retention policy for this category.

timeGrain
  • string

the timegrain of the metric in ISO8601 format.

RetentionPolicy

Specifies the retention policy for the log.

Name Type Description
days
  • integer

the number of days for the retention in days. A value of 0 will retain the events indefinitely.

enabled
  • boolean

a value indicating whether the retention policy is enabled.