Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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,
Comment on lines +2 to +7
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license header comment contains doubled quotes (e.g., ""License"", ""AS IS"") which reduces readability and looks like an escaping artifact. Please update these comment strings to the standard Apache 2.0 header wording with normal quotes.

Suggested change
// 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,
// 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,

Copilot uses AI. Check for mistakes.
// 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
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor formatting: "Code Generator.Changes" is missing a space after the period in the comment. Please insert a space so the sentence reads correctly.

Suggested change
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// Code generated by Microsoft (R) AutoRest Code Generator. Changes may cause incorrect behavior and will be lost if the code

Copilot uses AI. Check for mistakes.
// 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 - SqlVirtualMachineManagementClient")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.4.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.4.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
28 changes: 19 additions & 9 deletions src/SqlVirtualMachine/SqlVirtualMachine.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,25 @@ try-require:
- $(repo)/specification/sqlvirtualmachine/resource-manager/readme.powershell.md

inlining-threshold: 100
resourcegroup-append: true
nested-object-to-string: true
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"
disable-transform-identity-type: true

directive:
- remove-operation:
- SqlVirtualMachineGroups_Update
- from: swagger-document
where: $.definitions.SqlVirtualMachineGroupProperties.properties.wsfcDomainProfile
transform: $['x-ms-mutability'] = ["read", "update", "create"]
- from: swagger-document
Comment on lines 42 to +48
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new AutoRest directives added here are missing explanatory comments. In this repo’s AutoRest README files, each directive is expected to have a brief comment explaining the purpose/intent (the “why”), especially for swagger-document transforms/removals, to keep future regeneration and maintenance understandable.

Copilot uses AI. Check for mistakes.
where: $.definitions.WsfcDomainProfile.properties..x-ms-mutability
transform: >-
return [
"read",
"update",
"create"
]
- from: swagger-document
where: $.definitions.SqlVirtualMachineProperties.properties.sqlVirtualMachineGroupResourceId
transform: $['x-ms-mutability'] = ["read", "update", "create"]
#1. [swagger] define password parameters as password type
- from: swagger-document
where: $.definitions..storageAccountPrimaryKey
Expand Down Expand Up @@ -134,8 +144,8 @@ directive:
hide: true
#8. [cmdlet] add model cmdlet
- model-cmdlet:
- AgReplica
- MultiSubnetIPConfiguration
- model-name: AgReplica
- model-name: MultiSubnetIPConfiguration
#9. [parameter] rename parameters
- where:
parameter-name: SqlVirtualMachineGroupName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Creates or updates an availability group listener.
{{ Add code here }}

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.IAvailabilityGroupListener
Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.IAvailabilityGroupListener
.Notes
COMPLEX PARAMETER PROPERTIES

Expand Down Expand Up @@ -54,7 +54,7 @@ MULTISUBNETIPCONFIGURATION <IMultiSubnetIPConfiguration[]>: List of multi subnet
https://learn.microsoft.com/powershell/module/az.sqlvirtualmachine/new-azavailabilitygrouplistener
#>
function New-AzAvailabilityGroupListener {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.IAvailabilityGroupListener])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.IAvailabilityGroupListener])]
[CmdletBinding(DefaultParameterSetName = 'CreateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory)]
Expand Down Expand Up @@ -88,7 +88,7 @@ function New-AzAvailabilityGroupListener {
[Parameter()]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.IAgReplica[]]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.IAgReplica[]]
# Replica configurations.
# To construct, see NOTES section for AVAILABILITYGROUPCONFIGURATIONREPLICA properties and create a hash table.
${AvailabilityGroupConfigurationReplica},
Expand Down Expand Up @@ -144,7 +144,7 @@ function New-AzAvailabilityGroupListener {
[Parameter()]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.IMultiSubnetIPConfiguration[]]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.IMultiSubnetIPConfiguration[]]
# List of multi subnet IP configurations for an AG listener.
# To construct, see NOTES section for MULTISUBNETIPCONFIGURATION properties and create a hash table.
${MultiSubnetIPConfiguration},
Expand Down Expand Up @@ -226,7 +226,7 @@ function New-AzAvailabilityGroupListener {
$hasSqlVirtualMachineId = $PSBoundParameters.Remove('SqlVirtualMachineId')

if ($hasIpAddress -or $hasLoadBalancerResourceId -or $hasSubnetId -or $hasProbePort -or $hasPublicIpAddressResourceId -or $hasSqlVirtualMachineId) {
$LoadBalancerConfiguration = [Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.LoadBalancerConfiguration]@{}
$LoadBalancerConfiguration = [Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.LoadBalancerConfiguration]@{}
if ($hasIpAddress) {
$LoadBalancerConfiguration.PrivateIPAddressIpaddress = $IpAddress
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ If you are updating an existing SQL virtual machine and a parameter such as -Tag
{{ Add code here }}

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.ISqlVirtualMachine
Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.ISqlVirtualMachine
.Link
https://learn.microsoft.com/powershell/module/az.sqlvirtualmachine/new-azsqlvm
#>
function New-AzSqlVM {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.ISqlVirtualMachine])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.ISqlVirtualMachine])]
[CmdletBinding(DefaultParameterSetName = 'CreateExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory)]
Expand Down Expand Up @@ -81,9 +81,9 @@ function New-AzSqlVM {
${AssessmentSettingRunImmediately},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.BackupScheduleType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Manual","Automated")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.BackupScheduleType]
[System.String]
# Backup schedule type.
${AutoBackupSettingBackupScheduleType},

Expand All @@ -95,9 +95,9 @@ function New-AzSqlVM {

[Parameter()]
[AllowEmptyCollection()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.AutoBackupDaysOfWeek])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.AutoBackupDaysOfWeek[]]
[System.String[]]
# Days of the week for the backups when FullBackupFrequency is set to Weekly.
${AutoBackupSettingDaysOfWeek},

Expand All @@ -114,9 +114,9 @@ function New-AzSqlVM {
${AutoBackupSettingEnableEncryption},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.FullBackupFrequencyType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Daily","Weekly")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.FullBackupFrequencyType]
[System.String]
# Frequency of full backups.
# In both cases, full backups begin during the next scheduled time window.
${AutoBackupSettingFullBackupFrequency},
Expand Down Expand Up @@ -173,9 +173,9 @@ function New-AzSqlVM {
${AutoBackupSettingStorageContainerName},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.DayOfWeek])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Everyday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.DayOfWeek]
[System.String]
# Day of week to apply the patch on.
${AutoPatchingSettingDayOfWeek},

Expand Down Expand Up @@ -212,9 +212,9 @@ function New-AzSqlVM {
${EnableAutomaticUpgrade},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.IdentityType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("None","SystemAssigned","UserAssigned")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.IdentityType]
[System.String]
# The identity type.
# Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.
${IdentityType},
Expand Down Expand Up @@ -250,16 +250,16 @@ function New-AzSqlVM {
${KeyVaultCredentialSettingServicePrincipalSecret},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.LeastPrivilegeMode])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Enabled","NotSet")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.LeastPrivilegeMode]
[System.String]
# SQL IaaS Agent least privilege mode.
${LeastPrivilegeMode},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlServerLicenseType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("PAYG","AHUB","DR")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlServerLicenseType]
[System.String]
# SQL Server license type.
${LicenseType},

Expand All @@ -271,9 +271,9 @@ function New-AzSqlVM {
${Offer},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.AssessmentDayOfWeek])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.AssessmentDayOfWeek]
[System.String]
# Day of the week to run assessment.
${ScheduleDayOfWeek},

Expand Down Expand Up @@ -307,16 +307,16 @@ function New-AzSqlVM {
${ScheduleWeeklyInterval},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlImageSku])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Developer","Express","Standard","Enterprise","Web")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlImageSku]
[System.String]
# SQL Server edition type.
${Sku},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.ConnectivityType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("LOCAL","PRIVATE","PUBLIC")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.ConnectivityType]
[System.String]
# SQL Server connectivity option.
${SqlConnectivityUpdateSettingConnectivityType},

Expand Down Expand Up @@ -407,16 +407,16 @@ function New-AzSqlVM {
${SqlLogSettingLun},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlManagementMode])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("Full","LightWeight","NoAgent")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlManagementMode]
[System.String]
# SQL Server Management type.
${SqlManagementType},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.DiskConfigurationType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("NEW","EXTEND","ADD")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.DiskConfigurationType]
[System.String]
# Disk configuration to apply to SQL Server.
${SqlStorageUpdateSettingDiskConfigurationType},

Expand Down Expand Up @@ -494,16 +494,16 @@ function New-AzSqlVM {
${SqlVirtualMachineGroupResourceId},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlWorkloadType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("GENERAL","OLTP","DW")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.SqlWorkloadType]
[System.String]
# SQL Server workload type.
${SqlWorkloadTypeUpdateSettingSqlWorkloadType},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.DiskConfigurationType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("NEW","EXTEND","ADD")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.DiskConfigurationType]
[System.String]
# Disk configuration to apply to SQL Server.
${StorageConfigurationSettingDiskConfigurationType},

Expand All @@ -514,15 +514,15 @@ function New-AzSqlVM {
${StorageConfigurationSettingSqlSystemDbOnDataDisk},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.StorageWorkloadType])]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.PSArgumentCompleterAttribute("GENERAL","OLTP","DW")]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Support.StorageWorkloadType]
[System.String]
# Storage workload type.
${StorageConfigurationSettingStorageWorkloadType},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.Api20220801Preview.ITrackedResourceTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Runtime.Info(PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.SqlVirtualMachine.Models.ITrackedResourceTags]))]
[System.Collections.Hashtable]
# Resource tags.
${Tag},
Expand Down
Loading
Loading