Skip to content

Commit 8322c91

Browse files
azure-powershell-botBethanyZhouNickcandy
authored
Migrate ServiceBus from generation to release-2022-12-06 (Azure#20316)
* Move ServiceBus to release-2022-12-06 * Update ChangeLog.md * Update SignatureIssues.csv * Update ChangeLog.md Co-authored-by: Beisi Zhou <[email protected]> Co-authored-by: NanxiangLiu <[email protected]>
1 parent b6ba152 commit 8322c91

File tree

278 files changed

+24050
-5213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+24050
-5213
lines changed

src/ServiceBus/ServiceBus.Autorest/README.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,86 @@ directive:
100100
subject: Migration
101101

102102
# Remove namespace cmdlets
103+
# - where:
104+
# subject: Namespace
105+
# remove: true
106+
107+
# Renaming New-AzServiceBusNamespace
103108
- where:
109+
verb: New
104110
subject: Namespace
105-
remove: true
111+
parameter-name: EncryptionRequireInfrastructureEncryption
112+
set:
113+
parameter-name: RequireInfrastructureEncryption
114+
- where:
115+
model-name: SbNamespace
116+
property-name: EncryptionRequireInfrastructureEncryption
117+
set:
118+
property-name: RequireInfrastructureEncryption
119+
120+
- where:
121+
verb: New
122+
subject: Namespace
123+
parameter-name: EncryptionKeyVaultProperty
124+
set:
125+
parameter-name: KeyVaultProperty
126+
- where:
127+
model-name: SbNamespace
128+
property-name: EncryptionKeyVaultProperty
129+
set:
130+
property-name: KeyVaultProperty
131+
132+
- where:
133+
verb: New
134+
subject: Namespace
135+
parameter-name: EncryptionKeySource
136+
set:
137+
parameter-name: KeySource
138+
- where:
139+
model-name: SbNamespace
140+
property-name: EncryptionKeySource
141+
set:
142+
property-name: KeySource
143+
144+
- where:
145+
verb: New
146+
subject: Namespace
147+
parameter-name: IdentityUserAssignedIdentity
148+
set:
149+
parameter-name: UserAssignedIdentity
150+
- where:
151+
model-name: SbNamespace
152+
property-name: IdentityUserAssignedIdentity
153+
set:
154+
property-name: UserAssignedIdentity
155+
156+
- where:
157+
model-name: SbNamespace
158+
property-name: IdentityPrincipalId
159+
set:
160+
property-name: PrincipalId
161+
162+
- where:
163+
model-name: SbNamespace
164+
property-name: IdentityTenantId
165+
set:
166+
property-name: TenantId
167+
168+
- where:
169+
model-name: KeyVaultProperties
170+
property-name: IdentityUserAssignedIdentity
171+
set:
172+
property-name: UserAssignedIdentity
173+
174+
- where:
175+
subject: Namespace
176+
set:
177+
subject: NamespaceV2
178+
179+
- where:
180+
verb: New
181+
subject: NamespaceV2
182+
hide: true
106183

107184
# Rules
108185
- where:
@@ -437,3 +514,6 @@ directive:
437514
set:
438515
parameter-name: SubscriptionId
439516
clear-alias: true
517+
518+
- model-cmdlet:
519+
- KeyVaultProperties

src/ServiceBus/ServiceBus.Autorest/build-module.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ $examplesFolder = Join-Path $PSScriptRoot 'examples'
122122
$null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

124124
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
125-
$modelCmdlets = @()
125+
$modelCmdlets = @('KeyVaultProperties')
126126
if ($modelCmdlets.Count -gt 0) {
127127
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
128128
CreateModelCmdlet($modelCmdlets)

src/ServiceBus/ServiceBus.Autorest/create-model-cmdlets.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Create an in-memory object for ${ObjectType}.
158158
.Outputs
159159
${ObjectTypeWithNamespace}
160160
.Link
161-
https://docs.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
161+
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162162
#>
163163
function New-Az${ModulePrefix}${ObjectType}Object {
164164
[OutputType('${ObjectTypeWithNamespace}')]
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# ----------------------------------------------------------------------------------
2+
#
3+
# Copyright Microsoft Corporation
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# ----------------------------------------------------------------------------------
14+
15+
<#
16+
.Synopsis
17+
Creates a new ServiceBus namespace.
18+
.Description
19+
Creates a new ServiceBus namespace.
20+
#>
21+
22+
function New-AzServiceBusNamespaceV2{
23+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbNamespace])]
24+
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
25+
param(
26+
[Parameter(Mandatory, HelpMessage = "The name of ServiceBusNamespace")]
27+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Path')]
28+
[System.String]
29+
${Name},
30+
31+
[Parameter(Mandatory, HelpMessage = "The name of the ResourceGroupName.")]
32+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Path')]
33+
[System.String]
34+
${ResourceGroupName},
35+
36+
[Parameter(HelpMessage = "The ID of the target subscription.")]
37+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Path')]
38+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Runtime.DefaultInfo(Script = '(Get-AzContext).Subscription.Id')]
39+
[System.String]
40+
# The ID of the target subscription.
41+
${SubscriptionId},
42+
43+
[Parameter(Mandatory, HelpMessage = "Resource Location.")]
44+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
45+
[System.String]
46+
${Location},
47+
48+
[Parameter(HelpMessage = "Alternate name for namespace")]
49+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
50+
[System.String]
51+
${AlternateName},
52+
53+
[Parameter(HelpMessage = "This property disables SAS authentication for the Service Bus namespace.")]
54+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
55+
[System.Management.Automation.SwitchParameter]
56+
${DisableLocalAuth},
57+
58+
[Parameter(HelpMessage = "Properties of KeyVault")]
59+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
60+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IKeyVaultProperties[]]
61+
${KeyVaultProperty},
62+
63+
[Parameter(HelpMessage = "Enable Infrastructure Encryption (Double Encryption)")]
64+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
65+
[System.Management.Automation.SwitchParameter]
66+
${RequireInfrastructureEncryption},
67+
68+
[Parameter(HelpMessage = "Type of managed service identity.")]
69+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
70+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Support.ManagedServiceIdentityType]
71+
${IdentityType},
72+
73+
[Parameter(HelpMessage = "Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones.")]
74+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
75+
[System.Management.Automation.SwitchParameter]
76+
${ZoneRedundant},
77+
78+
[Parameter(HelpMessage = "Properties for User Assigned Identities")]
79+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
80+
[System.String[]]
81+
${UserAssignedIdentityId},
82+
83+
[Parameter(HelpMessage = "The minimum TLS version for the cluster to support, e.g. '1.2'")]
84+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
85+
#[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Support.TlsVersion]
86+
[System.String]
87+
${MinimumTlsVersion},
88+
89+
[Parameter(HelpMessage = "This determines if traffic is allowed over public network. By default it is enabled.")]
90+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
91+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Support.PublicNetworkAccess]
92+
${PublicNetworkAccess},
93+
94+
[Parameter(HelpMessage = "Name of this SKU.")]
95+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
96+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Support.SkuName]
97+
${SkuName},
98+
99+
[Parameter(HelpMessage = "The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4.")]
100+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
101+
[System.Int32]
102+
${SkuCapacity},
103+
104+
[Parameter(HelpMessage = "Resource tags.")]
105+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
106+
[System.Collections.Hashtable]
107+
${Tag},
108+
109+
[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
110+
[Alias('AzureRMContext', 'AzureCredential')]
111+
[ValidateNotNull()]
112+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Azure')]
113+
[System.Management.Automation.PSObject]
114+
${DefaultProfile},
115+
116+
[Parameter(HelpMessage = "Run the command as a job")]
117+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
118+
[System.Management.Automation.SwitchParameter]
119+
# Run the command as a job
120+
${AsJob},
121+
122+
[Parameter(DontShow)]
123+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
124+
[System.Management.Automation.SwitchParameter]
125+
# Wait for .NET debugger to attach
126+
${Break},
127+
128+
[Parameter(DontShow)]
129+
[ValidateNotNull()]
130+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
131+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Runtime.SendAsyncStep[]]
132+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
133+
${HttpPipelineAppend},
134+
135+
[Parameter(DontShow)]
136+
[ValidateNotNull()]
137+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
138+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Runtime.SendAsyncStep[]]
139+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
140+
${HttpPipelinePrepend},
141+
142+
[Parameter(HelpMessage = "Run the command asynchronously")]
143+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
144+
[System.Management.Automation.SwitchParameter]
145+
# Run the command asynchronously
146+
${NoWait},
147+
148+
[Parameter(DontShow)]
149+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
150+
[System.Uri]
151+
# The URI for the proxy server to use
152+
${Proxy},
153+
154+
[Parameter(DontShow)]
155+
[ValidateNotNull()]
156+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
157+
[System.Management.Automation.PSCredential]
158+
# Credentials for a proxy server to use for the remote call
159+
${ProxyCredential},
160+
161+
[Parameter(DontShow)]
162+
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Runtime')]
163+
[System.Management.Automation.SwitchParameter]
164+
# Use the default credentials for the proxy
165+
${ProxyUseDefaultCredentials}
166+
)
167+
process{
168+
try{
169+
$null = $PSBoundParameters.Remove('WhatIf')
170+
$null = $PSBoundParameters.Remove('Confirm')
171+
if($PSBoundParameters.ContainsKey('SkuName')){
172+
$PSBoundParameters.Add('SkuTier', $SkuName)
173+
}
174+
175+
if($PSBoundParameters.ContainsKey('KeyVaultProperty')){
176+
$PSBoundParameters.Add('KeySource', 'Microsoft.KeyVault')
177+
}
178+
if($PSBoundParameters.ContainsKey('UserAssignedIdentityId')){
179+
$identityHashTable = @{}
180+
181+
foreach ($resourceID in $UserAssignedIdentityId){
182+
$identityHashTable.Add($resourceID, [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.UserAssignedIdentity]::new())
183+
}
184+
185+
$PSBoundParameters.Add("UserAssignedIdentity", $identityHashTable)
186+
$null = $PSBoundParameters.Remove("UserAssignedIdentityId")
187+
}
188+
if ($PSCmdlet.ShouldProcess("ServiceBusNamespace $($serviceBusNamespace.Name)", "Create or update")) {
189+
Az.ServiceBus.private\New-AzServiceBusNamespaceV2_CreateExpanded @PSBoundParameters
190+
}
191+
}
192+
catch{
193+
throw
194+
}
195+
}
196+
}

0 commit comments

Comments
 (0)