Get-​Azure​Rm​Diagnostic​Setting

Gets the logged categories and time grains.

Syntax

Get-AzureRmDiagnosticSetting
   [-ResourceId] <String>
   [<CommonParameters>]

Description

The Get-AzureRmDiagnosticSetting cmdlet gets the categories and time grains that are logged for a resource.

A time grain is the aggregation interval of a metric.

Examples

Example 1: Get the status of the logging categories and time grains

PS C:\>Get-AzureRmDiagnosticSetting -ResourceId "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/ResourceGroups/ContosoRG/providers/microsoft.keyvault/KeyVaults/ContosoKeyVault"
StorageAccountId   : /subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/ResourceGroups/ContosoRG/providers/microsoft.storage/accounts/ContosoStorageAccount
StorageAccountName : ContosoStorageAccount001
Metrics

Logs
Enabled  : True
Category : AuditEvent

This command gets the categories and time grains that are logged for an Azure Key Vault with a ResourceId of /subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/ResourceGroups/ContosoRG/providers/microsoft.keyvault/KeyVaults/ContosoKeyVault.

Required Parameters

-ResourceId

Specifies the ID of the resource.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False