From f6e4f52c499fc62466063732ab869a60edefba9d Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 15 Jun 2026 00:58:48 +0800 Subject: [PATCH 01/19] Update client settings of Sql --- .../Microsoft.Sql/SQL/Advisor.tsp | 6 +- .../Microsoft.Sql/SQL/DatabaseColumn.tsp | 6 +- .../Microsoft.Sql/SQL/DatabaseSchema.tsp | 6 +- ...eSqlVulnerabilityAssessmentBaselineSet.tsp | 6 +- ...SqlVulnerabilityAssessmentRuleBaseline.tsp | 6 +- .../Microsoft.Sql/SQL/DatabaseTable.tsp | 6 +- .../SQL/DatabaseVulnerabilityAssessment.tsp | 6 +- ...aseVulnerabilityAssessmentRuleBaseline.tsp | 6 +- .../Microsoft.Sql/SQL/JobExecution.tsp | 9 +- .../Microsoft.Sql/SQL/JobStep.tsp | 6 +- .../SQL/LongTermRetentionBackup.tsp | 6 +- .../ManagedBackupShortTermRetentionPolicy.tsp | 6 +- ...ManagedInstanceLongTermRetentionBackup.tsp | 6 +- .../Microsoft.Sql/SQL/SensitivityLabel.tsp | 6 +- .../SQL/ServerTrustCertificate.tsp | 48 +- .../SQL/SqlVulnerabilityAssessment.tsp | 6 +- .../SqlVulnerabilityAssessmentScanRecord.tsp | 6 +- .../SqlVulnerabilityAssessmentScanResults.tsp | 6 +- .../SQL/VulnerabilityAssessmentScanRecord.tsp | 6 +- .../Microsoft.Sql/SQL/client.tsp | 812 ++++++++++++++++++ .../Microsoft.Sql/SQL/tspconfig.yaml | 5 + 21 files changed, 935 insertions(+), 41 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/Advisor.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/Advisor.tsp index 39cb74f49b72..113b9d8f13b9 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/Advisor.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/Advisor.tsp @@ -63,7 +63,8 @@ alias AdvisorOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("advisors") @key advisorName: string; - } + }, + ResourceName = "SqlDatabaseAdvisor" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -118,7 +119,8 @@ alias ServerAdvisorOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("advisors") @key advisorName: string; - } + }, + ResourceName = "SqlServerAdvisor" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseColumn.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseColumn.tsp index d2d787043d02..1038efc14e6e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseColumn.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseColumn.tsp @@ -62,7 +62,8 @@ alias DatabaseColumnOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("columns") @key columnName: string; - } + }, + ResourceName = "SqlDatabaseColumn" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -125,7 +126,8 @@ alias ManagedDatabaseColumnOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("columns") @key columnName: string; - } + }, + ResourceName = "ManagedDatabaseColumn" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSchema.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSchema.tsp index 2074e1fb090d..5ba847936c08 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSchema.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSchema.tsp @@ -50,7 +50,8 @@ alias DatabaseSchemaOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("schemas") @key schemaName: string; - } + }, + ResourceName = "SqlDatabaseSchema" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -101,7 +102,8 @@ alias ManagedDatabaseSchemaOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("schemas") @key schemaName: string; - } + }, + ResourceName = "ManagedDatabaseSchema" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentBaselineSet.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentBaselineSet.tsp index 49b0a0071487..5a2467d668e7 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentBaselineSet.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentBaselineSet.tsp @@ -57,7 +57,8 @@ alias DatabaseSqlVulnerabilityAssessmentBaselineSetOps = Azure.ResourceManager.L @segment("baselines") @key baselineName: BaselineName; - } + }, + ResourceName = "SqlDatabaseSqlVulnerabilityAssessmentBaseline" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -114,7 +115,8 @@ alias SqlVulnerabilityAssessmentBaselineOps = Azure.ResourceManager.Legacy.Legac @segment("baselines") @key baselineName: BaselineName; - } + }, + ResourceName = "SqlServerSqlVulnerabilityAssessmentBaseline" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentRuleBaseline.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentRuleBaseline.tsp index 79f6dca19cbd..1efaf3c0f2c6 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentRuleBaseline.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseSqlVulnerabilityAssessmentRuleBaseline.tsp @@ -62,7 +62,8 @@ alias DatabaseSqlVulnerabilityAssessmentRuleBaselineOps = Azure.ResourceManager. @segment("rules") @key ruleId: string; - } + }, + ResourceName = "SqlDatabaseSqlVulnerabilityAssessmentBaselineRule" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -127,7 +128,8 @@ alias SqlVulnerabilityAssessmentRuleBaselineOps = Azure.ResourceManager.Legacy.L @segment("rules") @key ruleId: string; - } + }, + ResourceName = "SqlServerSqlVulnerabilityAssessmentBaselineRule" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseTable.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseTable.tsp index 3d6c653949ea..72b689bdc111 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseTable.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseTable.tsp @@ -56,7 +56,8 @@ alias DatabaseTableOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("tables") @key tableName: string; - } + }, + ResourceName = "SqlDatabaseTable" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -113,7 +114,8 @@ alias ManagedDatabaseTableOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("tables") @key tableName: string; - } + }, + ResourceName = "ManagedDatabaseTable" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessment.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessment.tsp index c80bb15b6486..6392ed641053 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessment.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessment.tsp @@ -51,7 +51,8 @@ alias DatabaseVulnerabilityAssessmentOps = Azure.ResourceManager.Legacy.LegacyOp @segment("vulnerabilityAssessments") @key vulnerabilityAssessmentName: VulnerabilityAssessmentName; - } + }, + ResourceName = "SqlDatabaseVulnerabilityAssessment" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -107,7 +108,8 @@ alias ManagedDatabaseVulnerabilityAssessmentOps = Azure.ResourceManager.Legacy.L @segment("vulnerabilityAssessments") @key vulnerabilityAssessmentName: VulnerabilityAssessmentName; - } + }, + ResourceName = "ManagedDatabaseVulnerabilityAssessment" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessmentRuleBaseline.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessmentRuleBaseline.tsp index 5513d8f9686a..219e27c2457e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessmentRuleBaseline.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DatabaseVulnerabilityAssessmentRuleBaseline.tsp @@ -62,7 +62,8 @@ alias DatabaseVulnerabilityAssessmentRuleBaselineOps = Azure.ResourceManager.Leg @segment("baselines") @key baselineName: VulnerabilityAssessmentPolicyBaselineName; - } + }, + ResourceName = "SqlDatabaseVulnerabilityAssessmentRuleBaseline" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -131,7 +132,8 @@ alias ManagedDatabaseVulnerabilityAssessmentRuleBaselineOps = Azure.ResourceMana @segment("baselines") @key baselineName: VulnerabilityAssessmentPolicyBaselineName; - } + }, + ResourceName = "ManagedDatabaseVulnerabilityAssessmentRuleBaseline" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobExecution.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobExecution.tsp index 5fd1b2f0d999..e625bf693f5f 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobExecution.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobExecution.tsp @@ -56,7 +56,8 @@ alias JobExecutionOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("executions") @key jobExecutionId: Azure.Core.uuid; - } + }, + ResourceName = "SqlServerJobExecution" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -182,7 +183,8 @@ alias JobStepExecutionOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("steps") @key stepName: string; - } + }, + ResourceName = "SqlServerJobExecutionStep" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -289,7 +291,8 @@ alias JobTargetExecutionOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("targets") @key targetId: Azure.Core.uuid; - } + }, + ResourceName = "SqlServerJobExecutionStepTarget" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp index acdf2a901d33..4df7069bcabf 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp @@ -57,7 +57,8 @@ alias JobStepOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("steps") @key stepName: string; - } + }, + ResourceName = "SqlServerJobStep" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -125,7 +126,8 @@ alias JobStepOperationGroupOps = Azure.ResourceManager.Legacy.LegacyOperations< @segment("steps") @key stepName: string; - } + }, + ResourceName = "SqlServerJobVersionStep" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp index 34f9ca4a588b..00c9e00bcd14 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp @@ -61,7 +61,8 @@ alias LongTermRetentionBackupOps = Azure.ResourceManager.Legacy.LegacyOperations @segment("longTermRetentionBackups") @key backupName: string; - } + }, + ResourceName = "SubscriptionLongTermRetentionBackup" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -218,7 +219,8 @@ alias LongTermRetentionBackupOperationGroupOps = Azure.ResourceManager.Legacy.Le @segment("longTermRetentionBackups") @key backupName: string; - } + }, + ResourceName = "ResourceGroupLongTermRetentionBackup" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedBackupShortTermRetentionPolicy.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedBackupShortTermRetentionPolicy.tsp index 85616ee044f4..9e1ce4839353 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedBackupShortTermRetentionPolicy.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedBackupShortTermRetentionPolicy.tsp @@ -51,7 +51,8 @@ alias ManagedBackupShortTermRetentionPolicyOps = Azure.ResourceManager.Legacy.Le @segment("backupShortTermRetentionPolicies") @key policyName: ManagedShortTermRetentionPolicyName; - } + }, + ResourceName = "ManagedBackupShortTermRetentionPolicy" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -117,7 +118,8 @@ alias ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicyOps = Azure. @segment("backupShortTermRetentionPolicies") @key policyName: ManagedShortTermRetentionPolicyName; - } + }, + ResourceName = "ManagedRestorableDroppedDbBackupShortTermRetentionPolicy" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp index c374e9c9e586..208a97544330 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp @@ -63,7 +63,8 @@ alias ManagedInstanceLongTermRetentionBackupOps = Azure.ResourceManager.Legacy.L @segment("longTermRetentionManagedInstanceBackups") @key backupName: string; - } + }, + ResourceName = "SubscriptionLongTermRetentionManagedInstanceBackup" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -140,7 +141,8 @@ alias LongTermRetentionManagedInstanceBackupOps = Azure.ResourceManager.Legacy.L @segment("longTermRetentionManagedInstanceBackups") @key backupName: string; - } + }, + ResourceName = "ResourceGroupLongTermRetentionManagedInstanceBackup" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SensitivityLabel.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SensitivityLabel.tsp index 6b8e18b9480f..0ef79567ab45 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SensitivityLabel.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SensitivityLabel.tsp @@ -69,7 +69,8 @@ alias SensitivityLabelOps = Azure.ResourceManager.Legacy.LegacyOperations< @key columnName: string; }, - {} + {}, + ResourceName = "ManagedDatabaseSensitivityLabel" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -172,7 +173,8 @@ alias SensitivityLabelOperationGroupOps = Azure.ResourceManager.Legacy.LegacyOpe @key columnName: string; }, - {} + {}, + ResourceName = "SqlDatabaseSensitivityLabel" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustCertificate.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustCertificate.tsp index 9ca78a6695df..1f2fa515df75 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustCertificate.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustCertificate.tsp @@ -27,6 +27,23 @@ model ServerTrustCertificate >; } +alias ServerTrustCertificatesOps = Azure.ResourceManager.Legacy.LegacyOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + ...ResourceGroupParameter; + ...Azure.ResourceManager.Legacy.Provider; + + /** The name of the managed instance. */ + @path + @segment("managedInstances") + @key + managedInstanceName: string; + }, + {}, + ResourceName = "ManagedInstanceServerTrustCertificate" +>; + #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @armResourceOperations @Azure.ResourceManager.Legacy.feature(Features.ServerTrustCertificates) @@ -34,14 +51,30 @@ interface ServerTrustCertificates { /** * Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. */ - get is ArmResourceRead; + get is ServerTrustCertificatesOps.Read< + ServerTrustCertificate, + Parameters = { + /** Name of of the certificate to get. */ + @path + @segment("serverTrustCertificates") + @key + certificateName: string; + } + >; /** * Uploads a server trust certificate from SQL Server to SQL Managed Instance. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - createOrUpdate is ArmResourceCreateOrReplaceAsync< + createOrUpdate is ServerTrustCertificatesOps.CreateOrUpdateSync< ServerTrustCertificate, + Parameters = { + /** Name of of the certificate to get. */ + @path + @segment("serverTrustCertificates") + @key + certificateName: string; + }, Response = | ArmResourceUpdatedResponse | ArmResourceCreatedResponse< @@ -56,8 +89,15 @@ interface ServerTrustCertificates { * Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. */ #suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" - delete is ArmResourceDeleteWithoutOkAsync< + delete is ServerTrustCertificatesOps.DeleteSync< ServerTrustCertificate, + Parameters = { + /** Name of of the certificate to get. */ + @path + @segment("serverTrustCertificates") + @key + certificateName: string; + }, Response = | ArmDeletedResponse | ArmDeleteAcceptedLroResponse @@ -67,7 +107,7 @@ interface ServerTrustCertificates { /** * Gets a list of the server trust certificates used to secure communication between SQL Server and the specified SQL Managed Instance */ - listByInstance is ArmResourceListByParent< + listByInstance is ServerTrustCertificatesOps.List< ServerTrustCertificate, Response = ServerTrustCertificatesListResult >; diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp index 3009609097d7..4b60a12111e4 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp @@ -45,7 +45,8 @@ alias SqlVulnerabilityAssessmentOps = Azure.ResourceManager.Legacy.LegacyOperati @key databaseName: string; }, - {} + {}, + ResourceName = "SqlDatabaseSqlVulnerabilityAssessment" >; @armResourceOperations(#{ omitTags: true }) @@ -115,7 +116,8 @@ alias SqlVulnerabilityAssessmentsSettingOps = Azure.ResourceManager.Legacy.Legac @key serverName: string; }, - {} + {}, + ResourceName = "SqlServerSqlVulnerabilityAssessment" >; @armResourceOperations(#{ omitTags: true }) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanRecord.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanRecord.tsp index 7b969299f9ce..964d3c5d8a08 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanRecord.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanRecord.tsp @@ -56,7 +56,8 @@ alias SqlVulnerabilityAssessmentScanRecordOps = Azure.ResourceManager.Legacy.Leg @segment("scans") @key scanId: string; - } + }, + ResourceName = "SqlDatabaseSqlVulnerabilityAssessmentScan" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -106,7 +107,8 @@ alias SqlVulnerabilityAssessmentScanOps = Azure.ResourceManager.Legacy.LegacyOpe @segment("scans") @key scanId: string; - } + }, + ResourceName = "SqlServerSqlVulnerabilityAssessmentScan" >; model SqlVulnerabilityAssessmentScanRecordListResult is ResourceListResult; diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanResults.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanResults.tsp index 51a62cc58b8a..9100e2b723cf 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanResults.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessmentScanResults.tsp @@ -60,7 +60,8 @@ alias DatabaseSqlVulnerabilityAssessmentScanResultOps = Azure.ResourceManager.Le @segment("scanResults") @key scanResultId: string; - } + }, + ResourceName = "SqlDatabaseSqlVulnerabilityAssessmentScanResult" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -113,7 +114,8 @@ alias SqlVulnerabilityAssessmentScanResultOps = Azure.ResourceManager.Legacy.Leg @segment("scanResults") @key scanResultId: string; - } + }, + ResourceName = "SqlServerSqlVulnerabilityAssessmentScanResult" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/VulnerabilityAssessmentScanRecord.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/VulnerabilityAssessmentScanRecord.tsp index 9a757971aa1d..ac98d5f42e14 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/VulnerabilityAssessmentScanRecord.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/VulnerabilityAssessmentScanRecord.tsp @@ -56,7 +56,8 @@ alias VulnerabilityAssessmentScanRecordOps = Azure.ResourceManager.Legacy.Legacy @segment("scans") @key scanId: string; - } + }, + ResourceName = "SqlDatabaseVulnerabilityAssessmentScan" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -131,7 +132,8 @@ alias ManagedDatabaseVulnerabilityAssessmentScanOps = Azure.ResourceManager.Lega @segment("scans") @key scanId: string; - } + }, + ResourceName = "ManagedDatabaseVulnerabilityAssessmentScan" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index b3ace7fec974..f594e9a87d92 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -2,6 +2,8 @@ import "@azure-tools/typespec-client-generator-core"; import "./main.tsp"; using Azure.ClientGenerator.Core; +using Azure.ClientGenerator.Core.Legacy; +using Azure.Core; using Microsoft.Sql; // TODO: remove this when breaking change is allowed @@ -116,3 +118,813 @@ using Microsoft.Sql; "VulnerabilityAssessmentScanRecordForSQLListResult ", "go" ); + +// C# resource and type mappings migrated from autorest.md.bak prepend-rp-prefix +@@clientName(DatabaseAutomaticTuning, "SqlDatabaseAutomaticTuning", "csharp"); +@@clientName( + DatabaseBlobAuditingPolicy, + "SqlDatabaseBlobAuditingPolicy", + "csharp" +); +@@clientName( + DatabaseSecurityAlertPolicy, + "SqlDatabaseSecurityAlertPolicy", + "csharp" +); +@@clientName(TimeZone, "SqlTimeZone", "csharp"); +@@clientName(Server, "SqlServer", "csharp"); +@@clientName(ServerCreateMode, "SqlServerCreateMode", "csharp"); +@@clientName(Database, "SqlDatabase", "csharp"); +@@clientName(DayOfWeek, "SqlDayOfWeek", "csharp"); +@@clientName(MetricType, "SqlMetricType", "csharp"); +@@clientName(ServerAutomaticTuning, "SqlServerAutomaticTuning", "csharp"); +@@clientName( + ServerAzureADAdministrator, + "SqlServerAzureADAdministrator", + "csharp" +); +@@clientName( + ServerAzureADOnlyAuthentication, + "SqlServerAzureADOnlyAuthentication", + "csharp" +); +@@clientName(ServerBlobAuditingPolicy, "SqlServerBlobAuditingPolicy", "csharp"); +@@clientName(ServerConnectionPolicy, "SqlServerConnectionPolicy", "csharp"); +@@clientName(ServerDnsAlias, "SqlServerDnsAlias", "csharp"); +@@clientName(ServerKey, "SqlServerKey", "csharp"); +@@clientName( + ServerSecurityAlertPolicy, + "SqlServerSecurityAlertPolicy", + "csharp" +); +@@clientName(ServerTrustGroup, "SqlServerTrustGroup", "csharp"); +@@clientName( + ServerVulnerabilityAssessment, + "SqlServerVulnerabilityAssessment", + "csharp" +); +@@clientName(ServicePrincipal, "SqlServicePrincipal", "csharp"); +@@clientName(ServicePrincipalType, "SqlServicePrincipalType", "csharp"); +@@clientName(FirewallRule, "SqlFirewallRule", "csharp"); +@@clientName(AdministratorName, "SqlAdministratorName", "csharp"); +@@clientName(AdministratorType, "SqlAdministratorType", "csharp"); +@@clientName(CapabilityGroup, "SqlCapabilityGroup", "csharp"); +@@clientName(CapabilityStatus, "SqlCapabilityStatus", "csharp"); +@@clientName(LocationCapabilities, "SqlLocationCapabilities", "csharp"); +@@clientName(ColumnDataType, "SqlColumnDataType", "csharp"); +@@clientName(DatabaseState, "SqlDatabaseState", "csharp"); +@@clientName(DatabaseStatus, "SqlDatabaseStatus", "csharp"); +@@clientName(ResourceMoveDefinition, "SqlResourceMoveDefinition", "csharp"); +@@clientName(ServerUsage, "SqlServerUsage", "csharp"); +@@clientName(AdvisorStatus, "SqlAdvisorStatus", "csharp"); +@@clientName(Advisor, "SqlAdvisor", "csharp"); + +// C# model and enum mappings migrated from autorest.md.bak rename-mapping +@@clientName( + CopyLongTermRetentionBackupParameters, + "CopyLongTermRetentionBackupContent", + "csharp" +); +@@clientName( + UpdateLongTermRetentionBackupParameters, + "UpdateLongTermRetentionBackupContent", + "csharp" +); +@@clientName(Name, "InstancePoolUsageName", "csharp"); +@@Azure.ClientGenerator.Core.clientName( + global.Microsoft.Sql.Usage, + "InstancePoolUsage", + "csharp" +); +@@Azure.ClientGenerator.Core.clientName( + global.Microsoft.Sql.Usage.type, + "ResourceType", + "csharp" +); +@@clientName(UsageListResult, "InstancePoolUsageListResult", "csharp"); +@@clientName(SampleName, "SampleSchemaName", "csharp"); +@@clientName(Job, "SqlServerJob", "csharp"); +@@clientName(JobAgent, "SqlServerJobAgent", "csharp"); +@@clientName(JobVersion, "SqlServerJobVersion", "csharp"); +@@clientName(JobCredential, "SqlServerJobCredential", "csharp"); +@@clientName(JobTargetGroup, "SqlServerJobTargetGroup", "csharp"); +@@clientName(JobSchedule, "SqlServerJobSchedule", "csharp"); +@@clientName(JobScheduleType, "SqlServerJobScheduleType", "csharp"); +@@clientName(JobExecution, "SqlServerJobExecution", "csharp"); +@@clientName(JobStep, "SqlServerJobStep", "csharp"); +@@clientName(LedgerDigestUploads, "LedgerDigestUpload", "csharp"); +@@clientName( + ServerDevOpsAuditingSettings, + "SqlServerDevOpsAuditingSetting", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsResult, + "ManagedDatabaseRestoreDetail", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsBackupSetProperties, + "ManagedDatabaseRestoreDetailBackupSetProperties", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsUnrestorableFileProperties, + "ManagedDatabaseRestoreDetailUnrestorableFileProperties", + "csharp" +); +@@clientName(CheckNameAvailabilityReason, "SqlNameUnavailableReason", "csharp"); +@@clientName( + CheckNameAvailabilityResourceType, + "SqlNameAvailabilityResourceType", + "csharp" +); +@@clientName( + CheckNameAvailabilityRequest, + "SqlNameAvailabilityContent", + "csharp" +); +@@clientName(CreateMode, "SqlDatabaseCreateMode", "csharp"); +@@clientName(OperationMode, "DatabaseExtensionOperationMode", "csharp"); +@@clientName(ProvisioningState, "JobExecutionProvisioningState", "csharp"); +@@clientName(PrincipalType, "SqlServerPrincipalType", "csharp"); +@@clientName(IsRetryable, "ActionRetryableState", "csharp"); +@@clientName(ExportDatabaseDefinition, "DatabaseExportDefinition", "csharp"); +@@clientName(ImportNewDatabaseDefinition, "DatabaseImportDefinition", "csharp"); +@@clientName(PartnerInfo, "PartnerServerInfo", "csharp"); +@@clientName(ReplicationState, "ReplicationLinkState", "csharp"); +@@clientName(ServerInfo, "ServerTrustGroupServerInfo", "csharp"); +@@clientName(DatabaseExtensions, "SqlDatabaseExtension", "csharp"); +@@clientName(DatabaseOperation, "DatabaseOperationData", "csharp"); +@@clientName(ServerOperation, "ServerOperationData", "csharp"); +@@clientName(ElasticPoolOperation, "ElasticPoolOperationData", "csharp"); +@@clientName( + UpdateVirtualClusterDnsServersOperation, + "ManagedInstanceUpdateDnsServersOperationData", + "csharp" +); +@@clientName(VirtualNetworkRule, "SqlServerVirtualNetworkRule", "csharp"); +@@clientName( + VirtualNetworkRuleState, + "SqlServerVirtualNetworkRuleState", + "csharp" +); +@@clientName( + PrivateEndpointConnectionProperties, + "ServerPrivateEndpointConnectionProperties", + "csharp" +); +@@clientName( + PrivateEndpointProvisioningState, + "SqlPrivateEndpointProvisioningState", + "csharp" +); +@@clientName( + PrivateLinkServiceConnectionStateActionsRequire, + "SqlPrivateLinkServiceConnectionActionsRequired", + "csharp" +); +@@clientName( + PrivateLinkServiceConnectionStateStatus, + "SqlPrivateLinkServiceConnectionStatus", + "csharp" +); +@@clientName(SecurityAlertPolicyName, "SqlSecurityAlertPolicyName", "csharp"); +@@clientName(ServerKeyType, "SqlServerKeyType", "csharp"); +@@clientName( + ServerPrivateEndpointConnection, + "SqlServerPrivateEndpointConnection", + "csharp" +); +@@clientName(ReplicationLink, "SqlServerDatabaseReplicationLink", "csharp"); +@@clientName(ReplicationRole, "SqlServerDatabaseReplicationRole", "csharp"); +@@clientName(ServerVersionCapability, "SqlServerVersionCapability", "csharp"); +@@clientName(RestorePoint, "SqlServerDatabaseRestorePoint", "csharp"); +@@clientName(BackupStorageRedundancy, "SqlBackupStorageRedundancy", "csharp"); +@@clientName( + DNSRefreshOperationStatus, + "DnsRefreshConfigurationPropertiesStatus", + "csharp" +); +@@clientName( + DatabaseSqlVulnerabilityAssessmentBaselineSet, + "SqlVulnerabilityAssessmentBaseline", + "csharp" +); +@@clientName(BaselineName, "SqlVulnerabilityAssessmentBaselineName", "csharp"); +@@clientName( + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, + "SqlVulnerabilityAssessmentBaselineCreateOrUpdateContent", + "csharp" +); +@@clientName( + DatabaseSqlVulnerabilityAssessmentRuleBaseline, + "SqlVulnerabilityAssessmentBaselineRule", + "csharp" +); +@@clientName( + DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + "SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent", + "csharp" +); +@@clientName( + SqlVulnerabilityAssessmentScanRecord, + "SqlVulnerabilityAssessmentScan", + "csharp" +); +@@clientName( + AlwaysEncryptedEnclaveType, + "SqlAlwaysEncryptedEnclaveType", + "csharp" +); +@@clientName(SynapseLinkWorkspace, "SqlSynapseLinkWorkspace", "csharp"); +@@clientName( + BaselineAdjustedResult, + "SqlVulnerabilityAssessmentBaselineAdjustedResult", + "csharp" +); +@@clientName(Remediation, "SqlVulnerabilityAssessmentRemediation", "csharp"); +@@clientName(VaRule, "SqlVulnerabilityAssessmentRuleMetadata", "csharp"); +@@clientName(RuleStatus, "SqlVulnerabilityAssessmentRuleStatus", "csharp"); +@@clientName(Baseline, "SqlVulnerabilityAssessmentBaselineDetails", "csharp"); +@@clientName( + BenchmarkReference, + "SqlVulnerabilityAssessmentBenchmarkReference", + "csharp" +); +@@clientName(MoveOperationMode, "ManagedDatabaseMoveOperationMode", "csharp"); +@@clientName(QueryCheck, "SqlVulnerabilityAssessmentQueryCheck", "csharp"); +@@clientName(RuleSeverity, "SqlVulnerabilityAssessmentRuleSeverity", "csharp"); +@@clientName(RuleType, "SqlVulnerabilityAssessmentRuleType", "csharp"); +@@clientName( + SynapseLinkWorkspaceInfoProperties, + "SqlSynapseLinkWorkspaceInfo", + "csharp" +); +@@clientName(SecondaryInstanceType, "GeoSecondaryInstanceType", "csharp"); +@@clientName( + StartStopManagedInstanceSchedule, + "ManagedInstanceStartStopSchedule", + "csharp" +); +@@clientName( + StartStopScheduleName, + "ManagedInstanceStartStopScheduleName", + "csharp" +); +@@clientName(DatabaseKey, "SqlDatabaseKey", "csharp"); +@@clientName(DatabaseKeyType, "SqlDatabaseKeyType", "csharp"); +@@clientName(AvailabilityZoneType, "SqlAvailabilityZoneType", "csharp"); +@@clientName(EndpointDependency, "ManagedInstanceEndpointDependency", "csharp"); +@@clientName(EndpointDetail, "ManagedInstanceEndpointDetail", "csharp"); +@@clientName(ScheduleItem, "SqlScheduleItem", "csharp"); +@@clientName( + ServerConfigurationOptionName, + "ManagedInstanceServerConfigurationOptionName", + "csharp" +); +@@clientName( + ServerConfigurationOption, + "ManagedInstanceServerConfigurationOption", + "csharp" +); +@@clientName( + OutboundEnvironmentEndpoint, + "SqlOutboundEnvironmentEndpoint", + "csharp" +); +@@clientName( + OutboundEnvironmentEndpointCollection, + "SqlOutboundEnvironmentEndpointCollection", + "csharp" +); +@@clientName(MinimalTlsVersion, "SqlMinimalTlsVersion", "csharp"); +@@clientName(BackupStorageAccessTier, "SqlBackupStorageAccessTier", "csharp"); +@@clientName(Phase, "DatabaseOperationPhase", "csharp"); +@@clientName(PhaseDetails, "DatabaseOperationPhaseDetails", "csharp"); +@@clientName( + UpsertManagedServerOperationStepWithEstimatesAndDuration, + "UpsertManagedServerOperationStep", + "csharp" +); +@@clientName( + DistributedAvailabilityGroup, + "SqlDistributedAvailabilityGroup", + "csharp" +); +@@clientName( + NetworkSecurityPerimeterConfiguration, + "SqlNetworkSecurityPerimeterConfiguration", + "csharp" +); +@@clientName(CertificateInfo, "SqlServerCertificateInfo", "csharp"); +@@clientName(FailoverModeType, "SqlServerFailoverModeType", "csharp"); +@@clientName(FailoverType, "SqlServerFailoverType", "csharp"); +@@clientName( + InstanceRole, + "DistributedAvailabilityGroupManagedInstanceRole", + "csharp" +); +@@clientName(LinkRole, "SqlServerSideLinkRole", "csharp"); +@@clientName( + NSPConfigAccessRule, + "SqlNetworkSecurityPerimeterConfigAccessRule", + "csharp" +); +@@clientName( + NSPConfigAccessRuleProperties, + "SqlNetworkSecurityPerimeterConfigAccessRuleProperties", + "csharp" +); +@@clientName( + NSPConfigAssociation, + "SqlNetworkSecurityPerimeterConfigAssociation", + "csharp" +); +@@clientName( + NSPConfigNetworkSecurityPerimeterRule, + "SqlNetworkSecurityPerimeterConfigRule", + "csharp" +); +@@clientName( + NSPConfigPerimeter, + "SqlNetworkSecurityPerimeterConfigPerimeter", + "csharp" +); +@@clientName( + NSPConfigProfile, + "SqlNetworkSecurityPerimeterConfigProfile", + "csharp" +); +@@clientName( + NSPProvisioningIssue, + "SqlNetworkSecurityPerimeterProvisioningIssue", + "csharp" +); +@@clientName( + NSPProvisioningIssueProperties, + "SqlNetworkSecurityPerimeterProvisioningIssueProperties", + "csharp" +); +@@clientName(PricingModel, "SqlManagedInstancePricingModel", "csharp"); +@@clientName( + RefreshExternalGovernanceStatusOperationResultMI, + "SqlManagedInstanceRefreshExternalGovernanceStatusOperationResult", + "csharp" +); +@@clientName(ReplicaConnectedState, "SqlReplicaConnectedState", "csharp"); +@@clientName( + ReplicaSynchronizationHealth, + "SqlReplicaSynchronizationHealth", + "csharp" +); +@@clientName(ReplicationModeType, "SqlReplicationModeType", "csharp"); +@@clientName( + RoleChangeType, + "DistributedAvailabilityGroupRoleChangeType", + "csharp" +); +@@clientName(InstancePoolOperation, "SqlInstancePoolOperation", "csharp"); +@@clientName(ErrorType, "SqlInstancePoolOperationErrorType", "csharp"); +@@clientName( + InaccessibilityReason, + "ManagedDatabaseInaccessibilityReason", + "csharp" +); + +@@alternateType( + ManagedDatabaseProperties.crossSubscriptionSourceDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseProperties.crossSubscriptionRestorableDroppedDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedInstanceProperties.virtualClusterId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseMoveDefinition.destinationManagedDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseStartMoveDefinition.destinationManagedDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + SynapseLinkWorkspaceInfoProperties.workspaceId, + armResourceIdentifier, + "csharp" +); + +@@clientName( + ManagedDatabaseProperties.autoCompleteRestore, + "AllowAutoCompleteRestore", + "csharp" +); +@@clientName( + DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties.latestScan, + "IsLatestScan", + "csharp" +); +@@clientName( + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties.latestScan, + "IsLatestScan", + "csharp" +); +@@clientName(FailoverGroupProperties.databases, "FailoverDatabases", "csharp"); +@@clientName( + FailoverGroupUpdateProperties.databases, + "FailoverDatabases", + "csharp" +); +@@clientName(GeoBackupPolicyProperties.state, "GeoBackupPolicyState", "csharp"); +@@clientName( + ManagedDatabaseRestoreDetailsProperties.currentRestoredSizeMB, + "CurrentRestoredSizeInMB", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsProperties.currentRestorePlanSizeMB, + "CurrentRestorePlanSizeInMB", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsProperties.type, + "RestoreType", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsProperties.percentCompleted, + "CompletedPercent", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsProperties.numberOfFilesDetected, + "NumberOfFilesFound", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsProperties.unrestorableFiles, + "UnrestorableFileList", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsBackupSetProperties.backupSizeMB, + "BackupSizeInMB", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsBackupSetProperties.restoreStartedTimestampUtc, + "RestoreStartedOn", + "csharp" +); +@@clientName( + ManagedDatabaseRestoreDetailsBackupSetProperties.restoreFinishedTimestampUtc, + "RestoreFinishedOn", + "csharp" +); +@@clientName( + ManagedInstanceProperties.dnsZonePartner, + "ManagedDnsZonePartner", + "csharp" +); +@@clientName( + ManagedInstanceExternalAdministrator.azureADOnlyAuthentication, + "IsAzureADOnlyAuthenticationEnabled", + "csharp" +); +@@clientName( + ServerExternalAdministrator.azureADOnlyAuthentication, + "IsAzureADOnlyAuthenticationEnabled", + "csharp" +); +@@clientName( + ManagedInstanceAzureADOnlyAuthProperties.azureADOnlyAuthentication, + "IsAzureADOnlyAuthenticationEnabled", + "csharp" +); +@@clientName( + ManagedInstancePrivateEndpointConnectionProperties.privateLinkServiceConnectionState, + "ConnectionState", + "csharp" +); +@@clientName(RecommendedActionProperties.details, "ActionDetails", "csharp"); +@@clientName( + RestorePointProperties.restorePointCreationDate, + "restorePointCreatedOn", + "csharp" +); +@@clientName(ServerProperties.minimalTlsVersion, "minTlsVersion", "csharp"); +@@clientName( + AdministratorProperties.azureADOnlyAuthentication, + "IsAzureADOnlyAuthenticationEnabled", + "csharp" +); +@@clientName( + AzureADOnlyAuthProperties.azureADOnlyAuthentication, + "IsAzureADOnlyAuthenticationEnabled", + "csharp" +); +@@clientName( + SyncGroupProperties.enableConflictLogging, + "IsConflictLoggingEnabled", + "csharp" +); +@@clientName(AlwaysEncryptedEnclaveType.VBS, "Vbs", "csharp"); +@@clientName(Remediation.automated, "IsAutomated", "csharp"); +@@clientName( + ManagedInstanceDtcSecuritySettings.xaTransactionsDefaultTimeout, + "XATransactionsDefaultTimeoutInSeconds", + "csharp" +); +@@clientName( + ManagedInstanceDtcSecuritySettings.xaTransactionsMaximumTimeout, + "XATransactionsMaximumTimeoutInSeconds", + "csharp" +); +@@clientName( + ManagedInstanceDtcSecuritySettings.xaTransactionsEnabled, + "IsXATransactionsEnabled", + "csharp" +); +@@clientName(AuthMetadataLookupModes, "AuthMetadataLookupMode", "csharp"); +@@clientName(AuthMetadataLookupModes.AzureAD, "Aad", "csharp"); +@@clientName(ClientClassificationSource.MIP, "Mip", "csharp"); +@@clientName(DataMaskingRuleProperties.id, "RuleId", "csharp"); +@@clientName(ReplicaSynchronizationHealth.NOT_HEALTHY, "NotHealthy", "csharp"); +@@clientName( + ManagedInstanceVcoresCapability.supportedMemoryLimitsMB, + "SupportedMemoryLimitsInMB", + "csharp" +); + +// C# operation name mappings migrated from autorest.md.bak override-operation-name +@@clientName( + Microsoft.Sql.ManagedInstances.listByInstance, + "GetSqlServerTrustGroups", + "csharp" +); +@@clientName(ManagedInstances.listByManagedInstance, "GetTopQueries", "csharp"); +@@clientName( + ManagedInstances.listInaccessibleByInstance, + "GetInaccessibleManagedDatabases", + "csharp" +); +@@clientName( + ManagedInstances.listOutboundNetworkDependenciesByManagedInstance, + "GetOutboundNetworkDependencies", + "csharp" +); +@@clientName( + ManagedInstanceQueries.listByQuery, + "GetQueryStatistics", + "csharp" +); +@@clientName( + CapabilitiesOperationGroup.listByLocation, + "GetCapabilitiesByLocation", + "csharp" +); +@@clientName( + ServersOperationGroup.checkNameAvailability, + "CheckSqlServerNameAvailability", + "csharp" +); +@@clientName( + LongTermRetentionBackupsOperationGroup.listByResourceGroupLocation, + "GetLongTermRetentionBackupsWithLocation", + "csharp" +); +@@clientName( + LongTermRetentionBackupsOperationGroup.listByResourceGroupServer, + "GetLongTermRetentionBackupsWithServer", + "csharp" +); +@@clientName( + LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupInstance, + "GetLongTermRetentionManagedInstanceBackupsWithInstance", + "csharp" +); +@@clientName( + LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupLocation, + "GetLongTermRetentionManagedInstanceBackupsWithLocation", + "csharp" +); +@@clientName(SqlVulnerabilityAssessments.execute, "ExecuteScan", "csharp"); +@@clientName( + SqlVulnerabilityAssessmentsSettings.execute, + "ExecuteScanSettings", + "csharp" +); +@@clientName( + SqlVulnerabilityAssessmentScanResults, + "SqlVulnerabilityAssessmentScanResult", + "csharp" +); +@@clientName(PrivateLinkResource, "SqlPrivateLinkResource", "csharp"); +@@clientName( + PrivateEndpointConnection, + "SqlPrivateEndpointConnection", + "csharp" +); +@@clientName(ManagedLedgerDigestUploads, "ManagedLedgerDigestUpload", "csharp"); +@@clientName(MaintenanceWindowOptions, "MaintenanceWindowOption", "csharp"); +@@clientName( + DataWarehouseUserActivities, + "DataWarehouseUserActivity", + "csharp" +); +@@clientName( + UpsertManagedServerOperationStepWithEstimatesAndDurationStatus, + "UpsertManagedServerOperationStepStatus", + "csharp" +); +@@clientName( + CheckNameAvailabilityResponse, + "SqlNameAvailabilityResponse", + "csharp" +); +@@clientName( + ManagedServerDnsAliasCreation, + "ManagedServerDnsAliasCreateOrUpdateContent", + "csharp" +); +@@clientName( + ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, + "ManagedInstanceValidateAzureKeyVaultEncryptionKeyContent", + "csharp" +); +@@clientName( + ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, + "ManagedInstanceValidateAzureKeyVaultEncryptionKeyContent", + "csharp" +); +@@clientName( + DistributedAvailabilityGroupsFailoverRequest, + "DistributedAvailabilityGroupsFailoverContent", + "csharp" +); +@@clientName(SyncAgentProperties.name, "SyncAgentName", "csharp"); +@@clientName( + ManagedDatabases.managedDatabaseRecommendedSensitivityLabelsUpdate, + "UpdateRecommendedManagedDatabaseSensitivityLabel", + "csharp" +); +@@clientName( + ManagedDatabases.listCurrentByDatabase, + "GetCurrentManagedDatabaseSensitivityLabels", + "csharp" +); +@@clientName( + ManagedDatabases.listRecommendedByDatabase, + "GetRecommendedManagedDatabaseSensitivityLabels", + "csharp" +); +@@clientName( + Databases.recommendedSensitivityLabelsUpdate, + "UpdateRecommendedSensitivityLabel", + "csharp" +); +@@clientName( + DataMaskingPolicies.listByDatabase, + "GetDataMaskingRules", + "csharp" +); +@@clientName( + Databases.databaseUsagesListByDatabase, + "GetDatabaseUsages", + "csharp" +); +@@clientName( + Databases.synapseLinkWorkspacesListByDatabase, + "GetSynapseLinkWorkspaces", + "csharp" +); +@@clientName( + ImportExportExtensionsOperationResults.listByDatabase, + "GetDatabaseExtensions", + "csharp" +); +@@clientName(ElasticPools.listByElasticPool, "GetDatabases", "csharp"); +@@clientName( + Servers.serverOperationsListByServer, + "GetServerOperations", + "csharp" +); +@@clientName( + Servers.serverUsagesListByServer, + "GetServerUsages", + "csharp" +); + +// Scope out any operation methods for csharp as they have been implemented in core lib +@@scope(ManagedDatabaseMoveOperationResults.get, "!csharp"); +@@scope(ManagedDatabaseMoveOperationResults.listByLocation, "!csharp"); +// This is temporary, to be removed when we find the owner of this feature +@@scope(JobPrivateEndpoints.get, "!csharp"); +@@scope(JobPrivateEndpoints.createOrUpdate, "!csharp"); +@@scope(JobPrivateEndpoints.delete, "!csharp"); +@@scope(JobPrivateEndpoints.listByAgent, "!csharp"); +// This operation is not supported +@@scope(ImportExportExtensionsOperationResults.get, "!csharp"); +// This operation sends a list of rules but got a single rule in response, which is abnormal. Besides, using FirewallRules_CreateOrUpdate/FirewallRules_Delete multiple times could achieve the same goal. +@@scope(Servers.replace, "!csharp"); + +/** + * Provisioning state of managed instance. + */ +union ManagedInstancePropertiesProvisioningState { + string, + + /** + * Created + */ + Created: "Created", + + /** + * InProgress + */ + InProgress: "InProgress", + + /** + * Succeeded + */ + Succeeded: "Succeeded", + + /** + * Failed + */ + Failed: "Failed", + + /** + * Canceled + */ + Canceled: "Canceled", + + /** + * Creating + */ + Creating: "Creating", + + /** + * Deleting + */ + Deleting: "Deleting", + + /** + * Updating + */ + Updating: "Updating", + + /** + * Unknown + */ + Unknown: "Unknown", + + /** + * Accepted + */ + Accepted: "Accepted", + + /** + * Deleted + */ + Deleted: "Deleted", + + /** + * Unrecognized + */ + Unrecognized: "Unrecognized", + + /** + * Running + */ + Running: "Running", + + /** + * NotSpecified + */ + NotSpecified: "NotSpecified", + + /** + * Registering + */ + Registering: "Registering", + + /** + * TimedOut + */ + TimedOut: "TimedOut", +} +@@alternateType( + ManagedInstanceProperties.provisioningState, + ManagedInstancePropertiesProvisioningState, + "csharp" +); diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml b/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml index b17fe9df59f8..1476a194a72b 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml @@ -12,6 +12,11 @@ options: emit-lro-options: "all" examples-dir: "{project-root}/examples" output-splitting: "legacy-feature-files" + "@azure-typespec/http-client-csharp-mgmt": + namespace: "Azure.ResourceManager.Sql" + emitter-output-dir: "{output-dir}/sdk/sqlmanagement/{namespace}" + enable-wire-path-attribute: true + api-version: "2025-01-01" "@azure-tools/typespec-java": emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-sql" namespace: "com.azure.resourcemanager.sql" From aef0a5c8a69fe1389d18ab7e5281590bf1fa4c86 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 15 Jun 2026 15:23:59 +0800 Subject: [PATCH 02/19] update --- .../Microsoft.Sql/SQL/JobStep.tsp | 1 + .../Microsoft.Sql/SQL/JobVersion.tsp | 1 + .../Microsoft.Sql/SQL/client.tsp | 199 +++++++++++++++++- 3 files changed, 196 insertions(+), 5 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp index 4df7069bcabf..15f60176b632 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp @@ -118,6 +118,7 @@ alias JobStepOperationGroupOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("versions") @key + @Azure.ClientGenerator.Core.alternateType(string) // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. jobVersion: int32; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp index 21af6cae58e9..cfff7b47d24d 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp @@ -57,6 +57,7 @@ alias JobVersionOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("versions") @key + @Azure.ClientGenerator.Core.alternateType(string) // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. jobVersion: int32; } >; diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index f594e9a87d92..2e7dfab10846 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -523,6 +523,39 @@ using Microsoft.Sql; "csharp" ); +// C# alternate type mappings migrated from autorest.md.bak directive format transforms +@@alternateType(global.Microsoft.Sql.Usage.id, armResourceIdentifier, "csharp"); +@@alternateType(global.Microsoft.Sql.Usage.type, armResourceType, "csharp"); +@@alternateType(ResourceWithWritableName.id, armResourceIdentifier, "csharp"); +@@alternateType(ManagedInstancePecProperty.id, armResourceIdentifier, "csharp"); +@@alternateType(ResourceMoveDefinition.id, armResourceIdentifier, "csharp"); +@@alternateType(PartnerInfo.id, armResourceIdentifier, "csharp"); +@@alternateType( + ServerPrivateEndpointConnection.id, + armResourceIdentifier, + "csharp" +); +@@alternateType(ServerInfo.serverId, armResourceIdentifier, "csharp"); +@@alternateType(ServicePrincipal.principalId, uuid, "csharp"); +@@alternateType(ServicePrincipal.clientId, uuid, "csharp"); +@@alternateType( + ManagedDatabaseProperties.restorableDroppedDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + RecommendedActionProperties.executeActionDuration, + duration, + "csharp" +); +@@alternateType( + RecommendedActionProperties.revertActionDuration, + duration, + "csharp" +); +@@alternateType(MaintenanceWindowTimeRange.duration, duration, "csharp"); +@@alternateType(JobSchedule.interval, duration, "csharp"); + @@clientName( ManagedDatabaseProperties.autoCompleteRestore, "AllowAutoCompleteRestore", @@ -665,6 +698,165 @@ using Microsoft.Sql; "csharp" ); +// C# client name mappings migrated from autorest.md.bak directive x-ms-client-name transforms +@@clientName( + LongTermRetentionBackupProperties.backupExpirationTime, + "backupExpireOn", + "csharp" +); +@@clientName( + ManagedInstanceLongTermRetentionBackupProperties.backupExpirationTime, + "backupExpireOn", + "csharp" +); +@@clientName( + LongTermRetentionBackupProperties.databaseDeletionTime, + "databaseDeletedOn", + "csharp" +); +@@clientName( + ManagedInstanceLongTermRetentionBackupProperties.databaseDeletionTime, + "databaseDeletedOn", + "csharp" +); +@@clientName(SyncAgentProperties.expiryTime, "ExpireOn", "csharp"); +@@clientName( + DatabaseProperties.sourceDatabaseDeletionDate, + "sourceDatabaseDeletedOn", + "csharp" +); +@@clientName( + DatabaseUpdateProperties.sourceDatabaseDeletionDate, + "sourceDatabaseDeletedOn", + "csharp" +); +@@clientName( + DatabaseOperationProperties.estimatedCompletionTime, + "estimatedCompleteOn", + "csharp" +); +@@clientName( + ElasticPoolOperationProperties.estimatedCompletionTime, + "estimatedCompleteOn", + "csharp" +); +@@clientName( + InstancePoolOperationProperties.estimatedCompletionTime, + "estimatedCompleteOn", + "csharp" +); +@@clientName( + ManagedInstanceOperationProperties.estimatedCompletionTime, + "estimatedCompleteOn", + "csharp" +); +@@clientName( + ServerOperationProperties.estimatedCompletionTime, + "estimatedCompleteOn", + "csharp" +); +@@clientName( + SecurityAlertPolicyProperties.emailAccountAdmins, + "SendToEmailAccountAdmins", + "csharp" +); +@@clientName( + SecurityAlertsPolicyProperties.emailAccountAdmins, + "SendToEmailAccountAdmins", + "csharp" +); +@@clientName(AdvisorProperties.lastChecked, "LastCheckedOn", "csharp"); +@@clientName( + DatabaseColumnProperties.memoryOptimized, + "IsMemoryOptimized", + "csharp" +); +@@clientName( + DatabaseTableProperties.memoryOptimized, + "IsMemoryOptimized", + "csharp" +); +@@clientName(DatabaseProperties.zoneRedundant, "IsZoneRedundant", "csharp"); +@@clientName( + DatabaseUpdateProperties.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName(EditionCapability.zoneRedundant, "IsZoneRedundant", "csharp"); +@@clientName( + ElasticPoolEditionCapability.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName( + ElasticPoolPerformanceLevelCapability.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName(ElasticPoolProperties.zoneRedundant, "IsZoneRedundant", "csharp"); +@@clientName( + ElasticPoolUpdateProperties.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName( + MaintenanceConfigurationCapability.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName( + ManagedInstanceFamilyCapability.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName( + ManagedInstanceProperties.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName( + ServiceObjectiveCapability.zoneRedundant, + "IsZoneRedundant", + "csharp" +); +@@clientName( + EncryptionProtectorProperties.autoRotationEnabled, + "IsAutoRotationEnabled", + "csharp" +); +@@clientName( + ManagedInstanceEncryptionProtectorProperties.autoRotationEnabled, + "IsAutoRotationEnabled", + "csharp" +); +@@clientName( + ManagedInstanceKeyProperties.autoRotationEnabled, + "IsAutoRotationEnabled", + "csharp" +); +@@clientName( + ServerKeyProperties.autoRotationEnabled, + "IsAutoRotationEnabled", + "csharp" +); +@@clientName( + ManagedInstanceProperties.publicDataEndpointEnabled, + "IsPublicDataEndpointEnabled", + "csharp" +); +@@clientName( + ManagedInstanceVcoresCapability.instancePoolSupported, + "IsInstancePoolSupported", + "csharp" +); +@@clientName( + ManagedInstanceVcoresCapability.standaloneSupported, + "IsStandaloneSupported", + "csharp" +); +@@clientName(JobSchedule.enabled, "IsEnabled", "csharp"); +@@clientName(CheckNameAvailabilityResponse.available, "IsAvailable", "csharp"); + // C# operation name mappings migrated from autorest.md.bak override-operation-name @@clientName( Microsoft.Sql.ManagedInstances.listByInstance, @@ -818,11 +1010,7 @@ using Microsoft.Sql; "GetServerOperations", "csharp" ); -@@clientName( - Servers.serverUsagesListByServer, - "GetServerUsages", - "csharp" -); +@@clientName(Servers.serverUsagesListByServer, "GetServerUsages", "csharp"); // Scope out any operation methods for csharp as they have been implemented in core lib @@scope(ManagedDatabaseMoveOperationResults.get, "!csharp"); @@ -923,6 +1111,7 @@ union ManagedInstancePropertiesProvisioningState { */ TimedOut: "TimedOut", } +// Inherited from the original autorest.md settings. @@alternateType( ManagedInstanceProperties.provisioningState, ManagedInstancePropertiesProvisioningState, From c2b96ed00eaf92daa4d60a3873e977309abc9b09 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 15 Jun 2026 17:15:20 +0800 Subject: [PATCH 03/19] Refactor client type mappings and add alternate types for SQL resources --- .../Microsoft.Sql/SQL/client.tsp | 216 +++++++++++++++++- 1 file changed, 210 insertions(+), 6 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 2e7dfab10846..9704c60e28bf 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -234,11 +234,6 @@ using Microsoft.Sql; "csharp" ); @@clientName(CheckNameAvailabilityReason, "SqlNameUnavailableReason", "csharp"); -@@clientName( - CheckNameAvailabilityResourceType, - "SqlNameAvailabilityResourceType", - "csharp" -); @@clientName( CheckNameAvailabilityRequest, "SqlNameAvailabilityContent", @@ -492,6 +487,46 @@ using Microsoft.Sql; "csharp" ); +@@alternateType( + CopyLongTermRetentionBackupParametersProperties.targetServerResourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + DeletedServerProperties.originalId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ElasticPoolProperties.maintenanceConfigurationId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ElasticPoolUpdateProperties.maintenanceConfigurationId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + InstancePoolProperties.subnetId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + LongTermRetentionOperationResultProperties.fromBackupResourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + LongTermRetentionOperationResultProperties.toBackupResourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseProperties.crossSubscriptionTargetManagedInstanceId, + armResourceIdentifier, + "csharp" +); @@alternateType( ManagedDatabaseProperties.crossSubscriptionSourceDatabaseId, armResourceIdentifier, @@ -502,11 +537,46 @@ using Microsoft.Sql; armResourceIdentifier, "csharp" ); +@@alternateType( + ManagedDatabaseProperties.failoverGroupId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseProperties.longTermRetentionBackupResourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseProperties.recoverableDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedDatabaseProperties.sourceDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedInstanceProperties.instancePoolId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + ManagedInstanceProperties.maintenanceConfigurationId, + armResourceIdentifier, + "csharp" +); @@alternateType( ManagedInstanceProperties.virtualClusterId, armResourceIdentifier, "csharp" ); +@@alternateType( + ManagedInstancePrivateEndpointProperty.id, + armResourceIdentifier, + "csharp" +); @@alternateType( ManagedDatabaseMoveDefinition.destinationManagedDatabaseId, armResourceIdentifier, @@ -522,6 +592,103 @@ using Microsoft.Sql; armResourceIdentifier, "csharp" ); +@@alternateType(PrivateEndpointProperty.id, armResourceIdentifier, "csharp"); +@@alternateType( + ServerProperties.primaryUserAssignedIdentityId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + VirtualNetworkRuleProperties.virtualNetworkSubnetId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + SyncAgentProperties.syncDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + SyncGroupProperties.syncDatabaseId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + SyncMemberProperties.syncAgentId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + SyncMemberProperties.syncMemberAzureDatabaseResourceId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + VirtualClusterProperties.subnetId, + armResourceIdentifier, + "csharp" +); + +@@alternateType(Advisor.location, azureLocation, "csharp"); +@@alternateType(EncryptionProtector.location, azureLocation, "csharp"); +@@alternateType( + ManagedDatabaseProperties.defaultSecondaryLocation, + azureLocation, + "csharp" +); +@@alternateType(ServerConnectionPolicy.location, azureLocation, "csharp"); +@@alternateType( + ReplicationLinkProperties.partnerLocation, + azureLocation, + "csharp" +); +@@alternateType(RestorePoint.location, azureLocation, "csharp"); +@@alternateType(ServerKey.location, azureLocation, "csharp"); + +@@alternateType(DatabaseExtensionsProperties.storageUri, url, "csharp"); +@@alternateType(EncryptionProtectorProperties.uri, url, "csharp"); +@@alternateType( + ImportExportExtensionsOperationResultProperties.blobUri, + url, + "csharp" +); +@@alternateType(ImportExportOperationResultProperties.blobUri, url, "csharp"); +@@alternateType(ManagedDatabaseProperties.storageContainerUri, url, "csharp"); +@@alternateType( + ManagedInstanceEncryptionProtectorProperties.uri, + url, + "csharp" +); +@@alternateType(ManagedInstanceKeyProperties.uri, url, "csharp"); +@@alternateType(ManagedInstanceProperties.keyId, url, "csharp"); +@@alternateType(ServerKeyProperties.uri, url, "csharp"); +@@alternateType(ServerProperties.keyId, url, "csharp"); + +@@alternateType(SecurityEventProperties.clientIp, ipV4Address, "csharp"); +@@alternateType(SyncAgentLinkedDatabaseProperties.databaseId, uuid, "csharp"); +@@alternateType( + ServerProperties.publicNetworkAccess, + ServerNetworkAccessFlag, + "csharp" +); + +@@clientName(DatabaseIdentity.type, "IdentityType", "csharp"); +@@clientName(JobAgentIdentity.type, "IdentityType", "csharp"); +@@clientName(JobExecutionTarget.type, "TargetType", "csharp"); +@@clientName(JobSchedule.type, "ScheduleType", "csharp"); +@@clientName(JobStepAction.type, "ActionType", "csharp"); +@@clientName(JobStepOutput.type, "OutputType", "csharp"); +@@clientName(JobTarget.type, "TargetType", "csharp"); +@@clientName(DatabaseKey.type, "KeyType", "csharp"); +@@clientName(CheckNameAvailabilityRequest.type, "ResourceType", "csharp"); +@@clientName( + PrivateEndpointConnectionProperties.privateLinkServiceConnectionState, + "ConnectionState", + "csharp" +); +@@clientName(ServicePrincipal.type, "PrincipalType", "csharp"); +@@clientName(SyncGroupLogProperties.type, "LogType", "csharp"); +@@usage(QueryStatistics, Azure.ClientGenerator.Core.Usage.input, "csharp"); // C# alternate type mappings migrated from autorest.md.bak directive format transforms @@alternateType(global.Microsoft.Sql.Usage.id, armResourceIdentifier, "csharp"); @@ -645,7 +812,7 @@ using Microsoft.Sql; ); @@clientName( ManagedInstancePrivateEndpointConnectionProperties.privateLinkServiceConnectionState, - "ConnectionState", + "PrivateLinkServiceConnectionState", "csharp" ); @@clientName(RecommendedActionProperties.details, "ActionDetails", "csharp"); @@ -1117,3 +1284,40 @@ union ManagedInstancePropertiesProvisioningState { ManagedInstancePropertiesProvisioningState, "csharp" ); + +/** + * Availability resource type. + */ +union SqlNameAvailabilityResourceType { + string, + + /** + * Microsoft.Sql/servers + */ + MicrosoftSqlServers: "Microsoft.Sql/servers", +} +// Inherited from the original autorest.md settings. Change fixed enum to extensible enum. +@@alternateType( + CheckNameAvailabilityRequest.type, + SqlNameAvailabilityResourceType, + "csharp" +); + +@@usage(DatabaseColumn, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@clientName( + DatabaseColumnProperties.memoryOptimized, + "IsMemoryOptimized", + "csharp" +); +@@usage(DatabaseTable, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@clientName( + DatabaseTableProperties.memoryOptimized, + "IsMemoryOptimized", + "csharp" +); +@@alternateType(DataMaskingPolicy.location, azureLocation, "csharp"); +@@clientName( + DataMaskingPolicies.dataMaskingRulesCreateOrUpdate, + "CreateOrUpdateDataMaskingRule", + "csharp" +); From 2b5c3bfd7ad663694cebc9926467c28a8dc78743 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Jun 2026 00:32:55 +0800 Subject: [PATCH 04/19] update --- .../Microsoft.Sql/SQL/DeletedServer.tsp | 1 + .../SQL/InstanceFailoverGroup.tsp | 1 + .../SQL/LongTermRetentionBackup.tsp | 2 + .../ManagedDatabaseMoveOperationResult.tsp | 1 + ...ManagedInstanceLongTermRetentionBackup.tsp | 2 + .../Microsoft.Sql/SQL/ServerTrustGroup.tsp | 1 + .../Microsoft.Sql/SQL/SubscriptionUsage.tsp | 1 + .../Microsoft.Sql/SQL/TimeZone.tsp | 1 + .../Microsoft.Sql/SQL/client.tsp | 94 +++++++++++++++++++ .../Microsoft.Sql/SQL/routes.tsp | 10 ++ 10 files changed, 114 insertions(+) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp index e712032d7f42..b5e5122a444d 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp @@ -36,6 +36,7 @@ alias DeletedServersOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp index 46ae44010272..c98a46afae78 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp @@ -37,6 +37,7 @@ alias InstanceFailoverGroupsOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp index 00c9e00bcd14..76b52618e408 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp @@ -41,6 +41,7 @@ alias LongTermRetentionBackupOps = Azure.ResourceManager.Legacy.LegacyOperations @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** The name of the server */ @@ -199,6 +200,7 @@ alias LongTermRetentionBackupOperationGroupOps = Azure.ResourceManager.Legacy.Le @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** The name of the server */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp index 7fa0d1553053..06b09859727c 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp @@ -37,6 +37,7 @@ alias ManagedDatabaseMoveOperationResultsOps = Azure.ResourceManager.Legacy.Lega @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp index 208a97544330..718f77722380 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp @@ -43,6 +43,7 @@ alias ManagedInstanceLongTermRetentionBackupOps = Azure.ResourceManager.Legacy.L @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** The name of the managed instance. */ @@ -121,6 +122,7 @@ alias LongTermRetentionManagedInstanceBackupOps = Azure.ResourceManager.Legacy.L @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** The name of the managed instance. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp index 0b05cb0de7e1..deacf3ef84e5 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp @@ -37,6 +37,7 @@ alias ServerTrustGroupsOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp index 25dc8dbd1a14..f932eeef0e3c 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp @@ -36,6 +36,7 @@ alias SubscriptionUsagesOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp index 2b4360ac4290..cba1f7f0e15c 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp @@ -35,6 +35,7 @@ alias TimeZonesOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 9704c60e28bf..574b50830e9e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1172,6 +1172,11 @@ using Microsoft.Sql; "csharp" ); @@clientName(ElasticPools.listByElasticPool, "GetDatabases", "csharp"); +@@clientName( + ElasticPools.elasticPoolOperationsListByElasticPool, + "GetElasticPoolOperations", + "csharp" +); @@clientName( Servers.serverOperationsListByServer, "GetServerOperations", @@ -1303,6 +1308,7 @@ union SqlNameAvailabilityResourceType { "csharp" ); +@@usage(EndpointCertificate, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage(DatabaseColumn, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@clientName( DatabaseColumnProperties.memoryOptimized, @@ -1321,3 +1327,91 @@ union SqlNameAvailabilityResourceType { "CreateOrUpdateDataMaskingRule", "csharp" ); +@@clientName(InstancePools.listByInstancePool, "GetManagedInstances", "csharp"); +@@clientName(InstancePools.usagesListByInstancePool, "GetUsages", "csharp"); +@@usage( + LongTermRetentionBackup, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + MaintenanceWindowOptions, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@clientName( + SensitivityLabels.disableRecommendation, + "DisableRecommendationManagedDatabaseSensitivityLabel", + "csharp" +); +@@clientName( + SensitivityLabels.enableRecommendation, + "EnableRecommendationManagedDatabaseSensitivityLabel", + "csharp" +); +@@clientName( + ManagedDatabases.listCurrentByDatabase, + "GetCurrentManagedDatabaseSensitivityLabels", + "csharp" +); +@@clientName( + ManagedDatabases.listRecommendedByDatabase, + "GetRecommendedManagedDatabaseSensitivityLabels", + "csharp" +); +@@clientName( + ManagedDatabases.managedDatabaseSensitivityLabelsListByDatabase, + "GetManagedDatabaseSensitivityLabelsByDatabase", + "csharp" +); +@@clientName( + ManagedDatabases.listByDatabase, + "GetManagedDatabaseColumnsByDatabase", + "csharp" +); +@@clientName(ManagedInstanceQueries.get, "GetManagedDatabaseQuery", "csharp"); +@@clientName( + ManagedDatabases.managedDatabaseSecurityEventsListByDatabase, + "GetManagedDatabaseSecurityEventsByDatabase", + "csharp" +); +@@clientName( + ManagedInstanceQueries.listByQuery, + "GetQueryStatistics", + "csharp" +); +@@clientName( + ManagedDatabases.managedDatabaseSensitivityLabelsUpdate, + "UpdateManagedDatabaseSensitivityLabel", + "csharp" +); +@@alternateType(ManagedInstanceOperation.name, uuid, "csharp"); +@@alternateType(InstancePoolOperation.name, uuid, "csharp"); +@@clientName(ElasticPools.cancel, "CancelElasticPoolOperation", "csharp"); +@@clientName( + ManagedInstancePrivateEndpointConnectionProperties.privateLinkServiceConnectionState, + "ConnectionState", + "csharp" +); +@@clientName( + ManagedInstances.create, + "CreateManagedInstanceTdeCertificate", + "csharp" +); +@@clientName( + LongTermRetentionBackups.changeAccessTier::parameters.body, + "content", + "csharp" +); +@@clientName( + LongTermRetentionBackupOperationGroup.changeAccessTierByResourceGroup::parameters.body, + "content", + "csharp" +); + +#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility" +@@Azure.ClientGenerator.Core.Legacy.hierarchyBuilding( + RestorableDroppedDatabase, + Azure.ResourceManager.Foundations.TrackedResource, + "csharp" +); diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp index 0885a6652337..ef701d30403c 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp @@ -53,6 +53,7 @@ interface CapabilitiesOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -86,6 +87,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -118,6 +120,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -157,6 +160,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -189,6 +193,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -237,6 +242,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -287,6 +293,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -326,6 +333,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -376,6 +384,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; /** @@ -439,6 +448,7 @@ interface SyncGroupsOperationGroup { */ @path @segment("locations") + @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. locationName: string; } >; From caac0016feb492e40d2ff96cf7f3726a8aaeeebf Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Jun 2026 23:18:13 +0800 Subject: [PATCH 05/19] update --- .../Microsoft.Sql/SQL/client.tsp | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 574b50830e9e..7714dc91d899 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1415,3 +1415,242 @@ union SqlNameAvailabilityResourceType { Azure.ResourceManager.Foundations.TrackedResource, "csharp" ); + +// --- Property type alternates (string -> ResourceIdentifier / AzureLocation) --- +@@alternateType( + DatabaseProperties.failoverGroupId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + DatabaseProperties.maintenanceConfigurationId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + DatabaseProperties.defaultSecondaryLocation, + azureLocation, + "csharp" +); +@@alternateType( + DatabaseUpdateProperties.failoverGroupId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + DatabaseUpdateProperties.maintenanceConfigurationId, + armResourceIdentifier, + "csharp" +); +@@alternateType( + DatabaseUpdateProperties.defaultSecondaryLocation, + azureLocation, + "csharp" +); + +// --- Enum value renames to match v1.4.0 contract --- +@@clientName(CatalogCollationType.DATABASE_DEFAULT, "DatabaseDefault", "csharp"); +@@clientName( + CatalogCollationType.SQL_Latin1_General_CP1_CI_AS, + "SqlLatin1GeneralCp1CiAs", + "csharp" +); + +@@clientName(DiffBackupIntervalInHours.`12`, "Twelve", "csharp"); +@@clientName(DiffBackupIntervalInHours.`24`, "TwentyFour", "csharp"); + +// ===================================================================== +// Restore parameterless ctor + setters for output-only models +// (v1.4.0 ApiCompat mitigations) +// +// Marking these models as `Usage.input` makes the C# generator emit them +// as roundtrippable (Input | Output), which restores the public +// parameterless constructor and writable property setters that the +// v1.4.0 contract exposed. +// ===================================================================== +@@usage(DatabaseOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(DatabaseUsage, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + DatabaseVulnerabilityAssessmentScansExport, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(ElasticPoolOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + ImportExportExtensionsOperationResult, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + ImportExportOperationResult, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + LongTermRetentionBackupOperationResult, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + UpdateVirtualClusterDnsServersOperation, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + RefreshExternalGovernanceStatusOperationResult, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(SecurityEvent, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(ServerOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(InstancePoolOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + RefreshExternalGovernanceStatusOperationResultMI, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(NSPConfigAccessRule, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + NSPConfigAccessRuleProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(NSPConfigAssociation, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(NSPConfigPerimeter, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(NSPConfigProfile, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + NSPConfigNetworkSecurityPerimeterRule, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + NetworkSecurityPerimeterConfiguration, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(NSPProvisioningIssue, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + NSPProvisioningIssueProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(PrivateLinkResource, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(RestorePoint, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(ServerDnsAlias, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(JobExecution, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(JobVersion, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(ServerUsage, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(SynapseLinkWorkspace, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + SynapseLinkWorkspaceInfoProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(TimeZone, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + DatabaseSqlVulnerabilityAssessmentBaselineSet, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + DatabaseSqlVulnerabilityAssessmentRuleBaseline, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + SqlVulnerabilityAssessmentScanRecord, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + SqlVulnerabilityAssessmentScanResults, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(SubscriptionUsage, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(SyncAgentLinkedDatabase, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + VulnerabilityAssessmentScanRecord, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); + +// Standalone setter regressions: input models / input contents whose +// containing model already has a ctor in v1.4.0 but lost individual +// setters because codegen no longer sees them as inputs. +@@usage(DatabaseExtensions, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage(TdeCertificate, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); + +@@clientName(AvailabilityZoneType.`1`, "One", "csharp"); +@@clientName(AvailabilityZoneType.`2`, "Two", "csharp"); +@@clientName(AvailabilityZoneType.`3`, "Three", "csharp"); + +@@clientName(ManagedDatabaseStatus.DbCopying, "DBCopying", "csharp"); +@@clientName(ManagedDatabaseStatus.DbMoving, "DBMoving", "csharp"); + +@@clientName( + ManagedInstanceDatabaseFormat.SQLServer2022, + "SqlServer2022", + "csharp" +); +@@clientName( + ManagedInstanceDatabaseFormat.SQLServer2025, + "SqlServer2025", + "csharp" +); + +@@clientName(PerformanceLevelUnit.DTU, "Dtu", "csharp"); + +@@clientName(ReplicationState.PENDING, "Pending", "csharp"); +@@clientName(ReplicationState.SEEDING, "Seeding", "csharp"); +@@clientName(ReplicationState.CATCH_UP, "CatchUp", "csharp"); +@@clientName(ReplicationState.SUSPENDED, "Suspended", "csharp"); + +@@clientName(ReplicationLinkType.GEO, "Geo", "csharp"); +@@clientName(ReplicationLinkType.NAMED, "Named", "csharp"); +@@clientName(ReplicationLinkType.STANDBY, "Standby", "csharp"); + +@@clientName(ColumnDataType.hierarchyid, "HierarchyId", "csharp"); + +@@clientName(ReplicaConnectedState.CONNECTED, "Connected", "csharp"); +@@clientName(ReplicaConnectedState.DISCONNECTED, "Disconnected", "csharp"); + +@@clientName(ReplicaSynchronizationHealth.HEALTHY, "Healthy", "csharp"); +@@clientName( + ReplicaSynchronizationHealth.PARTIALLY_HEALTHY, + "PartiallyHealthy", + "csharp" +); + +@@clientName(StorageCapabilityStorageAccountType.GRS, "Grs", "csharp"); +@@clientName(StorageCapabilityStorageAccountType.LRS, "Lrs", "csharp"); +@@clientName(StorageCapabilityStorageAccountType.ZRS, "Zrs", "csharp"); +@@clientName(StorageCapabilityStorageAccountType.GZRS, "Gzrs", "csharp"); + +// --- Property casing fixes (IP/IPv6 capitalization, etc.) --- +@@clientName( + ServerFirewallRuleProperties.startIpAddress, + "StartIPAddress", + "csharp" +); +@@clientName( + ServerFirewallRuleProperties.endIpAddress, + "EndIPAddress", + "csharp" +); +@@clientName(SecurityEventProperties.clientIp, "ClientIP", "csharp"); +@@clientName( + ManagedInstanceDtcSecuritySettings.snaLu6point2TransactionsEnabled, + "SnaLu6Point2TransactionsEnabled", + "csharp" +); \ No newline at end of file From 9ae69967ef7259fea3a5c8d71e828cd8c6869fde Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 16 Jun 2026 23:52:08 +0800 Subject: [PATCH 06/19] update --- .../Microsoft.Sql/SQL/client.tsp | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 7714dc91d899..f9bd12e28bd4 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1653,4 +1653,36 @@ union SqlNameAvailabilityResourceType { ManagedInstanceDtcSecuritySettings.snaLu6point2TransactionsEnabled, "SnaLu6Point2TransactionsEnabled", "csharp" -); \ No newline at end of file +); +@@clientName( + DeletedServersOperationGroup.list, + "GetDeletedServers", + "csharp" +); +@@clientName( + SyncGroupsOperationGroup.listSyncDatabaseIds, + "GetSyncDatabaseIdsSyncGroups", + "csharp" +); + +// SqlDatabaseResource sensitivity-label operations: v1.4 exposed long descriptive names. +@@clientName( + Databases.listCurrentByDatabase, + "GetCurrentSensitivityLabels", + "csharp" +); +@@clientName( + Databases.listRecommendedByDatabase, + "GetRecommendedSensitivityLabels", + "csharp" +); +@@clientName( + Databases.sensitivityLabelsListByDatabase, + "GetSensitivityLabels", + "csharp" +); +@@clientName( + Databases.sensitivityLabelsUpdate, + "UpdateSensitivityLabel", + "csharp" +); From 6875dc2ecc79f5792150c88f7bd4a0a344db20e7 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 17 Jun 2026 00:14:06 +0800 Subject: [PATCH 07/19] update --- specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index f9bd12e28bd4..46d0ae43e6dd 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1654,6 +1654,7 @@ union SqlNameAvailabilityResourceType { "SnaLu6Point2TransactionsEnabled", "csharp" ); +// --- Rename operations to match v1.4.0 method names (ApiCompat) --- @@clientName( DeletedServersOperationGroup.list, "GetDeletedServers", From 3eadd4b41869bed72d7943e47584e597ada04bae Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 17 Jun 2026 17:10:45 +0800 Subject: [PATCH 08/19] update --- .../SQL/SqlVulnerabilityAssessment.tsp | 8 ++- .../Microsoft.Sql/SQL/client.tsp | 60 ++++++++++++++----- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp index 4b60a12111e4..49c3f7690706 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp @@ -21,8 +21,7 @@ model SqlVulnerabilityAssessment Resource = SqlVulnerabilityAssessment, KeyName = "vulnerabilityAssessmentName", SegmentName = "sqlVulnerabilityAssessments", - NamePattern = "", - Type = SqlVulnerabilityAssessmentName + NamePattern = "" >; } @@ -99,6 +98,7 @@ interface SqlVulnerabilityAssessments { @path @segment("sqlVulnerabilityAssessments") @key + @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. vulnerabilityAssessmentName: VulnerabilityAssessmentName; } >; @@ -137,6 +137,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key + @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. vulnerabilityAssessmentName: SqlVulnerabilityAssessmentName; } >; @@ -156,6 +157,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key + @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. vulnerabilityAssessmentName: VulnerabilityAssessmentName; } >; @@ -175,6 +177,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key + @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. vulnerabilityAssessmentName: VulnerabilityAssessmentName; } >; @@ -208,6 +211,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key + @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. vulnerabilityAssessmentName: VulnerabilityAssessmentName; /** diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 46d0ae43e6dd..4add08105c80 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1449,7 +1449,11 @@ union SqlNameAvailabilityResourceType { ); // --- Enum value renames to match v1.4.0 contract --- -@@clientName(CatalogCollationType.DATABASE_DEFAULT, "DatabaseDefault", "csharp"); +@@clientName( + CatalogCollationType.DATABASE_DEFAULT, + "DatabaseDefault", + "csharp" +); @@clientName( CatalogCollationType.SQL_Latin1_General_CP1_CI_AS, "SqlLatin1GeneralCp1CiAs", @@ -1503,7 +1507,11 @@ union SqlNameAvailabilityResourceType { ); @@usage(SecurityEvent, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage(ServerOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); -@@usage(InstancePoolOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + InstancePoolOperation, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); @@usage( RefreshExternalGovernanceStatusOperationResultMI, Azure.ClientGenerator.Core.Usage.input, @@ -1568,16 +1576,21 @@ union SqlNameAvailabilityResourceType { "csharp" ); @@usage(SubscriptionUsage, Azure.ClientGenerator.Core.Usage.input, "csharp"); -@@usage(SyncAgentLinkedDatabase, Azure.ClientGenerator.Core.Usage.input, "csharp"); +@@usage( + SyncAgentLinkedDatabase, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); @@usage( VulnerabilityAssessmentScanRecord, Azure.ClientGenerator.Core.Usage.input, "csharp" ); - -// Standalone setter regressions: input models / input contents whose -// containing model already has a ctor in v1.4.0 but lost individual -// setters because codegen no longer sees them as inputs. +@@usage( + RestorableDroppedDatabase, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); @@usage(DatabaseExtensions, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage(TdeCertificate, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage( @@ -1637,7 +1650,6 @@ union SqlNameAvailabilityResourceType { @@clientName(StorageCapabilityStorageAccountType.ZRS, "Zrs", "csharp"); @@clientName(StorageCapabilityStorageAccountType.GZRS, "Gzrs", "csharp"); -// --- Property casing fixes (IP/IPv6 capitalization, etc.) --- @@clientName( ServerFirewallRuleProperties.startIpAddress, "StartIPAddress", @@ -1654,19 +1666,14 @@ union SqlNameAvailabilityResourceType { "SnaLu6Point2TransactionsEnabled", "csharp" ); -// --- Rename operations to match v1.4.0 method names (ApiCompat) --- -@@clientName( - DeletedServersOperationGroup.list, - "GetDeletedServers", - "csharp" -); +@@clientName(DeletedServersOperationGroup.list, "GetDeletedServers", "csharp"); @@clientName( SyncGroupsOperationGroup.listSyncDatabaseIds, "GetSyncDatabaseIdsSyncGroups", "csharp" ); -// SqlDatabaseResource sensitivity-label operations: v1.4 exposed long descriptive names. +@@clientName(Databases.create, "CreateRestorePoint", "csharp"); @@clientName( Databases.listCurrentByDatabase, "GetCurrentSensitivityLabels", @@ -1687,3 +1694,26 @@ union SqlNameAvailabilityResourceType { "UpdateSensitivityLabel", "csharp" ); +@@clientName(Databases.cancel, "CancelDatabaseOperation", "csharp"); +@@clientName( + ImportExportExtensionsOperationResults.createOrUpdate, + "CreateOrUpdateDatabaseExtension", + "csharp" +); +@@clientName(Databases.listByDatabase, "GetDatabaseColumns", "csharp"); +@@clientName( + Databases.databaseOperationsListByDatabase, + "GetDatabaseOperations", + "csharp" +); +@@clientName( + Databases.revalidate, + "RevalidateDatabaseEncryptionProtector", + "csharp" +); +@@clientName(Databases.revert, "RevertDatabaseEncryptionProtector", "csharp"); +@@alternateType( + SqlVulnerabilityAssessmentName, + VulnerabilityAssessmentName, + "csharp" +); From 536ca047b54c28bcc9d54cd0002ed601a47ecfa7 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 18 Jun 2026 00:33:29 +0800 Subject: [PATCH 09/19] update --- .../Microsoft.Sql/SQL/client.tsp | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 4add08105c80..ac4f67fcf841 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1057,25 +1057,45 @@ using Microsoft.Sql; "csharp" ); @@clientName( - LongTermRetentionBackupsOperationGroup.listByResourceGroupLocation, + LongTermRetentionBackupsOperationGroup.listByLocation, "GetLongTermRetentionBackupsWithLocation", "csharp" ); @@clientName( - LongTermRetentionBackupsOperationGroup.listByResourceGroupServer, + LongTermRetentionBackupsOperationGroup.listByResourceGroupLocation, + "GetLongTermRetentionBackupsWithResourceGroupLocation", + "csharp" +); +@@clientName( + LongTermRetentionBackupsOperationGroup.listByServer, "GetLongTermRetentionBackupsWithServer", "csharp" ); @@clientName( - LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupInstance, + LongTermRetentionBackupsOperationGroup.listByResourceGroupServer, + "GetLongTermRetentionBackupsWithResourceGroupServer", + "csharp" +); +@@clientName( + LongTermRetentionManagedInstanceBackupsOperationGroup.listByInstance, "GetLongTermRetentionManagedInstanceBackupsWithInstance", "csharp" ); @@clientName( - LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupLocation, + LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupInstance, + "GetLongTermRetentionManagedInstanceBackupsWithResourceGroupInstance", + "csharp" +); +@@clientName( + LongTermRetentionManagedInstanceBackupsOperationGroup.listByLocation, "GetLongTermRetentionManagedInstanceBackupsWithLocation", "csharp" ); +@@clientName( + LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupLocation, + "GetLongTermRetentionManagedInstanceBackupsWithResourceGroupLocation", + "csharp" +); @@clientName(SqlVulnerabilityAssessments.execute, "ExecuteScan", "csharp"); @@clientName( SqlVulnerabilityAssessmentsSettings.execute, From bd93e578eecee40eefc2bb63879d09f77d2ada90 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 18 Jun 2026 01:53:35 +0800 Subject: [PATCH 10/19] update --- .../resource-manager/Microsoft.Sql/SQL/client.tsp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index ac4f67fcf841..f731e73c6b43 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1737,3 +1737,17 @@ union SqlNameAvailabilityResourceType { VulnerabilityAssessmentName, "csharp" ); + +// we add this model in this namespace in order to replace some models with this model via alternateType decorator +namespace Azure.ResourceManager.Models { + /** represents a reference to an existing resource by its id */ + model SubResource { + /** the id */ + id?: armResourceIdentifier; + } +} +@@alternateType( + SyncDatabaseIdProperties, + Azure.ResourceManager.Models.SubResource, + "csharp" +); \ No newline at end of file From a47315fbee2bd1d4df12623b49409cc2976da71a Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 18 Jun 2026 17:37:40 +0800 Subject: [PATCH 11/19] update --- .../SQL/ServerBlobAuditingPolicy.tsp | 3 +- .../Microsoft.Sql/SQL/client.tsp | 91 +++++++++++++++++-- .../Microsoft.Sql/SQL/models.tsp | 19 +++- .../preview/2025-02-01-preview/common.json | 8 +- .../2025-02-01-preview/serverUsages.json | 11 +++ .../SQL/stable/2025-01-01/common.json | 8 +- .../SQL/stable/2025-01-01/serverUsages.json | 11 +++ 7 files changed, 141 insertions(+), 10 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerBlobAuditingPolicy.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerBlobAuditingPolicy.tsp index 7d8256fc493f..a27ee1120737 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerBlobAuditingPolicy.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerBlobAuditingPolicy.tsp @@ -40,7 +40,8 @@ alias ServerBlobAuditingPoliciesOps = Azure.ResourceManager.Legacy.LegacyOperati @key serverName: string; }, - ServerBlobAuditingPolicyNameAlias + ServerBlobAuditingPolicyNameAlias, + ResourceName = "SqlServerBlobAuditingPolicy" >; #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index f731e73c6b43..26d11ae53b15 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1327,7 +1327,20 @@ union SqlNameAvailabilityResourceType { SqlNameAvailabilityResourceType, "csharp" ); +@@usage( + RecommendedSensitivityLabelUpdateProperties, + | Azure.ClientGenerator.Core.Usage.input + | Azure.ClientGenerator.Core.Usage.output, + "csharp" +); +@@usage( + RecommendedSensitivityLabelUpdate, + + | Azure.ClientGenerator.Core.Usage.input + | Azure.ClientGenerator.Core.Usage.output, + "csharp" +); @@usage(EndpointCertificate, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage(DatabaseColumn, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@clientName( @@ -1408,11 +1421,7 @@ union SqlNameAvailabilityResourceType { @@alternateType(ManagedInstanceOperation.name, uuid, "csharp"); @@alternateType(InstancePoolOperation.name, uuid, "csharp"); @@clientName(ElasticPools.cancel, "CancelElasticPoolOperation", "csharp"); -@@clientName( - ManagedInstancePrivateEndpointConnectionProperties.privateLinkServiceConnectionState, - "ConnectionState", - "csharp" -); + @@clientName( ManagedInstances.create, "CreateManagedInstanceTdeCertificate", @@ -1428,6 +1437,9 @@ union SqlNameAvailabilityResourceType { "content", "csharp" ); +@@clientName(ServerUsageProperties.nextResetTime, "NextResetOn", "csharp"); +@@clientName(ResourceWithWritableName.type, "ResourceType", "csharp"); +@@alternateType(ResourceWithWritableName.type, armResourceType, "csharp"); #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Back compatibility" @@Azure.ClientGenerator.Core.Legacy.hierarchyBuilding( @@ -1624,6 +1636,56 @@ union SqlNameAvailabilityResourceType { "csharp" ); +// Setter regressions vs v1.4.0: add Usage.input on the model and its inner *Properties bag +// so that flat-projected properties are emitted with public setters and list properties +// are emitted as IList rather than IReadOnlyList. +@@usage( + RecommendedSensitivityLabelUpdate, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + RecommendedSensitivityLabelUpdateProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + SensitivityLabelUpdate, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + SensitivityLabelUpdateProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + DatabaseExtensionsProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + TdeCertificateProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage( + QueryStatisticsProperties, + Azure.ClientGenerator.Core.Usage.input, + "csharp" +); +@@usage(QueryMetricInterval, Azure.ClientGenerator.Core.Usage.input, "csharp"); + @@clientName(AvailabilityZoneType.`1`, "One", "csharp"); @@clientName(AvailabilityZoneType.`2`, "Two", "csharp"); @@clientName(AvailabilityZoneType.`3`, "Three", "csharp"); @@ -1737,6 +1799,12 @@ union SqlNameAvailabilityResourceType { VulnerabilityAssessmentName, "csharp" ); +@@clientName(LegacyDataMaskingFunction.CCN, "Ccn", "csharp"); +@@clientName(LegacyDataMaskingFunction.SSN, "Ssn", "csharp"); +@@clientName(DataMaskingFunction.CCN, "Ccn", "csharp"); +@@clientName(DataMaskingFunction.SSN, "Ssn", "csharp"); +@@clientName(RestorePointType.CONTINUOUS, "Continuous", "csharp"); +@@clientName(RestorePointType.DISCRETE, "Discrete", "csharp"); // we add this model in this namespace in order to replace some models with this model via alternateType decorator namespace Azure.ResourceManager.Models { @@ -1750,4 +1818,15 @@ namespace Azure.ResourceManager.Models { SyncDatabaseIdProperties, Azure.ResourceManager.Models.SubResource, "csharp" -); \ No newline at end of file +); + +// Change the BlobAuditingPolicyName from fixed enum to extensible enum +/** + * The name of the blob auditing policy. + */ +union BlobAuditingPolicyNameType { + BlobAuditingPolicyName, + string, +} +@@alternateType(BlobAuditingPolicyName, BlobAuditingPolicyNameType, "csharp"); +@@clientName(BlobAuditingPolicyNameType, "BlobAuditingPolicyName", "csharp"); diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp index ce598ee45a3a..6d62ec12c2e2 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp @@ -2959,6 +2959,11 @@ union ServerNetworkAccessFlag { * Disabled */ Disabled: "Disabled", + + /** + * SecuredByPerimeter + */ + SecuredByPerimeter: "SecuredByPerimeter", } /** @@ -4065,7 +4070,7 @@ enum BlobAuditingPolicyName { /** * default */ - default, + default } #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" @@ -14663,6 +14668,18 @@ model ServerUsageProperties { */ @visibility(Lifecycle.Read) unit?: string; + + /** + * The name of the resource. + */ + @visibility(Lifecycle.Read) + resourceName?: string; + + /** + * The next reset time for the metric (ISO8601 format). + */ + @visibility(Lifecycle.Read) + nextResetTime?: utcDateTime; } /** diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/common.json b/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/common.json index b820fb47897f..250689319333 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/common.json +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/common.json @@ -6814,7 +6814,8 @@ "description": "Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'", "enum": [ "Enabled", - "Disabled" + "Disabled", + "SecuredByPerimeter" ], "x-ms-enum": { "name": "ServerNetworkAccessFlag", @@ -6829,6 +6830,11 @@ "name": "Disabled", "value": "Disabled", "description": "Disabled" + }, + { + "name": "SecuredByPerimeter", + "value": "SecuredByPerimeter", + "description": "SecuredByPerimeter" } ] } diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/serverUsages.json b/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/serverUsages.json index aa16771ada53..cefe4756b220 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/serverUsages.json +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/preview/2025-02-01-preview/serverUsages.json @@ -157,6 +157,17 @@ "type": "string", "description": "Unit of the metric.", "readOnly": true + }, + "resourceName": { + "type": "string", + "description": "The name of the resource.", + "readOnly": true + }, + "nextResetTime": { + "type": "string", + "format": "date-time", + "description": "The next reset time for the metric (ISO8601 format).", + "readOnly": true } } } diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/common.json b/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/common.json index 30ca3b83457e..5b3c50d0685a 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/common.json +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/common.json @@ -6774,7 +6774,8 @@ "description": "Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'", "enum": [ "Enabled", - "Disabled" + "Disabled", + "SecuredByPerimeter" ], "x-ms-enum": { "name": "ServerNetworkAccessFlag", @@ -6789,6 +6790,11 @@ "name": "Disabled", "value": "Disabled", "description": "Disabled" + }, + { + "name": "SecuredByPerimeter", + "value": "SecuredByPerimeter", + "description": "SecuredByPerimeter" } ] } diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/serverUsages.json b/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/serverUsages.json index e3038ffce2ad..6530167113b2 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/serverUsages.json +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/serverUsages.json @@ -157,6 +157,17 @@ "type": "string", "description": "Unit of the metric.", "readOnly": true + }, + "resourceName": { + "type": "string", + "description": "The name of the resource.", + "readOnly": true + }, + "nextResetTime": { + "type": "string", + "format": "date-time", + "description": "The next reset time for the metric (ISO8601 format).", + "readOnly": true } } } From 3feacad274fc0d5e9a6dd03deccc3a9875371ce8 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 18 Jun 2026 19:23:20 +0800 Subject: [PATCH 12/19] update --- .../Microsoft.Sql/SQL/client.tsp | 21 +++++++++++++++++++ .../Microsoft.Sql/SQL/models.tsp | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 26d11ae53b15..9b30b4a9ccf2 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -394,6 +394,27 @@ using Microsoft.Sql; "csharp" ); @@clientName(MinimalTlsVersion, "SqlMinimalTlsVersion", "csharp"); +@@clientName(MinimalTlsVersion.None, "TlsNone", "csharp"); +@@clientName( + MinimalTlsVersion.`1.0`, + Azure.ClientGenerator.Core.exact("Tls1_0"), + "csharp" +); +@@clientName( + MinimalTlsVersion.`1.1`, + Azure.ClientGenerator.Core.exact("Tls1_1"), + "csharp" +); +@@clientName( + MinimalTlsVersion.`1.2`, + Azure.ClientGenerator.Core.exact("Tls1_2"), + "csharp" +); +@@clientName( + MinimalTlsVersion.`1.3`, + Azure.ClientGenerator.Core.exact("Tls1_3"), + "csharp" +); @@clientName(BackupStorageAccessTier, "SqlBackupStorageAccessTier", "csharp"); @@clientName(Phase, "DatabaseOperationPhase", "csharp"); @@clientName(PhaseDetails, "DatabaseOperationPhaseDetails", "csharp"); diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp index 6d62ec12c2e2..7338f0be668f 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp @@ -4070,7 +4070,7 @@ enum BlobAuditingPolicyName { /** * default */ - default + default, } #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" From c1eb0d7da00b91538027b832c26b711f93318d5f Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 18 Jun 2026 21:50:29 +0800 Subject: [PATCH 13/19] Fix typo in comment for SqlNameAvailabilityResourceType regarding round trippable models --- specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 9b30b4a9ccf2..c9e72977ef34 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1521,7 +1521,7 @@ union SqlNameAvailabilityResourceType { // (v1.4.0 ApiCompat mitigations) // // Marking these models as `Usage.input` makes the C# generator emit them -// as roundtrippable (Input | Output), which restores the public +// as round trippable (Input | Output), which restores the public // parameterless constructor and writable property setters that the // v1.4.0 contract exposed. // ===================================================================== From 8ce832ac8ec084999e320fd452da9caf9460e655 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Sat, 20 Jun 2026 21:39:06 +0800 Subject: [PATCH 14/19] Remove deprecated comments and clean up SqlNameAvailabilityResourceType usage definitions --- .../resource-manager/Microsoft.Sql/SQL/client.tsp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index c9e72977ef34..5d52885f8b24 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1500,8 +1500,6 @@ union SqlNameAvailabilityResourceType { azureLocation, "csharp" ); - -// --- Enum value renames to match v1.4.0 contract --- @@clientName( CatalogCollationType.DATABASE_DEFAULT, "DatabaseDefault", @@ -1516,15 +1514,6 @@ union SqlNameAvailabilityResourceType { @@clientName(DiffBackupIntervalInHours.`12`, "Twelve", "csharp"); @@clientName(DiffBackupIntervalInHours.`24`, "TwentyFour", "csharp"); -// ===================================================================== -// Restore parameterless ctor + setters for output-only models -// (v1.4.0 ApiCompat mitigations) -// -// Marking these models as `Usage.input` makes the C# generator emit them -// as round trippable (Input | Output), which restores the public -// parameterless constructor and writable property setters that the -// v1.4.0 contract exposed. -// ===================================================================== @@usage(DatabaseOperation, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage(DatabaseUsage, Azure.ClientGenerator.Core.Usage.input, "csharp"); @@usage( @@ -1657,9 +1646,6 @@ union SqlNameAvailabilityResourceType { "csharp" ); -// Setter regressions vs v1.4.0: add Usage.input on the model and its inner *Properties bag -// so that flat-projected properties are emitted with public setters and list properties -// are emitted as IList rather than IReadOnlyList. @@usage( RecommendedSensitivityLabelUpdate, Azure.ClientGenerator.Core.Usage.input, From a76081ad094f94c10d122b7deca179bd3187433e Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 22 Jun 2026 13:47:36 +0800 Subject: [PATCH 15/19] Add DataMaskingRuleState and DataMaskingFunction client names and update tspconfig.yaml --- .../Microsoft.Sql/SQL/client.tsp | 37 +++++++++++++++++++ .../Microsoft.Sql/SQL/tspconfig.yaml | 1 - 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 5d52885f8b24..1dd3ced7fcf5 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -879,6 +879,16 @@ using Microsoft.Sql; @@clientName(AuthMetadataLookupModes.AzureAD, "Aad", "csharp"); @@clientName(ClientClassificationSource.MIP, "Mip", "csharp"); @@clientName(DataMaskingRuleProperties.id, "RuleId", "csharp"); +@@clientName( + DataMaskingRuleProperties.ruleState, + "DataMaskingRuleState", + "csharp" +); +@@clientName( + DataMaskingRuleProperties.maskingFunction, + "DataMaskingFunction", + "csharp" +); @@clientName(ReplicaSynchronizationHealth.NOT_HEALTHY, "NotHealthy", "csharp"); @@clientName( ManagedInstanceVcoresCapability.supportedMemoryLimitsMB, @@ -1808,8 +1818,35 @@ union SqlNameAvailabilityResourceType { ); @@clientName(LegacyDataMaskingFunction.CCN, "Ccn", "csharp"); @@clientName(LegacyDataMaskingFunction.SSN, "Ssn", "csharp"); +// Rename the extensible `DataMaskingFunction` union and `DataMaskingRuleState` union to distinct names so the legacy fixed-enum types `DataMaskingFunction` and `DataMaskingRuleState` can be preserved in custom code for binary back-compat. +@@clientName(DataMaskingFunction, "SqlDataMaskingFunction", "csharp"); @@clientName(DataMaskingFunction.CCN, "Ccn", "csharp"); @@clientName(DataMaskingFunction.SSN, "Ssn", "csharp"); +@@clientName(DataMaskingRuleState, "SqlDataMaskingRuleState", "csharp"); +@@usage( + DataMaskingFunction, + + | Azure.ClientGenerator.Core.Usage.input + | Azure.ClientGenerator.Core.Usage.output, + "csharp" +); +@@usage( + DataMaskingRuleState, + + | Azure.ClientGenerator.Core.Usage.input + | Azure.ClientGenerator.Core.Usage.output, + "csharp" +); +@@access( + DataMaskingFunction, + Azure.ClientGenerator.Core.Access.public, + "csharp" +); +@@access( + DataMaskingRuleState, + Azure.ClientGenerator.Core.Access.public, + "csharp" +); @@clientName(RestorePointType.CONTINUOUS, "Continuous", "csharp"); @@clientName(RestorePointType.DISCRETE, "Discrete", "csharp"); diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml b/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml index 1476a194a72b..f634797c6b3f 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/tspconfig.yaml @@ -16,7 +16,6 @@ options: namespace: "Azure.ResourceManager.Sql" emitter-output-dir: "{output-dir}/sdk/sqlmanagement/{namespace}" enable-wire-path-attribute: true - api-version: "2025-01-01" "@azure-tools/typespec-java": emitter-output-dir: "{output-dir}/{service-dir}/azure-resourcemanager-sql" namespace: "com.azure.resourcemanager.sql" From e328eb1f44c12855548245f77e819a2bb467f520 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 23 Jun 2026 01:05:22 +0800 Subject: [PATCH 16/19] update --- .../Microsoft.Sql/SQL/DeletedServer.tsp | 3 +- .../SQL/InstanceFailoverGroup.tsp | 3 +- .../Microsoft.Sql/SQL/JobStep.tsp | 2 +- .../Microsoft.Sql/SQL/JobVersion.tsp | 2 +- .../SQL/LongTermRetentionBackup.tsp | 6 ++-- .../ManagedDatabaseMoveOperationResult.tsp | 3 +- ...ManagedInstanceLongTermRetentionBackup.tsp | 6 ++-- .../Microsoft.Sql/SQL/ServerTrustGroup.tsp | 3 +- .../Microsoft.Sql/SQL/SubscriptionUsage.tsp | 3 +- .../Microsoft.Sql/SQL/TimeZone.tsp | 3 +- .../Microsoft.Sql/SQL/client.tsp | 19 +++++------- .../Microsoft.Sql/SQL/routes.tsp | 30 +++++++------------ 12 files changed, 30 insertions(+), 53 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp index b5e5122a444d..a38d39894a6a 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/DeletedServer.tsp @@ -36,8 +36,7 @@ alias DeletedServersOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; }, { /** The name of the deleted server. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp index c98a46afae78..ebdd2d894f35 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/InstanceFailoverGroup.tsp @@ -37,8 +37,7 @@ alias InstanceFailoverGroupsOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; }, { /** The name of the failover group. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp index 15f60176b632..de8291daee5e 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp @@ -118,7 +118,7 @@ alias JobStepOperationGroupOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("versions") @key - @Azure.ClientGenerator.Core.alternateType(string) // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. Make this csharp only because it's the only language that stricktly forces the type of the resource name to be string. jobVersion: int32; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp index cfff7b47d24d..669ca59631ef 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp @@ -57,7 +57,7 @@ alias JobVersionOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("versions") @key - @Azure.ClientGenerator.Core.alternateType(string) // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. Make this csharp only because it's the only language that stricktly forces the type of the resource name to be string. jobVersion: int32; } >; diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp index 76b52618e408..4900652c27f7 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/LongTermRetentionBackup.tsp @@ -41,8 +41,7 @@ alias LongTermRetentionBackupOps = Azure.ResourceManager.Legacy.LegacyOperations @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** The name of the server */ @path @@ -200,8 +199,7 @@ alias LongTermRetentionBackupOperationGroupOps = Azure.ResourceManager.Legacy.Le @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** The name of the server */ @path diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp index 06b09859727c..aeea9eb20faf 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedDatabaseMoveOperationResult.tsp @@ -37,8 +37,7 @@ alias ManagedDatabaseMoveOperationResultsOps = Azure.ResourceManager.Legacy.Lega @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; }, { /** The ID of the managed database move operation. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp index 718f77722380..c3d0bd32db9f 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ManagedInstanceLongTermRetentionBackup.tsp @@ -43,8 +43,7 @@ alias ManagedInstanceLongTermRetentionBackupOps = Azure.ResourceManager.Legacy.L @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** The name of the managed instance. */ @path @@ -122,8 +121,7 @@ alias LongTermRetentionManagedInstanceBackupOps = Azure.ResourceManager.Legacy.L @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** The name of the managed instance. */ @path diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp index deacf3ef84e5..2bf348ed9472 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/ServerTrustGroup.tsp @@ -37,8 +37,7 @@ alias ServerTrustGroupsOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; }, { /** The name of the server trust group. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp index f932eeef0e3c..69c5a7f94494 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SubscriptionUsage.tsp @@ -36,8 +36,7 @@ alias SubscriptionUsagesOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; }, { /** Name of usage metric to return. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp index cba1f7f0e15c..9ebe9d8d332a 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/TimeZone.tsp @@ -35,8 +35,7 @@ alias TimeZonesOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("locations") @key - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; }, { /** The time zone ID. */ diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp index 1dd3ced7fcf5..6c0e4fcb169a 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/client.tsp @@ -1458,16 +1458,7 @@ union SqlNameAvailabilityResourceType { "CreateManagedInstanceTdeCertificate", "csharp" ); -@@clientName( - LongTermRetentionBackups.changeAccessTier::parameters.body, - "content", - "csharp" -); -@@clientName( - LongTermRetentionBackupOperationGroup.changeAccessTierByResourceGroup::parameters.body, - "content", - "csharp" -); + @@clientName(ServerUsageProperties.nextResetTime, "NextResetOn", "csharp"); @@clientName(ResourceWithWritableName.type, "ResourceType", "csharp"); @@alternateType(ResourceWithWritableName.type, armResourceType, "csharp"); @@ -1720,7 +1711,12 @@ union SqlNameAvailabilityResourceType { "SqlServer2025", "csharp" ); - +@@clientName( + ManagedInstanceDtcProperties.fqdnEnabled, + "IsFqdnEnabled", + "csharp" +); +@@alternateType(SyncGroupsType, SyncGroupLogType, "csharp"); @@clientName(PerformanceLevelUnit.DTU, "Dtu", "csharp"); @@clientName(ReplicationState.PENDING, "Pending", "csharp"); @@ -1811,6 +1807,7 @@ union SqlNameAvailabilityResourceType { "csharp" ); @@clientName(Databases.revert, "RevertDatabaseEncryptionProtector", "csharp"); +@@clientName(Jobs.create, "StartJobExecution", "csharp"); @@alternateType( SqlVulnerabilityAssessmentName, VulnerabilityAssessmentName, diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp index ef701d30403c..d2e509500fe7 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/routes.tsp @@ -53,8 +53,7 @@ interface CapabilitiesOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * If specified, restricts the response to only include the selected item. @@ -87,8 +86,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * Whether or not to only get the latest backup for each database. @@ -120,8 +118,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * The name of the server @@ -160,8 +157,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * Whether or not to only get the latest backup for each database. @@ -193,8 +189,7 @@ interface LongTermRetentionBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * The name of the server @@ -242,8 +237,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * Whether or not to only get the latest backup for each database. @@ -293,8 +287,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * The name of the managed instance. @@ -333,8 +326,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * Whether or not to only get the latest backup for each database. @@ -384,8 +376,7 @@ interface LongTermRetentionManagedInstanceBackupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; /** * The name of the managed instance. @@ -448,8 +439,7 @@ interface SyncGroupsOperationGroup { */ @path @segment("locations") - @Azure.ClientGenerator.Core.alternateType(Azure.Core.azureLocation) // The type of this parameter is Azure location. - locationName: string; + locationName: Azure.Core.azureLocation; } >; } From 99e03e9a0d36441dfc1904bfa460b0c19d19a6b1 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 23 Jun 2026 01:10:59 +0800 Subject: [PATCH 17/19] Update alternateType annotations for vulnerabilityAssessmentName to specify C# type --- .../Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp index 49c3f7690706..589ddc747dd6 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/SqlVulnerabilityAssessment.tsp @@ -98,7 +98,7 @@ interface SqlVulnerabilityAssessments { @path @segment("sqlVulnerabilityAssessments") @key - @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string for C#. vulnerabilityAssessmentName: VulnerabilityAssessmentName; } >; @@ -137,7 +137,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key - @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string for C#. vulnerabilityAssessmentName: SqlVulnerabilityAssessmentName; } >; @@ -157,7 +157,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key - @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string for C#. vulnerabilityAssessmentName: VulnerabilityAssessmentName; } >; @@ -177,7 +177,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key - @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string for C#. vulnerabilityAssessmentName: VulnerabilityAssessmentName; } >; @@ -211,7 +211,7 @@ interface SqlVulnerabilityAssessmentsSettings { @path @segment("sqlVulnerabilityAssessments") @key - @Azure.ClientGenerator.Core.alternateType(string) // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The vulnerabilityAssessmentName is name of the resource SqlVulnerabilityAssessment which must be a string for C#. vulnerabilityAssessmentName: VulnerabilityAssessmentName; /** From 4c83d132c4acb0dc398e5fd5b2b4ae87142b1c18 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Tue, 23 Jun 2026 01:19:21 +0800 Subject: [PATCH 18/19] Fix typo in alternateType comment for jobVersion in JobStep and JobVersion models --- .../sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp | 2 +- .../sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp index de8291daee5e..b9b4763f0702 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobStep.tsp @@ -118,7 +118,7 @@ alias JobStepOperationGroupOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("versions") @key - @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. Make this csharp only because it's the only language that stricktly forces the type of the resource name to be string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. Make this csharp only because it's the only language that forces the type of the resource name to be string. jobVersion: int32; }, { diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp index 669ca59631ef..88f7c7922e8f 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/JobVersion.tsp @@ -57,7 +57,7 @@ alias JobVersionOps = Azure.ResourceManager.Legacy.LegacyOperations< @path @segment("versions") @key - @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. Make this csharp only because it's the only language that stricktly forces the type of the resource name to be string. + @Azure.ClientGenerator.Core.alternateType(string, "csharp") // The jobVersion is name of the resource JobVersion which must be a string, but the swagger defines it as int32, so we need to use alternateType to make it backwards compatible with the swagger definition. Make this csharp only because it's the only language that forces the type of the resource name to be string. jobVersion: int32; } >; From 0d39bc081ab8ea8d067735bb5ddeb46b5345a30b Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 24 Jun 2026 14:50:54 +0800 Subject: [PATCH 19/19] Refactor imports in models.tsp to improve organization and clarity --- .../sql/resource-manager/Microsoft.Sql/SQL/models.tsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp b/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp index 7338f0be668f..bd5bcb784dd9 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp +++ b/specification/sql/resource-manager/Microsoft.Sql/SQL/models.tsp @@ -2,12 +2,13 @@ import "@typespec/rest"; import "@typespec/http"; import "@azure-tools/typespec-azure-resource-manager"; import "@azure-tools/typespec-azure-core"; +import "./client.tsp"; using TypeSpec.Rest; using TypeSpec.Http; +using TypeSpec.Versioning; using Azure.ResourceManager; using Azure.ResourceManager.Foundations; -using TypeSpec.Versioning; namespace Microsoft.Sql;