Subscription Diagnostic Settings - Get

Gets the active subscription diagnostic settings for the specified resource.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}?api-version=2021-05-01-preview

URI Parameters

Name In Required Type Description
name
path True

string

The name of the diagnostic setting.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

SubscriptionDiagnosticSettingsResource

Successful request to get more information about diagnostic setting.

Other Status Codes

ErrorResponse

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 subscription diagnostic setting
Gets the subscription diagnostic setting for category

Gets the subscription diagnostic setting

Sample request

GET https://management.azure.com/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/providers/Microsoft.Insights/diagnosticSettings/mysetting?api-version=2021-05-01-preview

Sample response

{
  "id": "subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/providers/AzureResourceManager/diagnosticSettings/ds4",
  "type": null,
  "name": "ds4",
  "properties": {
    "storageAccountId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
    "workspaceId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/apptest/providers/Microsoft.OperationalInsights/workspaces/test1",
    "eventHubAuthorizationRuleId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/apptest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule",
    "marketplacePartnerId": "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1",
    "logs": [
      {
        "categoryGroup": "allLogs",
        "enabled": true
      }
    ]
  }
}

Gets the subscription diagnostic setting for category

Sample request

GET https://management.azure.com/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/providers/Microsoft.Insights/diagnosticSettings/mysetting?api-version=2021-05-01-preview

Sample response

{
  "id": "subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/providers/AzureResourceManager/diagnosticSettings/ds4",
  "type": null,
  "name": "ds4",
  "properties": {
    "storageAccountId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",
    "workspaceId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/apptest/providers/Microsoft.OperationalInsights/workspaces/test1",
    "eventHubAuthorizationRuleId": "/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/apptest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule",
    "marketplacePartnerId": "/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1",
    "logs": [
      {
        "category": "Security",
        "enabled": true
      },
      {
        "category": "Administrative",
        "enabled": true
      },
      {
        "category": "ServiceHealth",
        "enabled": true
      },
      {
        "category": "Alert",
        "enabled": true
      },
      {
        "category": "Recommendation",
        "enabled": true
      },
      {
        "category": "Policy",
        "enabled": true
      },
      {
        "category": "Autoscale",
        "enabled": true
      },
      {
        "category": "ResourceHealth",
        "enabled": true
      }
    ]
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorResponse

Describes the format of Error response.

SubscriptionDiagnosticSettingsResource

The subscription diagnostic setting resource.

SubscriptionLogSettings

Part of Subscription diagnostic setting. Specifies the settings for a particular log.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Name Type Description
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorResponse

Describes the format of Error response.

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

SubscriptionDiagnosticSettingsResource

The subscription diagnostic setting resource.

Name Type 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

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.logs

SubscriptionLogSettings[]

The list of logs settings.

properties.marketplacePartnerId

string

The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.

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

systemData

systemData

The system metadata related to this resource.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

SubscriptionLogSettings

Part of Subscription diagnostic setting. Specifies the settings for a particular log.

Name Type Description
category

string

Name of a Subscription Diagnostic Log category for a resource type this setting is applied to.

categoryGroup

string

Name of a Subscription Diagnostic Log category group for a resource type this setting is applied to.

enabled

boolean

a value indicating whether this log is enabled.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.