From c4369a74a12aa2c38d425e361999092f7f0bb789 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Thu, 10 Jul 2025 12:39:51 +0800 Subject: [PATCH 1/3] migrate DiagnosticSetting module to autorest v4 --- .../Properties/AssemblyInfo.cs | 28 ++ .../DiagnosticSetting.Autorest/README.md | 15 +- ...w-AzDiagnosticSettingLogSettingsObject.ps1 | 9 +- ...zDiagnosticSettingMetricSettingsObject.ps1 | 9 +- ...icSettingSubscriptionLogSettingsObject.ps1 | 9 +- .../docs/Az.DiagnosticSetting.md | 12 +- .../docs/Get-AzDiagnosticSetting.md | 3 +- .../docs/Get-AzDiagnosticSettingCategory.md | 3 +- .../docs/Get-AzEventCategory.md | 2 +- .../Get-AzSubscriptionDiagnosticSetting.md | 3 +- .../docs/New-AzDiagnosticSetting.md | 73 +++- ...ew-AzDiagnosticSettingLogSettingsObject.md | 4 +- ...AzDiagnosticSettingMetricSettingsObject.md | 4 +- ...ticSettingSubscriptionLogSettingsObject.md | 4 +- .../New-AzSubscriptionDiagnosticSetting.md | 66 ++- .../docs/Remove-AzDiagnosticSetting.md | 1 - .../Remove-AzSubscriptionDiagnosticSetting.md | 1 - .../docs/Update-AzDiagnosticSetting.md | 295 +++++++++++++ .../Update-AzSubscriptionDiagnosticSetting.md | 260 ++++++++++++ .../examples/Update-AzDiagnosticSetting.md | 9 + .../Update-AzSubscriptionDiagnosticSetting.md | 8 + .../generate-info.json | 2 +- .../resources/README.md | 11 + .../test/DiagnosticSetting.Recording.json | 392 ++++++++++++++++-- .../test/DiagnosticSetting.Tests.ps1 | 25 +- .../test/Get-AzEventCategory.Recording.json | 49 +++ .../test/Get-AzEventCategory.Tests.ps1 | 4 +- .../test/Update-AzDiagnosticSetting.Tests.ps1 | 25 ++ ...-AzSubscriptionDiagnosticSetting.Tests.ps1 | 25 ++ .../DiagnosticSetting.Autorest/test/env.json | 13 +- .../DiagnosticSetting.Autorest/test/utils.ps1 | 3 + src/Monitor/Monitor.sln | 31 +- src/Monitor/Monitor/Az.Monitor.psd1 | 7 +- src/Monitor/Monitor/help/Az.Monitor.md | 10 +- .../Monitor/help/Get-AzDiagnosticSetting.md | 3 +- .../help/Get-AzDiagnosticSettingCategory.md | 3 +- .../Monitor/help/Get-AzEventCategory.md | 2 +- .../Get-AzSubscriptionDiagnosticSetting.md | 3 +- .../Monitor/help/New-AzDiagnosticSetting.md | 73 +++- ...ew-AzDiagnosticSettingLogSettingsObject.md | 4 +- ...AzDiagnosticSettingMetricSettingsObject.md | 4 +- ...ticSettingSubscriptionLogSettingsObject.md | 4 +- .../New-AzSubscriptionDiagnosticSetting.md | 66 ++- .../help/Remove-AzDiagnosticSetting.md | 1 - .../Remove-AzSubscriptionDiagnosticSetting.md | 1 - .../help/Update-AzDiagnosticSetting.md | 294 +++++++++++++ .../Update-AzSubscriptionDiagnosticSetting.md | 261 ++++++++++++ 47 files changed, 1945 insertions(+), 189 deletions(-) create mode 100644 src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs create mode 100644 src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzDiagnosticSetting.md create mode 100644 src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzSubscriptionDiagnosticSetting.md create mode 100644 src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzDiagnosticSetting.md create mode 100644 src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzSubscriptionDiagnosticSetting.md create mode 100644 src/Monitor/DiagnosticSetting.Autorest/resources/README.md create mode 100644 src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Recording.json create mode 100644 src/Monitor/DiagnosticSetting.Autorest/test/Update-AzDiagnosticSetting.Tests.ps1 create mode 100644 src/Monitor/DiagnosticSetting.Autorest/test/Update-AzSubscriptionDiagnosticSetting.Tests.ps1 create mode 100644 src/Monitor/Monitor/help/Update-AzDiagnosticSetting.md create mode 100644 src/Monitor/Monitor/help/Update-AzSubscriptionDiagnosticSetting.md diff --git a/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs b/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..585e2beb474f --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an ""AS IS"" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DiagnosticSetting")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] + + diff --git a/src/Monitor/DiagnosticSetting.Autorest/README.md b/src/Monitor/DiagnosticSetting.Autorest/README.md index 562e449ab291..5b6c6bcd0fff 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/README.md +++ b/src/Monitor/DiagnosticSetting.Autorest/README.md @@ -42,15 +42,6 @@ title: DiagnosticSetting module-version: 0.1.0 subject-prefix: DiagnosticSetting namespace: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting -nested-object-to-string: true - -# If there are post APIs for some kinds of actions in the RP, you may need to -# uncomment following line to support viaIdentity for these post APIs -# identity-correction-for-post: true - -# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option -use-extension: - "@autorest/powershell": "3.x" directive: # Following is two common directive which are normally required in all the RPs @@ -79,7 +70,7 @@ directive: subject-prefix: "" - model-cmdlet: - - MetricSettings - - LogSettings - - SubscriptionLogSettings + - model-name: MetricSettings + - model-name: LogSettings + - model-name: SubscriptionLogSettings ``` diff --git a/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingLogSettingsObject.ps1 b/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingLogSettingsObject.ps1 index b9ac8dccb56c..0119d2e8898a 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingLogSettingsObject.ps1 +++ b/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingLogSettingsObject.ps1 @@ -21,12 +21,13 @@ Create an in-memory object for LogSettings. Create an in-memory object for LogSettings. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingLogSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettinglogsettingsobject #> function New-AzDiagnosticSettingLogSettingsObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -48,7 +49,7 @@ function New-AzDiagnosticSettingLogSettingsObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings]::New() if ($PSBoundParameters.ContainsKey('Category')) { $Object.Category = $Category diff --git a/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingMetricSettingsObject.ps1 b/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingMetricSettingsObject.ps1 index e5766a5a947e..0ea764e4c7c9 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingMetricSettingsObject.ps1 +++ b/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingMetricSettingsObject.ps1 @@ -21,12 +21,13 @@ Create an in-memory object for MetricSettings. Create an in-memory object for MetricSettings. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingmetricsettingsobject #> function New-AzDiagnosticSettingMetricSettingsObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -48,7 +49,7 @@ function New-AzDiagnosticSettingMetricSettingsObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings]::New() if ($PSBoundParameters.ContainsKey('Category')) { $Object.Category = $Category diff --git a/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 b/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 index a089b6f3caa8..cc6e53f66a17 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 +++ b/src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 @@ -21,12 +21,13 @@ Create an in-memory object for SubscriptionLogSettings. Create an in-memory object for SubscriptionLogSettings. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingSubscriptionLogSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingsubscriptionlogsettingsobject #> function New-AzDiagnosticSettingSubscriptionLogSettingsObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -42,7 +43,7 @@ function New-AzDiagnosticSettingSubscriptionLogSettingsObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings]::New() if ($PSBoundParameters.ContainsKey('Category')) { $Object.Category = $Category diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Az.DiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Az.DiagnosticSetting.md index 85dd7dd51b93..4339333046ed 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Az.DiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Az.DiagnosticSetting.md @@ -1,6 +1,6 @@ --- Module Name: Az.DiagnosticSetting -Module Guid: 58f9f986-1839-4efb-baf4-5ba95f2726bd +Module Guid: 6210decd-f3c4-4cdf-87d4-f4bca61bf471 Download Help Link: https://learn.microsoft.com/powershell/module/az.diagnosticsetting Help Version: 1.0.0.0 Locale: en-US @@ -25,7 +25,7 @@ The current list includes the following: Administrative, Security, ServiceHealth Gets the active subscription diagnostic settings for the specified resource. ### [New-AzDiagnosticSetting](New-AzDiagnosticSetting.md) -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. ### [New-AzDiagnosticSettingLogSettingsObject](New-AzDiagnosticSettingLogSettingsObject.md) Create an in-memory object for LogSettings. @@ -37,7 +37,7 @@ Create an in-memory object for MetricSettings. Create an in-memory object for SubscriptionLogSettings. ### [New-AzSubscriptionDiagnosticSetting](New-AzSubscriptionDiagnosticSetting.md) -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. ### [Remove-AzDiagnosticSetting](Remove-AzDiagnosticSetting.md) Deletes existing diagnostic settings for the specified resource. @@ -45,3 +45,9 @@ Deletes existing diagnostic settings for the specified resource. ### [Remove-AzSubscriptionDiagnosticSetting](Remove-AzSubscriptionDiagnosticSetting.md) Deletes existing subscription diagnostic settings for the specified resource. +### [Update-AzDiagnosticSetting](Update-AzDiagnosticSetting.md) +Update diagnostic settings for the specified resource. + +### [Update-AzSubscriptionDiagnosticSetting](Update-AzSubscriptionDiagnosticSetting.md) +Update subscription diagnostic settings for the specified resource. + diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSetting.md index 0974c7d158e7..73d157680203 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSetting.md @@ -69,7 +69,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity @@ -122,7 +121,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSettingCategory.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSettingCategory.md index 9d6f9da8977d..896af77ef433 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSettingCategory.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzDiagnosticSettingCategory.md @@ -62,7 +62,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity @@ -115,7 +114,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzEventCategory.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzEventCategory.md index 762cd607f535..ffeb7ddfebd6 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzEventCategory.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzEventCategory.md @@ -68,7 +68,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzSubscriptionDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzSubscriptionDiagnosticSetting.md index 275e43a4e57f..2700e384232e 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzSubscriptionDiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Get-AzSubscriptionDiagnosticSetting.md @@ -69,7 +69,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity @@ -122,7 +121,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSetting.md index f13be452d25b..e39fe806fa7b 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSetting.md @@ -8,10 +8,11 @@ schema: 2.0.0 # New-AzDiagnosticSetting ## SYNOPSIS -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. ## SYNTAX +### CreateExpanded (Default) ``` New-AzDiagnosticSetting -Name -ResourceId [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] [-LogAnalyticsDestinationType ] @@ -20,8 +21,20 @@ New-AzDiagnosticSetting -Name -ResourceId [-EventHubAuthorizat [] ``` +### CreateViaJsonFilePath +``` +New-AzDiagnosticSetting -Name -ResourceId -JsonFilePath + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CreateViaJsonString +``` +New-AzDiagnosticSetting -Name -ResourceId -JsonString [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + ## DESCRIPTION -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. ## EXAMPLES @@ -72,7 +85,7 @@ The resource Id for the event hub authorization rule. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -88,7 +101,7 @@ If none is specified, the default event hub will be selected. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -98,13 +111,42 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Log The list of logs settings. -To construct, see NOTES section for LOG properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] +Parameter Sets: CreateExpanded Aliases: Required: False @@ -121,7 +163,7 @@ Possible values are: Dedicated and null (null is default.) ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -136,7 +178,7 @@ The full ARM resource ID of the Marketplace resource to which you would like to ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -148,11 +190,10 @@ Accept wildcard characters: False ### -Metric The list of metric settings. -To construct, see NOTES section for METRIC properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] +Parameter Sets: CreateExpanded Aliases: Required: False @@ -198,7 +239,7 @@ This is here to maintain backwards compatibility. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -213,7 +254,7 @@ The resource ID of the storage account to which you would like to send Diagnosti ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -229,7 +270,7 @@ Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insi ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -277,7 +318,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingLogSettingsObject.md b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingLogSettingsObject.md index 79bdfbdcdd90..451dd28887d6 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingLogSettingsObject.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingLogSettingsObject.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.Monitor -online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingLogSettingsObject +online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettinglogsettingsobject schema: 2.0.0 --- @@ -116,7 +116,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingMetricSettingsObject.md b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingMetricSettingsObject.md index f1ae5a1e3840..c958ca441c37 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingMetricSettingsObject.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingMetricSettingsObject.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.Monitor -online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject +online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingmetricsettingsobject schema: 2.0.0 --- @@ -116,7 +116,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md index cfd8c0454dbe..e4285c2d6d3f 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.Monitor -online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingSubscriptionLogSettingsObject +online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingsubscriptionlogsettingsobject schema: 2.0.0 --- @@ -83,7 +83,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzSubscriptionDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzSubscriptionDiagnosticSetting.md index 95ac5acbb44a..0b8453dd7a83 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzSubscriptionDiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/New-AzSubscriptionDiagnosticSetting.md @@ -8,10 +8,11 @@ schema: 2.0.0 # New-AzSubscriptionDiagnosticSetting ## SYNOPSIS -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. ## SYNTAX +### CreateExpanded (Default) ``` New-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] @@ -19,8 +20,20 @@ New-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] [-WorkspaceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` +### CreateViaJsonFilePath +``` +New-AzSubscriptionDiagnosticSetting -Name -JsonFilePath [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CreateViaJsonString +``` +New-AzSubscriptionDiagnosticSetting -Name -JsonString [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + ## DESCRIPTION -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. ## EXAMPLES @@ -57,7 +70,7 @@ The resource Id for the event hub authorization rule. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -73,7 +86,7 @@ If none is specified, the default event hub will be selected. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -83,13 +96,42 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Log The list of logs settings. -To construct, see NOTES section for LOG properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] +Parameter Sets: CreateExpanded Aliases: Required: False @@ -104,7 +146,7 @@ The full ARM resource ID of the Marketplace resource to which you would like to ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -135,7 +177,7 @@ This is here to maintain backwards compatibility. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -150,7 +192,7 @@ The resource ID of the storage account to which you would like to send Diagnosti ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -181,7 +223,7 @@ Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insi ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -229,7 +271,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzDiagnosticSetting.md index d0bf60f2905b..f1cfce958c20 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzDiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzDiagnosticSetting.md @@ -57,7 +57,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzSubscriptionDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzSubscriptionDiagnosticSetting.md index 152b4a4fc58a..ab56ab7c8f65 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzSubscriptionDiagnosticSetting.md +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Remove-AzSubscriptionDiagnosticSetting.md @@ -56,7 +56,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzDiagnosticSetting.md new file mode 100644 index 000000000000..b485c562669d --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzDiagnosticSetting.md @@ -0,0 +1,295 @@ +--- +external help file: +Module Name: Az.Monitor +online version: https://learn.microsoft.com/powershell/module/az.monitor/update-azdiagnosticsetting +schema: 2.0.0 +--- + +# Update-AzDiagnosticSetting + +## SYNOPSIS +Update diagnostic settings for the specified resource. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDiagnosticSetting -Name -ResourceId [-EventHubAuthorizationRuleId ] + [-EventHubName ] [-Log ] [-LogAnalyticsDestinationType ] + [-MarketplacePartnerId ] [-Metric ] [-ServiceBusRuleId ] + [-StorageAccountId ] [-WorkspaceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDiagnosticSetting -InputObject [-EventHubAuthorizationRuleId ] + [-EventHubName ] [-Log ] [-LogAnalyticsDestinationType ] + [-MarketplacePartnerId ] [-Metric ] [-ServiceBusRuleId ] + [-StorageAccountId ] [-WorkspaceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update diagnostic settings for the specified resource. + +## EXAMPLES + +### Example 1: Update diagnostic setting +```powershell +$newlog = New-AzDiagnosticSettingLogSettingsObject -Enabled $false -Category 'VMProtectionAlerts' +$newmetric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $false -Category 'AllMetrics' +Update-AzDiagnosticSetting -Name diagnosticSettingName -ResourceId 'vnetId' -Log $newlog -Metric $newmetric +``` + +These commands update diagnostic setting for resource with log analytics workspace as destination. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubAuthorizationRuleId +The resource Id for the event hub authorization rule. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubName +The name of the event hub. +If none is specified, the default event hub will be selected. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Log +The list of logs settings. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LogAnalyticsDestinationType +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.) + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MarketplacePartnerId +The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +The list of metric settings. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the diagnostic setting. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +The identifier of the resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceBusRuleId +The service bus rule Id of the diagnostic setting. +This is here to maintain backwards compatibility. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +The resource ID of the storage account to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceId +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 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource + +## NOTES + +## RELATED LINKS + diff --git a/src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzSubscriptionDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzSubscriptionDiagnosticSetting.md new file mode 100644 index 000000000000..9fe0912f1bf1 --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/docs/Update-AzSubscriptionDiagnosticSetting.md @@ -0,0 +1,260 @@ +--- +external help file: +Module Name: Az.Monitor +online version: https://learn.microsoft.com/powershell/module/az.monitor/update-azsubscriptiondiagnosticsetting +schema: 2.0.0 +--- + +# Update-AzSubscriptionDiagnosticSetting + +## SYNOPSIS +Update subscription diagnostic settings for the specified resource. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] + [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] + [-MarketplacePartnerId ] [-ServiceBusRuleId ] [-StorageAccountId ] + [-WorkspaceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzSubscriptionDiagnosticSetting -InputObject + [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] + [-MarketplacePartnerId ] [-ServiceBusRuleId ] [-StorageAccountId ] + [-WorkspaceId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update subscription diagnostic settings for the specified resource. + +## EXAMPLES + +### Example 1: Update diagnostic setting for current subscription +```powershell +$log = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true +Update-AzSubscriptionDiagnosticSetting -Name settingname -WorkspaceId 'workspaceid' -Log $log +``` + +These command update diagnostic setting for current subscription. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubAuthorizationRuleId +The resource Id for the event hub authorization rule. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubName +The name of the event hub. +If none is specified, the default event hub will be selected. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Log +The list of logs settings. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MarketplacePartnerId +The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the diagnostic setting. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceBusRuleId +The service bus rule Id of the diagnostic setting. +This is here to maintain backwards compatibility. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +The resource ID of the storage account to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceId +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 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + +## NOTES + +## RELATED LINKS + diff --git a/src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzDiagnosticSetting.md new file mode 100644 index 000000000000..871ae70e9e61 --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzDiagnosticSetting.md @@ -0,0 +1,9 @@ +### Example 1: Update diagnostic setting +```powershell +$newlog = New-AzDiagnosticSettingLogSettingsObject -Enabled $false -Category 'VMProtectionAlerts' +$newmetric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $false -Category 'AllMetrics' +Update-AzDiagnosticSetting -Name diagnosticSettingName -ResourceId 'vnetId' -Log $newlog -Metric $newmetric +``` + +These commands update diagnostic setting for resource with log analytics workspace as destination. + diff --git a/src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzSubscriptionDiagnosticSetting.md b/src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzSubscriptionDiagnosticSetting.md new file mode 100644 index 000000000000..e7c6f1a9d8be --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/examples/Update-AzSubscriptionDiagnosticSetting.md @@ -0,0 +1,8 @@ +### Example 1: Update diagnostic setting for current subscription +```powershell +$log = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true +Update-AzSubscriptionDiagnosticSetting -Name settingname -WorkspaceId 'workspaceid' -Log $log +``` + +These command update diagnostic setting for current subscription. + diff --git a/src/Monitor/DiagnosticSetting.Autorest/generate-info.json b/src/Monitor/DiagnosticSetting.Autorest/generate-info.json index 511ed3565792..f6876df3bb44 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/generate-info.json +++ b/src/Monitor/DiagnosticSetting.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "c5c70d3a-756d-4a6b-aad1-fe0e0747df71" + "generate_Id": "509b73d6-6e79-4ae2-8d78-897c49667eff" } diff --git a/src/Monitor/DiagnosticSetting.Autorest/resources/README.md b/src/Monitor/DiagnosticSetting.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Recording.json b/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Recording.json index 6e97fedb6b82..050993a3d4cd 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Recording.json +++ b/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Recording.json @@ -1,17 +1,17 @@ { - "DiagnosticSetting+[NoContext]+CRUD+$GET+https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettingsCategories?api-version=2021-05-01-preview+1": { + "DiagnosticSetting+[NoContext]+CRUD+$GET+https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettingsCategories?api-version=2021-05-01-preview+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettingsCategories?api-version=2021-05-01-preview", + "RequestUri": "https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettingsCategories?api-version=2021-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "6b13707b-7787-44d8-b2a3-850e9eabd74e" ], + "x-ms-client-request-id": [ "e343c3d7-0cc3-4621-815b-e6709b8c5c24" ], "CommandName": [ "Get-AzDiagnosticSettingCategory" ], "FullCommandName": [ "Get-AzDiagnosticSettingCategory_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.2.6", "Az.DiagnosticSetting/0.1.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -23,34 +23,37 @@ "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-request-id": [ "67447332-5015-4464-9cd2-70ca2912e4cc" ], - "Server": [ "Microsoft-IIS/10.0" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11995" ], - "x-ms-correlation-request-id": [ "003c7107-2578-4390-b8b4-633a8dfd9102" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220921T073556Z:003c7107-2578-4390-b8b4-633a8dfd9102" ], + "x-ms-request-id": [ "a8e36354-4261-4b8f-a99e-da4759f24a55" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/05c0663d-a0a7-4a3d-87e1-4da8290c33a4" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "249" ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ "3749" ], + "x-ms-correlation-request-id": [ "6a2fa38b-30b3-40a6-a901-1980eb0e50d5" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033717Z:6a2fa38b-30b3-40a6-a901-1980eb0e50d5" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 21 Sep 2022 07:35:55 GMT" ] + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 74D3A41DB4E645CA80595CDF75A04B5A Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:16Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:17 GMT" ] }, "ContentHeaders": { "Content-Length": [ "935" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.network/virtualnetworks/test-vnetijbg90/providers/microsoft.insights/diagnosticSettingsCategories/VMProtectionAlerts\",\"type\":\"microsoft.insights/diagnosticSettingsCategories\",\"name\":\"VMProtectionAlerts\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"displayName\":\"VM protection alerts\",\"categoryType\":\"Logs\",\"categoryGroups\":[\"allLogs\"]},\"identity\":null},{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.network/virtualnetworks/test-vnetijbg90/providers/microsoft.insights/diagnosticSettingsCategories/AllMetrics\",\"type\":\"microsoft.insights/diagnosticSettingsCategories\",\"name\":\"AllMetrics\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"displayName\":\"AllMetrics\",\"categoryType\":\"Metrics\"},\"identity\":null}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourcegroups/diagnostic-setting-groupt9vaw5/providers/microsoft.network/virtualnetworks/test-vnetxhjrie/providers/microsoft.insights/diagnosticSettingsCategories/VMProtectionAlerts\",\"type\":\"microsoft.insights/diagnosticSettingsCategories\",\"name\":\"VMProtectionAlerts\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"displayName\":\"VM protection alerts\",\"categoryType\":\"Logs\",\"categoryGroups\":[\"allLogs\"]},\"identity\":null},{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourcegroups/diagnostic-setting-groupt9vaw5/providers/microsoft.network/virtualnetworks/test-vnetxhjrie/providers/microsoft.insights/diagnosticSettingsCategories/AllMetrics\",\"type\":\"microsoft.insights/diagnosticSettingsCategories\",\"name\":\"AllMetrics\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"displayName\":\"AllMetrics\",\"categoryType\":\"Metrics\"},\"identity\":null}]}", "isContentBase64": false } }, - "DiagnosticSetting+[NoContext]+CRUD+$PUT+https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting1eqp5r?api-version=2021-05-01-preview+2": { + "DiagnosticSetting+[NoContext]+CRUD+$PUT+https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview+2": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting1eqp5r?api-version=2021-05-01-preview", - "Content": "{\r\n \"properties\": {\r\n \"metrics\": [\r\n {\r\n \"retentionPolicy\": {\r\n \"enabled\": true,\r\n \"days\": 7\r\n },\r\n \"category\": \"AllMetrics\",\r\n \"enabled\": true\r\n }\r\n ],\r\n \"logs\": [\r\n {\r\n \"retentionPolicy\": {\r\n \"enabled\": true,\r\n \"days\": 7\r\n },\r\n \"category\": \"VMProtectionAlerts\",\r\n \"enabled\": true\r\n }\r\n ],\r\n \"workspaceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.operationalinsights/workspaces/test-workspace8z9pt3\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"metrics\": [\r\n {\r\n \"category\": \"AllMetrics\",\r\n \"enabled\": true\r\n }\r\n ],\r\n \"logs\": [\r\n {\r\n \"category\": \"VMProtectionAlerts\",\r\n \"enabled\": true\r\n }\r\n ],\r\n \"workspaceId\": \"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, "ContentHeaders": { "Content-Type": [ "application/json" ], - "Content-Length": [ "615" ] + "Content-Length": [ "433" ] } }, "Response": { @@ -59,36 +62,38 @@ "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-request-id": [ "23cc55bb-f9b0-4b07-af72-0abdece53c27" ], - "Server": [ "Microsoft-IIS/10.0" ], - "x-ms-ratelimit-remaining-subscription-resource-requests": [ "149" ], - "x-ms-correlation-request-id": [ "d10a52e0-f962-4d82-a77d-605e2e352dc8" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220921T073603Z:d10a52e0-f962-4d82-a77d-605e2e352dc8" ], + "x-ms-request-id": [ "cd30c318-1093-41e7-bb65-3d2cf74a3c8e" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/575293c4-80db-4d79-875d-bb283f80731f" ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ "199" ], + "x-ms-correlation-request-id": [ "ec638afc-adc1-40a8-a4c0-0949842d20d6" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033724Z:ec638afc-adc1-40a8-a4c0-0949842d20d6" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 21 Sep 2022 07:36:02 GMT" ] + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: BC4F34DC131A46B4AACC223FDDB5DCB4 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:17Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:24 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "964" ], + "Content-Length": [ "966" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.network/virtualnetworks/test-vnetijbg90/providers/microsoft.insights/diagnosticSettings/test-diagnostic-setting1eqp5r\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-setting1eqp5r\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"storageAccountId\":null,\"serviceBusRuleId\":null,\"workspaceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.operationalinsights/workspaces/test-workspace8z9pt3\",\"eventHubAuthorizationRuleId\":null,\"eventHubName\":null,\"metrics\":[{\"timeGrain\":\"PT1M\",\"category\":\"AllMetrics\",\"enabled\":true,\"retentionPolicy\":{\"enabled\":true,\"days\":7}}],\"logs\":[{\"category\":\"VMProtectionAlerts\",\"categoryGroup\":null,\"enabled\":true,\"retentionPolicy\":{\"enabled\":true,\"days\":7}}],\"logAnalyticsDestinationType\":null},\"identity\":null}", + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourcegroups/diagnostic-setting-groupt9vaw5/providers/microsoft.network/virtualnetworks/test-vnetxhjrie/providers/microsoft.insights/diagnosticSettings/test-diagnostic-settingt1kbc6\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-settingt1kbc6\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"storageAccountId\":null,\"serviceBusRuleId\":null,\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"eventHubAuthorizationRuleId\":null,\"eventHubName\":null,\"metrics\":[{\"timeGrain\":\"PT1M\",\"category\":\"AllMetrics\",\"enabled\":true,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logs\":[{\"category\":\"VMProtectionAlerts\",\"categoryGroup\":null,\"enabled\":true,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logAnalyticsDestinationType\":null},\"identity\":null}", "isContentBase64": false } }, - "DiagnosticSetting+[NoContext]+CRUD+$GET+https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting1eqp5r?api-version=2021-05-01-preview+3": { + "DiagnosticSetting+[NoContext]+CRUD+$GET+https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting1eqp5r?api-version=2021-05-01-preview", + "RequestUri": "https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "4" ], - "x-ms-client-request-id": [ "9cbb31f3-0861-47ea-a6f5-e31680ba2d33" ], + "x-ms-client-request-id": [ "fcbcc9d5-b03f-4fa8-afb0-869a532811bc" ], "CommandName": [ "Get-AzDiagnosticSetting" ], "FullCommandName": [ "Get-AzDiagnosticSetting_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.2.6", "Az.DiagnosticSetting/0.1.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -100,36 +105,328 @@ "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-request-id": [ "35f4ee3b-0299-490c-a299-6969de0377af" ], - "Server": [ "Microsoft-IIS/10.0" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], - "x-ms-correlation-request-id": [ "f25b9a8c-f0b9-4018-b5e9-7ad909983000" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220921T073604Z:f25b9a8c-f0b9-4018-b5e9-7ad909983000" ], + "x-ms-request-id": [ "97003294-3343-42f9-ac87-3b4ab060ce59" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/82a6b586-a4b4-416d-8695-c625ac9be35b" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "249" ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ "3749" ], + "x-ms-correlation-request-id": [ "5796db39-7f6e-4160-9069-584aa6bb8235" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033726Z:5796db39-7f6e-4160-9069-584aa6bb8235" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 21 Sep 2022 07:36:04 GMT" ] + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 34F6E7A7264440CF85693D41C44B9841 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:25Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:26 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "945" ], + "Content-Length": [ "951" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.network/virtualnetworks/test-vnetijbg90/providers/microsoft.insights/diagnosticSettings/test-diagnostic-setting1eqp5r\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-setting1eqp5r\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"storageAccountId\":null,\"serviceBusRuleId\":null,\"workspaceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.operationalinsights/workspaces/test-workspace8z9pt3\",\"eventHubAuthorizationRuleId\":null,\"eventHubName\":null,\"metrics\":[{\"category\":\"AllMetrics\",\"enabled\":true,\"retentionPolicy\":{\"enabled\":true,\"days\":7}}],\"logs\":[{\"category\":\"VMProtectionAlerts\",\"categoryGroup\":null,\"enabled\":true,\"retentionPolicy\":{\"enabled\":true,\"days\":7}}],\"logAnalyticsDestinationType\":null},\"identity\":null}", + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourcegroups/diagnostic-setting-groupt9vaw5/providers/microsoft.network/virtualnetworks/test-vnetxhjrie/providers/microsoft.insights/diagnosticSettings/test-diagnostic-settingt1kbc6\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-settingt1kbc6\",\"location\":\"eastus\",\"kind\":null,\"tags\":null,\"properties\":{\"storageAccountId\":null,\"serviceBusRuleId\":null,\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"eventHubAuthorizationRuleId\":null,\"eventHubName\":null,\"metrics\":[{\"category\":\"AllMetrics\",\"enabled\":true,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logs\":[{\"category\":\"VMProtectionAlerts\",\"categoryGroup\":null,\"enabled\":true,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logAnalyticsDestinationType\":null},\"identity\":null}", "isContentBase64": false } }, - "DiagnosticSetting+[NoContext]+CRUD+$DELETE+https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting1eqp5r?api-version=2021-05-01-preview+4": { + "DiagnosticSetting+[NoContext]+CRUD+$GET+https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview+4": { "Request": { - "Method": "DELETE", - "RequestUri": "https://management.azure.com//subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting1eqp5r?api-version=2021-05-01-preview", + "Method": "GET", + "RequestUri": "https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "5" ], - "x-ms-client-request-id": [ "0b555ba7-c280-4a89-a94a-51f70f078af3" ], + "x-ms-client-request-id": [ "ca1358f1-1aae-4cc9-8494-87de3b020b81" ], + "CommandName": [ "Update-AzDiagnosticSetting" ], + "FullCommandName": [ "Update-AzDiagnosticSetting_UpdateExpanded" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "5eba6aff-1fab-4e5c-8d59-220ebd54e07b" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/f8b77ab8-b094-4e3c-9a57-4e05047d7eca" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "249" ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ "3749" ], + "x-ms-correlation-request-id": [ "6ef72ad8-7590-4d9e-98d4-ce2deb0469c9" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033727Z:6ef72ad8-7590-4d9e-98d4-ce2deb0469c9" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 99FB056CF08B4E85A7D45295E72AAB2C Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:26Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:27 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "951" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourcegroups/diagnostic-setting-groupt9vaw5/providers/microsoft.network/virtualnetworks/test-vnetxhjrie/providers/microsoft.insights/diagnosticSettings/test-diagnostic-settingt1kbc6\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-settingt1kbc6\",\"location\":\"eastus\",\"kind\":null,\"tags\":null,\"properties\":{\"storageAccountId\":null,\"serviceBusRuleId\":null,\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"eventHubAuthorizationRuleId\":null,\"eventHubName\":null,\"metrics\":[{\"category\":\"AllMetrics\",\"enabled\":true,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logs\":[{\"category\":\"VMProtectionAlerts\",\"categoryGroup\":null,\"enabled\":true,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logAnalyticsDestinationType\":null},\"identity\":null}", + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+CRUD+$PUT+https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview+5": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"metrics\": [\r\n {\r\n \"category\": \"AllMetrics\",\r\n \"enabled\": false\r\n }\r\n ],\r\n \"logs\": [\r\n {\r\n \"category\": \"VMProtectionAlerts\",\r\n \"enabled\": false\r\n }\r\n ],\r\n \"workspaceId\": \"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\"\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "435" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "b0b5137c-edb4-4d88-8b67-bc04c05f6dd0" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/f0be1d09-d08d-4e23-9d81-d429763a883c" ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ "199" ], + "x-ms-correlation-request-id": [ "8dcd29bf-2aa0-496d-a5c5-420060397635" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033731Z:8dcd29bf-2aa0-496d-a5c5-420060397635" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: F355648E4BCF4B47A4B7EA48FF160DEC Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:27Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:31 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "968" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourcegroups/diagnostic-setting-groupt9vaw5/providers/microsoft.network/virtualnetworks/test-vnetxhjrie/providers/microsoft.insights/diagnosticSettings/test-diagnostic-settingt1kbc6\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-settingt1kbc6\",\"location\":null,\"kind\":null,\"tags\":null,\"properties\":{\"storageAccountId\":null,\"serviceBusRuleId\":null,\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"eventHubAuthorizationRuleId\":null,\"eventHubName\":null,\"metrics\":[{\"timeGrain\":\"PT1M\",\"category\":\"AllMetrics\",\"enabled\":false,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logs\":[{\"category\":\"VMProtectionAlerts\",\"categoryGroup\":null,\"enabled\":false,\"retentionPolicy\":{\"enabled\":false,\"days\":0}}],\"logAnalyticsDestinationType\":null},\"identity\":null}", + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+CRUD+$DELETE+https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview+6": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://management.azure.com//subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-settingt1kbc6?api-version=2021-05-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "7" ], + "x-ms-client-request-id": [ "772045b4-1b49-4ee9-8ff4-96a184e53a88" ], "CommandName": [ "Remove-AzDiagnosticSetting" ], "FullCommandName": [ "Remove-AzDiagnosticSetting_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.2.6", "Az.DiagnosticSetting/0.1.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "bcfbf24e-aba6-4087-bf80-37685617aad2" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/cb333e5b-f0c8-4b08-80c7-fdd03521ba1e" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "199" ], + "x-ms-ratelimit-remaining-subscription-global-deletes": [ "2999" ], + "x-ms-correlation-request-id": [ "1a21353d-395d-4362-b555-0db803f9d366" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033734Z:1a21353d-395d-4362-b555-0db803f9d366" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 1AFF29FF1C9B4F3F92202550AA46C307 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:32Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:34 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null, + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+SubCRUD+$PUT+https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"logs\": [\r\n {\r\n \"category\": \"Recommendation\",\r\n \"enabled\": true\r\n }\r\n ],\r\n \"workspaceId\": \"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\"\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "325" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "49b8a49a-98aa-46e4-b055-e3f1b60d3712" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/bfa70e04-3a6d-4154-9c21-11765388e621" ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ "199" ], + "x-ms-correlation-request-id": [ "04b3a9e8-4371-4089-a78e-2351191772de" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033736Z:04b3a9e8-4371-4089-a78e-2351191772de" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 11E1306B886041108CB496CB055249B6 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:34Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:36 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "520" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/microsoft.insights/diagnosticSettings/test-diagnostic-setting4jksw1\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-setting4jksw1\",\"location\":\"global\",\"properties\":{\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"logs\":[{\"category\":\"Recommendation\",\"enabled\":true,\"categoryGroup\":null}]}}", + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+SubCRUD+$GET+https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "9" ], + "x-ms-client-request-id": [ "e3b599a4-d0aa-41ee-9c5e-d6fb4b7fc731" ], + "CommandName": [ "Update-AzSubscriptionDiagnosticSetting" ], + "FullCommandName": [ "Update-AzSubscriptionDiagnosticSetting_UpdateExpanded" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "edf0df3d-c602-4f87-b152-acfe5040f41d" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/0d4202b0-551b-4fef-b319-3486edc86bbe" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "249" ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ "3749" ], + "x-ms-correlation-request-id": [ "31cd5141-9d26-45b5-8ad9-a09e5a9ed889" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033737Z:31cd5141-9d26-45b5-8ad9-a09e5a9ed889" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 037608EDA20942A89FA03A68EB9C4EC2 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:37Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:37 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "960" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/microsoft.insights/diagnosticSettings/test-diagnostic-setting4jksw1\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-setting4jksw1\",\"location\":\"global\",\"properties\":{\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"logs\":[{\"category\":\"Recommendation\",\"enabled\":true,\"categoryGroup\":null},{\"category\":\"Administrative\",\"enabled\":false,\"categoryGroup\":null},{\"category\":\"Security\",\"enabled\":false,\"categoryGroup\":null},{\"category\":\"ServiceHealth\",\"enabled\":false,\"categoryGroup\":null},{\"category\":\"Alert\",\"enabled\":false,\"categoryGroup\":null},{\"category\":\"Policy\",\"enabled\":false,\"categoryGroup\":null},{\"category\":\"Autoscale\",\"enabled\":false,\"categoryGroup\":null},{\"category\":\"ResourceHealth\",\"enabled\":false,\"categoryGroup\":null}]}}", + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+SubCRUD+$PUT+https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview+3": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview", + "Content": "{\r\n \"properties\": {\r\n \"logs\": [\r\n {\r\n \"category\": \"Recommendation\",\r\n \"enabled\": false\r\n }\r\n ],\r\n \"workspaceId\": \"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\"\r\n }\r\n}", + "isContentBase64": false, + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "326" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "237352e8-2723-4b90-86ab-cfe7e98d00c3" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/24dfac12-4ba8-47de-b88c-e031354a9c66" ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ "199" ], + "x-ms-correlation-request-id": [ "e79a6a6d-667f-4d1f-afd4-145614b7bf01" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033740Z:e79a6a6d-667f-4d1f-afd4-145614b7bf01" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: E7565E5FEA38496497162DB1A3221B93 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:37Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:40 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "521" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/microsoft.insights/diagnosticSettings/test-diagnostic-setting4jksw1\",\"type\":\"Microsoft.Insights/diagnosticSettings\",\"name\":\"test-diagnostic-setting4jksw1\",\"location\":\"global\",\"properties\":{\"workspaceId\":\"/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy\",\"logs\":[{\"category\":\"Recommendation\",\"enabled\":false,\"categoryGroup\":null}]}}", + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+SubCRUD+$GET+https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings?api-version=2021-05-01-preview+4": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings?api-version=2021-05-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "11" ], + "x-ms-client-request-id": [ "81fc09f5-3f8f-4dfc-a9d7-d0d31037a0ce" ], + "CommandName": [ "Get-AzSubscriptionDiagnosticSetting" ], + "FullCommandName": [ "Get-AzSubscriptionDiagnosticSetting_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-request-id": [ "1f206ec8-885d-44f4-87cf-f3ce37d673fb" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/56832a24-be77-4258-a3d8-db0972d534ea" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "249" ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ "3749" ], + "x-ms-correlation-request-id": [ "bd33189c-cf23-4ad8-9cfa-448b964db57e" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033741Z:bd33189c-cf23-4ad8-9cfa-448b964db57e" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: C404BFD8BE964CD4B9AC2D33ED721AE8 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:40Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:41 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "12" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[]}", + "isContentBase64": false + } + }, + "DiagnosticSetting+[NoContext]+SubCRUD+$DELETE+https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview+5": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://management.azure.com/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/providers/Microsoft.Insights/diagnosticSettings/test-diagnostic-setting4jksw1?api-version=2021-05-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "12" ], + "x-ms-client-request-id": [ "bb5461ee-d6c2-40f5-b7b5-2796decf2eb9" ], + "CommandName": [ "Remove-AzSubscriptionDiagnosticSetting" ], + "FullCommandName": [ "Remove-AzSubscriptionDiagnosticSetting_Delete" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -141,13 +438,16 @@ "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-request-id": [ "62e184af-2a7b-463a-b385-c3a516fb8cdc" ], - "Server": [ "Microsoft-IIS/10.0" ], - "x-ms-ratelimit-remaining-subscription-deletes": [ "14999" ], - "x-ms-correlation-request-id": [ "b7c72ab8-8a5e-4f70-a397-d29be80d89e2" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20220921T073608Z:b7c72ab8-8a5e-4f70-a397-d29be80d89e2" ], + "x-ms-request-id": [ "5a58b4dc-49e3-4f36-a3fd-a2f65a5a89b8" ], + "x-ms-operation-identifier": [ "tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=5dce0ce9-f0a7-437f-aea2-760d05c62ca9/southindia/9c485815-3fb0-44dc-9c4b-d40da313f2af" ], + "x-ms-ratelimit-remaining-subscription-deletes": [ "199" ], + "x-ms-ratelimit-remaining-subscription-global-deletes": [ "2999" ], + "x-ms-correlation-request-id": [ "db98b2bc-ca7f-45d8-b440-1c622c0f008d" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033742Z:db98b2bc-ca7f-45d8-b440-1c622c0f008d" ], "X-Content-Type-Options": [ "nosniff" ], - "Date": [ "Wed, 21 Sep 2022 07:36:07 GMT" ] + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 237733D5C4344C8681B7E8D9D5D4F997 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:42Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:42 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Tests.ps1 b/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Tests.ps1 index 896383f7dab3..4c0dd519b650 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Tests.ps1 +++ b/src/Monitor/DiagnosticSetting.Autorest/test/DiagnosticSetting.Tests.ps1 @@ -19,9 +19,30 @@ Describe 'DiagnosticSetting' { $metric = @() $log = @() $categories = Get-AzDiagnosticSettingCategory -ResourceId $env.vnetId - $categories | ForEach-Object {if($_.CategoryType -eq "Metrics"){$metric+=New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category $_.Name -RetentionPolicyDay 7 -RetentionPolicyEnabled $true} else{$log+=New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category $_.Name -RetentionPolicyDay 7 -RetentionPolicyEnabled $true}} - $setting = New-AzDiagnosticSetting -Name $env.diagnosticSettingName -ResourceId $env.vnetId -WorkspaceId $env.workspaceId -Log $log -Metric $metric + $categories | ForEach-Object {if($_.CategoryType -eq "Metrics"){$metric+=New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category $_.Name } else{$log+=New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category $_.Name }} + New-AzDiagnosticSetting -Name $env.diagnosticSettingName -ResourceId $env.vnetId -WorkspaceId $env.workspaceId -Log $log -Metric $metric $setting = Get-AzDiagnosticSetting -Name $env.diagnosticSettingName -ResourceId $env.vnetId + $setting.Name | Should -Be $env.diagnosticSettingName + $setting.Log.Enabled | Should -Be $true + $setting.Metric.Enabled | Should -Be $true + + $newlog = New-AzDiagnosticSettingLogSettingsObject -Enabled $false -Category $setting.Log.Category + $newmetric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $false -Category $setting.Metric.Category + $setting = Update-AzDiagnosticSetting -Name $env.diagnosticSettingName -ResourceId $env.vnetId -Log $newlog -Metric $newmetric + $setting.Log.Enabled | Should -Be $false + $setting.Metric.Enabled | Should -Be $false Remove-AzDiagnosticSetting -Name $env.diagnosticSettingName -ResourceId $env.vnetId } + + It 'SubCRUD' { + $log = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true + $setting = New-AzSubscriptionDiagnosticSetting -Name $env.subscriptiondiagnosticSettingName -WorkspaceId $env.workspaceId -Log $log + $setting.Name | Should -Be $env.subscriptiondiagnosticSettingName + + $newlog = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $false + $setting = Update-AzSubscriptionDiagnosticSetting -Name $env.subscriptiondiagnosticSettingName -Log $newlog + $setting.Log.Enabled | Should -Be $false + Get-AzSubscriptionDiagnosticSetting + Remove-AzSubscriptionDiagnosticSetting -Name $env.subscriptiondiagnosticSettingName + } } \ No newline at end of file diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Recording.json b/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Recording.json new file mode 100644 index 000000000000..6d327e632579 --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Recording.json @@ -0,0 +1,49 @@ +{ + "Get-AzEventCategory+[NoContext]+List+$GET+https://management.azure.com/providers/Microsoft.Insights/eventcategories?api-version=2015-04-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/providers/Microsoft.Insights/eventcategories?api-version=2015-04-01", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "13" ], + "x-ms-client-request-id": [ "d91db36e-f895-4f53-ae02-7867fec3d04a" ], + "CommandName": [ "Get-AzEventCategory" ], + "FullCommandName": [ "Get-AzEventCategory_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.5.1", "Az.DiagnosticSetting/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "x-ms-ratelimit-remaining-tenant-reads": [ "249" ], + "x-ms-operation-identifier": [ "" ], + "Request-Context": [ "appId=cid-v1:e9ce6014-b708-4056-a18d-21dc38a7abb0" ], + "mise-correlation-id": [ "de9a20dd-897b-4176-bc11-367460cf7e70" ], + "api-supported-versions": [ "2015-04-01" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Access-Control-Allow-Origin": [ "*" ], + "x-ms-request-id": [ "d1ba5431-18ba-4a95-9c26-3f31f803803b" ], + "x-ms-correlation-request-id": [ "d1ba5431-18ba-4a95-9c26-3f31f803803b" ], + "x-ms-routing-request-id": [ "SOUTHINDIA:20250710T033743Z:d1ba5431-18ba-4a95-9c26-3f31f803803b" ], + "X-Content-Type-Options": [ "nosniff" ], + "X-Cache": [ "CONFIG_NOCACHE" ], + "X-MSEdge-Ref": [ "Ref A: 0AB3647A4C4B472E80B533D40C463AE1 Ref B: MAA201060514021 Ref C: 2025-07-10T03:37:43Z" ], + "Date": [ "Thu, 10 Jul 2025 03:37:43 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "443" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"value\":\"Administrative\",\"localizedValue\":\"Administrative\"},{\"value\":\"Security\",\"localizedValue\":\"Security\"},{\"value\":\"ServiceHealth\",\"localizedValue\":\"Service Health\"},{\"value\":\"Alert\",\"localizedValue\":\"Alert\"},{\"value\":\"Recommendation\",\"localizedValue\":\"Recommendation\"},{\"value\":\"Policy\",\"localizedValue\":\"Policy\"},{\"value\":\"Autoscale\",\"localizedValue\":\"Autoscale\"},{\"value\":\"ResourceHealth\",\"localizedValue\":\"Resource Health\"}]}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Tests.ps1 b/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Tests.ps1 index bf73c6594be9..996058ddad62 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Tests.ps1 +++ b/src/Monitor/DiagnosticSetting.Autorest/test/Get-AzEventCategory.Tests.ps1 @@ -15,7 +15,7 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzEventCategory')) } Describe 'Get-AzEventCategory' { - It 'List' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'List' { + { Get-AzEventCategory | Should -Not -BeNullOrEmpty} | Should -Not -Throw } } diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/Update-AzDiagnosticSetting.Tests.ps1 b/src/Monitor/DiagnosticSetting.Autorest/test/Update-AzDiagnosticSetting.Tests.ps1 new file mode 100644 index 000000000000..117ad7865c8d --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/test/Update-AzDiagnosticSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzDiagnosticSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzDiagnosticSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzDiagnosticSetting' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/Update-AzSubscriptionDiagnosticSetting.Tests.ps1 b/src/Monitor/DiagnosticSetting.Autorest/test/Update-AzSubscriptionDiagnosticSetting.Tests.ps1 new file mode 100644 index 000000000000..cd592ad1cfc5 --- /dev/null +++ b/src/Monitor/DiagnosticSetting.Autorest/test/Update-AzSubscriptionDiagnosticSetting.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzSubscriptionDiagnosticSetting')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzSubscriptionDiagnosticSetting.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzSubscriptionDiagnosticSetting' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/env.json b/src/Monitor/DiagnosticSetting.Autorest/test/env.json index bd13b9d1a8a3..718ec3151274 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/test/env.json +++ b/src/Monitor/DiagnosticSetting.Autorest/test/env.json @@ -1,8 +1,9 @@ { - "resourceGroupName": "diagnostic-setting-groupwi87al", - "vnetId": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/diagnostic-setting-groupwi87al/providers/Microsoft.Network/virtualNetworks/test-vnetijbg90", - "Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "diagnosticSettingName": "test-diagnostic-setting1eqp5r", - "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f", - "workspaceId": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/diagnostic-setting-groupwi87al/providers/microsoft.operationalinsights/workspaces/test-workspace8z9pt3" + "SubscriptionId": "0e745469-49f8-48c9-873b-24ca87143db1", + "diagnosticSettingName": "test-diagnostic-settingt1kbc6", + "workspaceId": "/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.OperationalInsights/workspaces/test-workspace87u3fy", + "vnetId": "/subscriptions/0e745469-49f8-48c9-873b-24ca87143db1/resourceGroups/diagnostic-setting-groupt9vaw5/providers/Microsoft.Network/virtualNetworks/test-vnetxhjrie", + "resourceGroupName": "diagnostic-setting-groupt9vaw5", + "Tenant": "213e87ed-8e08-4eb4-a63c-c073058f7b00", + "subscriptiondiagnosticSettingName": "test-diagnostic-setting4jksw1" } diff --git a/src/Monitor/DiagnosticSetting.Autorest/test/utils.ps1 b/src/Monitor/DiagnosticSetting.Autorest/test/utils.ps1 index b1da141b9cc2..945343cabf75 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/test/utils.ps1 +++ b/src/Monitor/DiagnosticSetting.Autorest/test/utils.ps1 @@ -64,6 +64,8 @@ function setupEnv() { $diagnosticSettingName = 'test-diagnostic-setting' + (RandomString -allChars $false -len 6) $null = $env.Add("diagnosticSettingName", $diagnosticSettingName) + $subscriptiondiagnosticSettingName = 'test-diagnostic-setting' + (RandomString -allChars $false -len 6) + $null = $env.Add("subscriptiondiagnosticSettingName", $subscriptiondiagnosticSettingName) $envFile = 'env.json' if ($TestMode -eq 'live') { @@ -73,5 +75,6 @@ function setupEnv() { } function cleanupEnv() { # Clean resources you create for testing + Remove-AzResourceGroup -Name $env.resourceGroupName } diff --git a/src/Monitor/Monitor.sln b/src/Monitor/Monitor.sln index 15b67159017c..0701abe71008 100644 --- a/src/Monitor/Monitor.sln +++ b/src/Monitor/Monitor.sln @@ -41,8 +41,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ActivityLogAlert", "..\. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Autoscale", "..\..\generated\Monitor\Autoscale.Autorest\Az.Autoscale.csproj", "{64D875E7-2E3B-40B2-945C-B8891BC6EF41}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DiagnosticSetting", "..\..\generated\Monitor\DiagnosticSetting.Autorest\Az.DiagnosticSetting.csproj", "{32336385-5322-43AC-B6D4-B99CDB5EDA5A}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.MonitorWorkspace", "..\..\generated\Monitor\MonitorWorkspace.Autorest\Az.MonitorWorkspace.csproj", "{803B981D-ED22-4DFF-90FA-C278DE8D228B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.PipelineGroup", "..\..\generated\Monitor\PipelineGroup.Autorest\Az.PipelineGroup.csproj", "{BBB1BE4E-4595-4589-AB2B-14BCFF7EB65C}" @@ -59,6 +57,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Metricdata.Autorest", "Metr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Metricdata", "..\..\generated\Monitor\Metricdata.Autorest\Az.Metricdata.csproj", "{0A51A656-9092-4C82-83B5-524516C8FED7}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DiagnosticSetting.Autorest", "DiagnosticSetting.Autorest", "{4644B825-05AB-0B45-5567-89C0D700A638}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DiagnosticSetting", "..\..\generated\Monitor\DiagnosticSetting.Autorest\Az.DiagnosticSetting.csproj", "{676E1E15-340A-4362-8144-5FFBB3B1B363}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -261,18 +263,6 @@ Global {64D875E7-2E3B-40B2-945C-B8891BC6EF41}.Release|x64.Build.0 = Release|Any CPU {64D875E7-2E3B-40B2-945C-B8891BC6EF41}.Release|x86.ActiveCfg = Release|Any CPU {64D875E7-2E3B-40B2-945C-B8891BC6EF41}.Release|x86.Build.0 = Release|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Debug|x64.ActiveCfg = Debug|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Debug|x64.Build.0 = Debug|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Debug|x86.ActiveCfg = Debug|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Debug|x86.Build.0 = Debug|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Release|Any CPU.Build.0 = Release|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Release|x64.ActiveCfg = Release|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Release|x64.Build.0 = Release|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Release|x86.ActiveCfg = Release|Any CPU - {32336385-5322-43AC-B6D4-B99CDB5EDA5A}.Release|x86.Build.0 = Release|Any CPU {803B981D-ED22-4DFF-90FA-C278DE8D228B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {803B981D-ED22-4DFF-90FA-C278DE8D228B}.Debug|Any CPU.Build.0 = Debug|Any CPU {803B981D-ED22-4DFF-90FA-C278DE8D228B}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -345,6 +335,18 @@ Global {0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x64.Build.0 = Release|Any CPU {0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x86.ActiveCfg = Release|Any CPU {0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x86.Build.0 = Release|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|Any CPU.Build.0 = Debug|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x64.ActiveCfg = Debug|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x64.Build.0 = Debug|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x86.ActiveCfg = Debug|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x86.Build.0 = Debug|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|Any CPU.ActiveCfg = Release|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|Any CPU.Build.0 = Release|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x64.ActiveCfg = Release|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x64.Build.0 = Release|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x86.ActiveCfg = Release|Any CPU + {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -365,5 +367,6 @@ Global {0636EEB2-FE81-4424-8CFC-CCEB25360A40} = {3F76A15C-B128-4A31-A887-05E303CF8D7F} {138B61C0-9D0E-44A1-9EA1-E8142303ECA5} = {35E5CBAF-5596-AC3C-3DBD-816FC74B54D0} {0A51A656-9092-4C82-83B5-524516C8FED7} = {97973F8C-3EE1-368A-3B71-C62280C2DC8C} + {676E1E15-340A-4362-8144-5FFBB3B1B363} = {4644B825-05AB-0B45-5567-89C0D700A638} EndGlobalSection EndGlobal diff --git a/src/Monitor/Monitor/Az.Monitor.psd1 b/src/Monitor/Monitor/Az.Monitor.psd1 index 0456fc90a331..afbf96bd84b7 100644 --- a/src/Monitor/Monitor/Az.Monitor.psd1 +++ b/src/Monitor/Monitor/Az.Monitor.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 7/2/2025 +# Generated on: 7/10/2025 # @{ @@ -158,8 +158,9 @@ FunctionsToExport = 'Enable-AzActionGroupReceiver', 'Get-AzActionGroup', 'Update-AzAutoscaleSetting', 'Update-AzDataCollectionEndpoint', 'Update-AzDataCollectionRule', 'Update-AzDataCollectionRuleAssociation', - 'Update-AzMonitorWorkspace', 'Update-AzPipelineGroup', - 'Update-AzScheduledQueryRule' + 'Update-AzDiagnosticSetting', 'Update-AzMonitorWorkspace', + 'Update-AzPipelineGroup', 'Update-AzScheduledQueryRule', + 'Update-AzSubscriptionDiagnosticSetting' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Add-AzLogProfile', 'Add-AzMetricAlertRule', diff --git a/src/Monitor/Monitor/help/Az.Monitor.md b/src/Monitor/Monitor/help/Az.Monitor.md index 0ef3a0d17020..6e53a68e9b1e 100644 --- a/src/Monitor/Monitor/help/Az.Monitor.md +++ b/src/Monitor/Monitor/help/Az.Monitor.md @@ -190,7 +190,7 @@ create an association. Create an in-memory object for DataFlow. ### [New-AzDiagnosticSetting](New-AzDiagnosticSetting.md) -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. ### [New-AzDiagnosticSettingLogSettingsObject](New-AzDiagnosticSettingLogSettingsObject.md) Create an in-memory object for LogSettings. @@ -268,7 +268,7 @@ Create an in-memory object for StorageBlobDestination. Create an in-memory object for StorageTableDestination. ### [New-AzSubscriptionDiagnosticSetting](New-AzSubscriptionDiagnosticSetting.md) -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. ### [New-AzSyslogDataSourceObject](New-AzSyslogDataSourceObject.md) Create an in-memory object for SyslogDataSource. @@ -351,6 +351,9 @@ Update a data collection rule. ### [Update-AzDataCollectionRuleAssociation](Update-AzDataCollectionRuleAssociation.md) update an association. +### [Update-AzDiagnosticSetting](Update-AzDiagnosticSetting.md) +Update diagnostic settings for the specified resource. + ### [Update-AzInsightsPrivateLinkScope](Update-AzInsightsPrivateLinkScope.md) Update for private link scope @@ -363,3 +366,6 @@ update a pipeline group instance ### [Update-AzScheduledQueryRule](Update-AzScheduledQueryRule.md) Update a scheduled query rule. +### [Update-AzSubscriptionDiagnosticSetting](Update-AzSubscriptionDiagnosticSetting.md) +Update subscription diagnostic settings for the specified resource. + diff --git a/src/Monitor/Monitor/help/Get-AzDiagnosticSetting.md b/src/Monitor/Monitor/help/Get-AzDiagnosticSetting.md index ea80bf531eba..5fe1f5972a0b 100644 --- a/src/Monitor/Monitor/help/Get-AzDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/Get-AzDiagnosticSetting.md @@ -71,7 +71,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity @@ -124,7 +123,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/Monitor/help/Get-AzDiagnosticSettingCategory.md b/src/Monitor/Monitor/help/Get-AzDiagnosticSettingCategory.md index f998378c23a5..40a2753ca6d6 100644 --- a/src/Monitor/Monitor/help/Get-AzDiagnosticSettingCategory.md +++ b/src/Monitor/Monitor/help/Get-AzDiagnosticSettingCategory.md @@ -63,7 +63,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity @@ -116,7 +115,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource ## NOTES diff --git a/src/Monitor/Monitor/help/Get-AzEventCategory.md b/src/Monitor/Monitor/help/Get-AzEventCategory.md index 5a197b3db7b9..e7663bc50556 100644 --- a/src/Monitor/Monitor/help/Get-AzEventCategory.md +++ b/src/Monitor/Monitor/help/Get-AzEventCategory.md @@ -68,7 +68,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString ## NOTES diff --git a/src/Monitor/Monitor/help/Get-AzSubscriptionDiagnosticSetting.md b/src/Monitor/Monitor/help/Get-AzSubscriptionDiagnosticSetting.md index 8f0c260f4acb..5ec342ea7d5c 100644 --- a/src/Monitor/Monitor/help/Get-AzSubscriptionDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/Get-AzSubscriptionDiagnosticSetting.md @@ -69,7 +69,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity @@ -122,7 +121,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md b/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md index 77fbe762f7b7..2169b5f032e7 100644 --- a/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/New-AzDiagnosticSetting.md @@ -8,10 +8,11 @@ schema: 2.0.0 # New-AzDiagnosticSetting ## SYNOPSIS -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. ## SYNTAX +### CreateExpanded (Default) ``` New-AzDiagnosticSetting -Name -ResourceId [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] [-LogAnalyticsDestinationType ] @@ -20,8 +21,20 @@ New-AzDiagnosticSetting -Name -ResourceId [-EventHubAuthorizat [-WhatIf] [-Confirm] [] ``` +### CreateViaJsonFilePath +``` +New-AzDiagnosticSetting -Name -ResourceId -JsonFilePath [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + +### CreateViaJsonString +``` +New-AzDiagnosticSetting -Name -ResourceId -JsonString [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + ## DESCRIPTION -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. ## EXAMPLES @@ -72,7 +85,7 @@ The resource Id for the event hub authorization rule. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -88,7 +101,7 @@ If none is specified, the default event hub will be selected. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -98,13 +111,42 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Log The list of logs settings. -To construct, see NOTES section for LOG properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] +Parameter Sets: CreateExpanded Aliases: Required: False @@ -121,7 +163,7 @@ Possible values are: Dedicated and null (null is default.) ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -136,7 +178,7 @@ The full ARM resource ID of the Marketplace resource to which you would like to ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -148,11 +190,10 @@ Accept wildcard characters: False ### -Metric The list of metric settings. -To construct, see NOTES section for METRIC properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] +Parameter Sets: CreateExpanded Aliases: Required: False @@ -198,7 +239,7 @@ This is here to maintain backwards compatibility. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -213,7 +254,7 @@ The resource ID of the storage account to which you would like to send Diagnosti ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -229,7 +270,7 @@ Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insi ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -277,7 +318,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/Monitor/help/New-AzDiagnosticSettingLogSettingsObject.md b/src/Monitor/Monitor/help/New-AzDiagnosticSettingLogSettingsObject.md index 3bc08f7822d2..5d84bedbeaf2 100644 --- a/src/Monitor/Monitor/help/New-AzDiagnosticSettingLogSettingsObject.md +++ b/src/Monitor/Monitor/help/New-AzDiagnosticSettingLogSettingsObject.md @@ -1,7 +1,7 @@ --- external help file: Az.DiagnosticSetting.psm1-help.xml Module Name: Az.Monitor -online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingLogSettingsObject +online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettinglogsettingsobject schema: 2.0.0 --- @@ -117,7 +117,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings ## NOTES diff --git a/src/Monitor/Monitor/help/New-AzDiagnosticSettingMetricSettingsObject.md b/src/Monitor/Monitor/help/New-AzDiagnosticSettingMetricSettingsObject.md index e79a25091068..1679f354a222 100644 --- a/src/Monitor/Monitor/help/New-AzDiagnosticSettingMetricSettingsObject.md +++ b/src/Monitor/Monitor/help/New-AzDiagnosticSettingMetricSettingsObject.md @@ -1,7 +1,7 @@ --- external help file: Az.DiagnosticSetting.psm1-help.xml Module Name: Az.Monitor -online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject +online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingmetricsettingsobject schema: 2.0.0 --- @@ -116,7 +116,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings ## NOTES diff --git a/src/Monitor/Monitor/help/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md b/src/Monitor/Monitor/help/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md index f71ef61981bc..c65a07e6c7f2 100644 --- a/src/Monitor/Monitor/help/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md +++ b/src/Monitor/Monitor/help/New-AzDiagnosticSettingSubscriptionLogSettingsObject.md @@ -1,7 +1,7 @@ --- external help file: Az.DiagnosticSetting.psm1-help.xml Module Name: Az.Monitor -online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingSubscriptionLogSettingsObject +online version: https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingsubscriptionlogsettingsobject schema: 2.0.0 --- @@ -83,7 +83,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings ## NOTES diff --git a/src/Monitor/Monitor/help/New-AzSubscriptionDiagnosticSetting.md b/src/Monitor/Monitor/help/New-AzSubscriptionDiagnosticSetting.md index 9f5396045ab5..e8fbc83fec23 100644 --- a/src/Monitor/Monitor/help/New-AzSubscriptionDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/New-AzSubscriptionDiagnosticSetting.md @@ -8,10 +8,11 @@ schema: 2.0.0 # New-AzSubscriptionDiagnosticSetting ## SYNOPSIS -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. ## SYNTAX +### CreateExpanded (Default) ``` New-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] @@ -20,8 +21,20 @@ New-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] [] ``` +### CreateViaJsonFilePath +``` +New-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] -JsonFilePath + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### CreateViaJsonString +``` +New-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] -JsonString + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + ## DESCRIPTION -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. ## EXAMPLES @@ -58,7 +71,7 @@ The resource Id for the event hub authorization rule. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -74,7 +87,7 @@ If none is specified, the default event hub will be selected. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -84,13 +97,42 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Log The list of logs settings. -To construct, see NOTES section for LOG properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] -Parameter Sets: (All) +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] +Parameter Sets: CreateExpanded Aliases: Required: False @@ -105,7 +147,7 @@ The full ARM resource ID of the Marketplace resource to which you would like to ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -136,7 +178,7 @@ This is here to maintain backwards compatibility. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -151,7 +193,7 @@ The resource ID of the storage account to which you would like to send Diagnosti ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -182,7 +224,7 @@ Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insi ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -230,7 +272,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource ## NOTES diff --git a/src/Monitor/Monitor/help/Remove-AzDiagnosticSetting.md b/src/Monitor/Monitor/help/Remove-AzDiagnosticSetting.md index 402e92b40403..dca06532308d 100644 --- a/src/Monitor/Monitor/help/Remove-AzDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/Remove-AzDiagnosticSetting.md @@ -57,7 +57,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity diff --git a/src/Monitor/Monitor/help/Remove-AzSubscriptionDiagnosticSetting.md b/src/Monitor/Monitor/help/Remove-AzSubscriptionDiagnosticSetting.md index 619ab23bba43..701edce4427e 100644 --- a/src/Monitor/Monitor/help/Remove-AzSubscriptionDiagnosticSetting.md +++ b/src/Monitor/Monitor/help/Remove-AzSubscriptionDiagnosticSetting.md @@ -56,7 +56,6 @@ Accept wildcard characters: False ### -InputObject Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity diff --git a/src/Monitor/Monitor/help/Update-AzDiagnosticSetting.md b/src/Monitor/Monitor/help/Update-AzDiagnosticSetting.md new file mode 100644 index 000000000000..606d942a5619 --- /dev/null +++ b/src/Monitor/Monitor/help/Update-AzDiagnosticSetting.md @@ -0,0 +1,294 @@ +--- +external help file: Az.DiagnosticSetting.psm1-help.xml +Module Name: Az.Monitor +online version: https://learn.microsoft.com/powershell/module/az.monitor/update-azdiagnosticsetting +schema: 2.0.0 +--- + +# Update-AzDiagnosticSetting + +## SYNOPSIS +Update diagnostic settings for the specified resource. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzDiagnosticSetting -Name -ResourceId [-EventHubAuthorizationRuleId ] + [-EventHubName ] [-Log ] [-LogAnalyticsDestinationType ] + [-MarketplacePartnerId ] [-Metric ] [-ServiceBusRuleId ] + [-StorageAccountId ] [-WorkspaceId ] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzDiagnosticSetting -InputObject [-EventHubAuthorizationRuleId ] + [-EventHubName ] [-Log ] [-LogAnalyticsDestinationType ] + [-MarketplacePartnerId ] [-Metric ] [-ServiceBusRuleId ] + [-StorageAccountId ] [-WorkspaceId ] [-DefaultProfile ] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Update diagnostic settings for the specified resource. + +## EXAMPLES + +### Example 1: Update diagnostic setting +```powershell +$newlog = New-AzDiagnosticSettingLogSettingsObject -Enabled $false -Category 'VMProtectionAlerts' +$newmetric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $false -Category 'AllMetrics' +Update-AzDiagnosticSetting -Name diagnosticSettingName -ResourceId 'vnetId' -Log $newlog -Metric $newmetric +``` + +These commands update diagnostic setting for resource with log analytics workspace as destination. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubAuthorizationRuleId +The resource Id for the event hub authorization rule. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubName +The name of the event hub. +If none is specified, the default event hub will be selected. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Log +The list of logs settings. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LogAnalyticsDestinationType +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.) + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MarketplacePartnerId +The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Metric +The list of metric settings. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the diagnostic setting. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +The identifier of the resource. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceBusRuleId +The service bus rule Id of the diagnostic setting. +This is here to maintain backwards compatibility. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +The resource ID of the storage account to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceId +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 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource + +## NOTES + +## RELATED LINKS diff --git a/src/Monitor/Monitor/help/Update-AzSubscriptionDiagnosticSetting.md b/src/Monitor/Monitor/help/Update-AzSubscriptionDiagnosticSetting.md new file mode 100644 index 000000000000..499f44cc3621 --- /dev/null +++ b/src/Monitor/Monitor/help/Update-AzSubscriptionDiagnosticSetting.md @@ -0,0 +1,261 @@ +--- +external help file: Az.DiagnosticSetting.psm1-help.xml +Module Name: Az.Monitor +online version: https://learn.microsoft.com/powershell/module/az.monitor/update-azsubscriptiondiagnosticsetting +schema: 2.0.0 +--- + +# Update-AzSubscriptionDiagnosticSetting + +## SYNOPSIS +Update subscription diagnostic settings for the specified resource. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzSubscriptionDiagnosticSetting -Name [-SubscriptionId ] + [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] + [-MarketplacePartnerId ] [-ServiceBusRuleId ] [-StorageAccountId ] + [-WorkspaceId ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzSubscriptionDiagnosticSetting -InputObject + [-EventHubAuthorizationRuleId ] [-EventHubName ] [-Log ] + [-MarketplacePartnerId ] [-ServiceBusRuleId ] [-StorageAccountId ] + [-WorkspaceId ] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Update subscription diagnostic settings for the specified resource. + +## EXAMPLES + +### Example 1: Update diagnostic setting for current subscription +```powershell +$log = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true +Update-AzSubscriptionDiagnosticSetting -Name settingname -WorkspaceId 'workspaceid' -Log $log +``` + +These command update diagnostic setting for current subscription. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubAuthorizationRuleId +The resource Id for the event hub authorization rule. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EventHubName +The name of the event hub. +If none is specified, the default event hub will be selected. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Log +The list of logs settings. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MarketplacePartnerId +The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the diagnostic setting. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ServiceBusRuleId +The service bus rule Id of the diagnostic setting. +This is here to maintain backwards compatibility. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -StorageAccountId +The resource ID of the storage account to which you would like to send Diagnostic Logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WorkspaceId +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 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + +## NOTES + +## RELATED LINKS From d9b030e207b8c13689cb390ee9e14a9eff917129 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:13:34 +0800 Subject: [PATCH 2/3] Create BreakingChangeIssues.csv --- .../Az.Monitor/BreakingChangeIssues.csv | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/StaticAnalysis/Exceptions/Az.Monitor/BreakingChangeIssues.csv diff --git a/tools/StaticAnalysis/Exceptions/Az.Monitor/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Monitor/BreakingChangeIssues.csv new file mode 100644 index 000000000000..fab756c56581 --- /dev/null +++ b/tools/StaticAnalysis/Exceptions/Az.Monitor/BreakingChangeIssues.csv @@ -0,0 +1,19 @@ +"Module","ClassName","Target","Severity","ProblemId","Description","Remediation" +"Az.Monitor","Get-AzDiagnosticSetting","Get-AzDiagnosticSetting","0","3000","The type of property 'Log' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings]'.","Change the type of property 'Log' back to 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings'." +"Az.Monitor","Get-AzDiagnosticSetting","Get-AzDiagnosticSetting","0","3000","The type of property 'Metric' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings]'.","Change the type of property 'Metric' back to 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings'." +"Az.Monitor","Get-AzDiagnosticSetting","Get-AzDiagnosticSetting","0","3000","The type of property 'SystemDataCreatedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataCreatedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","Get-AzDiagnosticSetting","Get-AzDiagnosticSetting","0","3000","The type of property 'SystemDataLastModifiedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataLastModifiedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","Get-AzDiagnosticSettingCategory","Get-AzDiagnosticSettingCategory","0","3000","The type of property 'CategoryType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType]' to 'System.String'.","Change the type of property 'CategoryType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType]'." +"Az.Monitor","Get-AzDiagnosticSettingCategory","Get-AzDiagnosticSettingCategory","0","3000","The type of property 'SystemDataCreatedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataCreatedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","Get-AzDiagnosticSettingCategory","Get-AzDiagnosticSettingCategory","0","3000","The type of property 'SystemDataLastModifiedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataLastModifiedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","Get-AzDiagnosticSettingCategory","Get-AzDiagnosticSettingCategory","0","3000","The type of property 'CategoryGroup' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource' has changed from 'System.String[]' to 'System.Collections.Generic.List`1[System.String]'.","Change the type of property 'CategoryGroup' back to 'System.String[]'." +"Az.Monitor","Get-AzSubscriptionDiagnosticSetting","Get-AzSubscriptionDiagnosticSetting","0","3000","The type of property 'Log' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings]'.","Change the type of property 'Log' back to 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings'." +"Az.Monitor","Get-AzSubscriptionDiagnosticSetting","Get-AzSubscriptionDiagnosticSetting","0","3000","The type of property 'SystemDataCreatedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataCreatedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","Get-AzSubscriptionDiagnosticSetting","Get-AzSubscriptionDiagnosticSetting","0","3000","The type of property 'SystemDataLastModifiedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataLastModifiedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","New-AzDiagnosticSetting","New-AzDiagnosticSetting","0","3000","The type of property 'Log' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings]'.","Change the type of property 'Log' back to 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings'." +"Az.Monitor","New-AzDiagnosticSetting","New-AzDiagnosticSetting","0","3000","The type of property 'Metric' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings]'.","Change the type of property 'Metric' back to 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings'." +"Az.Monitor","New-AzDiagnosticSetting","New-AzDiagnosticSetting","0","3000","The type of property 'SystemDataCreatedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataCreatedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","New-AzDiagnosticSetting","New-AzDiagnosticSetting","0","3000","The type of property 'SystemDataLastModifiedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataLastModifiedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","New-AzSubscriptionDiagnosticSetting","New-AzSubscriptionDiagnosticSetting","0","3000","The type of property 'Log' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings' to 'System.Collections.Generic.List`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings]'.","Change the type of property 'Log' back to 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings'." +"Az.Monitor","New-AzSubscriptionDiagnosticSetting","New-AzSubscriptionDiagnosticSetting","0","3000","The type of property 'SystemDataCreatedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataCreatedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." +"Az.Monitor","New-AzSubscriptionDiagnosticSetting","New-AzSubscriptionDiagnosticSetting","0","3000","The type of property 'SystemDataLastModifiedByType' of type 'Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource' has changed from 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]' to 'System.String'.","Change the type of property 'SystemDataLastModifiedByType' back to 'System.Nullable`1[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType]'." \ No newline at end of file From 715928ec412289b90369d9440a77f9744c08d217 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:59:17 +0800 Subject: [PATCH 3/3] update readme --- .../Properties/AssemblyInfo.cs | 2 -- .../DiagnosticSetting.Autorest/README.md | 2 +- .../generate-info.json | 2 +- src/Monitor/Monitor.sln | 28 +++++++++---------- src/Monitor/Monitor/Az.Monitor.psd1 | 2 +- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs b/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs index 585e2beb474f..ea1dd81fa6a1 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs +++ b/src/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs @@ -24,5 +24,3 @@ [assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] - - diff --git a/src/Monitor/DiagnosticSetting.Autorest/README.md b/src/Monitor/DiagnosticSetting.Autorest/README.md index 5b6c6bcd0fff..76f5c050136b 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/README.md +++ b/src/Monitor/DiagnosticSetting.Autorest/README.md @@ -48,7 +48,7 @@ directive: # 1. Remove the unexpanded parameter set # 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well - where: - variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ + variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$ remove: true # Remove Set cmdlet - where: diff --git a/src/Monitor/DiagnosticSetting.Autorest/generate-info.json b/src/Monitor/DiagnosticSetting.Autorest/generate-info.json index f6876df3bb44..b9cc139fe3dc 100644 --- a/src/Monitor/DiagnosticSetting.Autorest/generate-info.json +++ b/src/Monitor/DiagnosticSetting.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "509b73d6-6e79-4ae2-8d78-897c49667eff" + "generate_Id": "8e81e4bb-8582-47ce-9295-c9a7726e77cc" } diff --git a/src/Monitor/Monitor.sln b/src/Monitor/Monitor.sln index 0701abe71008..5e5d122f6e33 100644 --- a/src/Monitor/Monitor.sln +++ b/src/Monitor/Monitor.sln @@ -59,7 +59,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Metricdata", "..\..\gene EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DiagnosticSetting.Autorest", "DiagnosticSetting.Autorest", "{4644B825-05AB-0B45-5567-89C0D700A638}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DiagnosticSetting", "..\..\generated\Monitor\DiagnosticSetting.Autorest\Az.DiagnosticSetting.csproj", "{676E1E15-340A-4362-8144-5FFBB3B1B363}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.DiagnosticSetting", "..\..\generated\Monitor\DiagnosticSetting.Autorest\Az.DiagnosticSetting.csproj", "{94DA3C6F-C336-46A7-893B-D5824422A2AD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -335,18 +335,18 @@ Global {0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x64.Build.0 = Release|Any CPU {0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x86.ActiveCfg = Release|Any CPU {0A51A656-9092-4C82-83B5-524516C8FED7}.Release|x86.Build.0 = Release|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|Any CPU.Build.0 = Debug|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x64.ActiveCfg = Debug|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x64.Build.0 = Debug|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x86.ActiveCfg = Debug|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Debug|x86.Build.0 = Debug|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|Any CPU.ActiveCfg = Release|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|Any CPU.Build.0 = Release|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x64.ActiveCfg = Release|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x64.Build.0 = Release|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x86.ActiveCfg = Release|Any CPU - {676E1E15-340A-4362-8144-5FFBB3B1B363}.Release|x86.Build.0 = Release|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Debug|x64.ActiveCfg = Debug|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Debug|x64.Build.0 = Debug|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Debug|x86.ActiveCfg = Debug|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Debug|x86.Build.0 = Debug|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Release|Any CPU.Build.0 = Release|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Release|x64.ActiveCfg = Release|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Release|x64.Build.0 = Release|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Release|x86.ActiveCfg = Release|Any CPU + {94DA3C6F-C336-46A7-893B-D5824422A2AD}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -367,6 +367,6 @@ Global {0636EEB2-FE81-4424-8CFC-CCEB25360A40} = {3F76A15C-B128-4A31-A887-05E303CF8D7F} {138B61C0-9D0E-44A1-9EA1-E8142303ECA5} = {35E5CBAF-5596-AC3C-3DBD-816FC74B54D0} {0A51A656-9092-4C82-83B5-524516C8FED7} = {97973F8C-3EE1-368A-3B71-C62280C2DC8C} - {676E1E15-340A-4362-8144-5FFBB3B1B363} = {4644B825-05AB-0B45-5567-89C0D700A638} + {94DA3C6F-C336-46A7-893B-D5824422A2AD} = {4644B825-05AB-0B45-5567-89C0D700A638} EndGlobalSection EndGlobal diff --git a/src/Monitor/Monitor/Az.Monitor.psd1 b/src/Monitor/Monitor/Az.Monitor.psd1 index afbf96bd84b7..58c4d991fbbc 100644 --- a/src/Monitor/Monitor/Az.Monitor.psd1 +++ b/src/Monitor/Monitor/Az.Monitor.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 7/10/2025 +# Generated on: 7/15/2025 # @{