Dela via


Remove-AzDiagnosticSetting

Remove a diagnostic setting for the a resource.

Syntax

Default (Standard)

Remove-AzDiagnosticSetting
    -ResourceId <String>
    [-Name <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-AzDiagnosticSetting cmdlet removes the diagnostic setting for the particular resource. This cmdlet implements the ShouldProcess pattern, i.e. it might request confirmation from the user before actually creating, modifying, or removing the resource.

Exempel

Example 1: Remove the default diagnostic setting (service) for a resource

PS C:\>Remove-AzDiagnosticSetting -ResourceId "Resource01"

This command removes the default diagnostic setting (service) for the resource called Resource01.

Example 2: Remove the default diagnostic setting identified by the given name for a resource

PS C:\>Remove-AzDiagnosticSetting -ResourceId "Resource01" -Name myDiagSetting

This command removes the diagnostic setting called myDiagSetting for the resource called Resource01.

Parametrar

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:cf

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameteregenskaper

Typ:IAzureContextContainer
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:AzContext, AzureRmContext, AzureCredential

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

-Name

The name of the diagnostic setting. If not given the call default to "service" as it was in the previous API and this cmdlet will only disable all categories for metrics/logs.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-ResourceId

Specifies the ID of the resource.

Parameteregenskaper

Typ:String
Standardvärde:None
Stöder jokertecken:False
DontShow:False

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:True
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:True
Värde från återstående argument:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameteregenskaper

Typ:SwitchParameter
Standardvärde:None
Stöder jokertecken:False
DontShow:False
Alias:wi

Parameteruppsättningar

(All)
Position:Named
Obligatorisk:False
Värde från pipeline:False
Värde från pipeline efter egenskapsnamn:False
Värde från återstående argument:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Indata

String

Utdata

Microsoft.Azure.AzureOperationResponse