Skip to content

Commit bdfce35

Browse files
[EventHub ServiceBus] Added breaking change messages to cmdlets (#19311)
* Added breaking change messages to application groups * Adding notification to cmdlets * Adding notifications * Notification * adding notification * adding notification * adding notification * adding notification * adding notification * adding notification * adding notification * adding notification
1 parent d66e253 commit bdfce35

File tree

94 files changed

+292
-11
lines changed

Some content is hidden

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

94 files changed

+292
-11
lines changed

src/EventHub/EventHub/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* In the upcoming major breaking change release in October 2022, Az.EventHub would be migrating most cmdlets to a new format
22+
for a better powershell experience and as a result would witness breaking changes. Please refer our migration guide to know more https://go.microsoft.com/fwlink/?linkid=2204690.
2123

2224
## Version 2.2.0
2325
* Added -MinimumTlsVersion to New-AzEventHubNamespace and Set-AzEventHubNamespace

src/EventHub/EventHub/Cmdlets/ApplicationGroups/GetAzureEventHubsApplicationGroup.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1919
using System;
2020
using System.Management.Automation;
21+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2122

2223
namespace Microsoft.Azure.Commands.EventHub.Commands.AppicationGroups
2324
{
25+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to `Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup`", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2426
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubApplicationGroup", DefaultParameterSetName = ApplicationGroupPropertiesParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSEventHubApplicationGroupAttributes))]
2527
public class GetEventHubsApplicationGroups : AzureEventHubsCmdletBase
2628
{
@@ -36,6 +38,7 @@ public class GetEventHubsApplicationGroups : AzureEventHubsCmdletBase
3638
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupPropertiesParameterSet, Position = 2, HelpMessage = "Application Group Name")]
3739
public string Name { get; set; }
3840

41+
[CmdletParameterBreakingChange("ResourceId", ReplaceMentCmdletParameterName = "InputObject", ChangeDescription = "Format of resource id must be /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName}. Namespace resource id can no longer be used for list calls.")]
3942
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupResourceIdParameterSet, Position = 0, HelpMessage = "Resource Id of application group or namespace")]
4043
public string ResourceId { get; set; }
4144

src/EventHub/EventHub/Cmdlets/ApplicationGroups/NewAzureEventHubsApplicationGroup.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1818
using System;
1919
using System.Management.Automation;
20+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2021

2122
namespace Microsoft.Azure.Commands.EventHub.Commands.AppicationGroups
2223
{
24+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to `Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup`", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2325
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubApplicationGroup", DefaultParameterSetName = ApplicationGroupPropertiesParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSEventHubApplicationGroupAttributes))]
2426
public class NewAzureEventHubsApplicationGroups : AzureEventHubsCmdletBase
2527
{
@@ -43,6 +45,7 @@ public class NewAzureEventHubsApplicationGroups : AzureEventHubsCmdletBase
4345
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupPropertiesParameterSet, HelpMessage = "Determines if Application Group is allowed to create connection with namespace or not. Once the isEnabled is set to false, all the existing connections of application group gets dropped and no new connections will be allowed")]
4446
public SwitchParameter IsEnabled { get; set; }
4547

48+
[CmdletParameterBreakingChange("ThrottlingPolicyConfig", OldParamaterType = typeof(PSEventHubThrottlingPolicyConfigAttributes), ReplaceMentCmdletParameterName = "Policy", NewParameterTypeName = "Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IThrottlingPolicy")]
4649
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupPropertiesParameterSet, HelpMessage = "List of Throttling Policy Objects")]
4750
public PSEventHubThrottlingPolicyConfigAttributes[] ThrottlingPolicyConfig { get; set; }
4851

src/EventHub/EventHub/Cmdlets/ApplicationGroups/NewAzureEventHubsThrottlingPolicyConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
// ----------------------------------------------------------------------------------
1414
using Microsoft.Azure.Commands.EventHub.Models;
1515
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
16+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1617
using System;
1718
using System.Management.Automation;
1819

1920

2021
namespace Microsoft.Azure.Commands.EventHub.Commands.ApplicationGroups
2122
{
23+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to `Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IThrottlingPolicy`", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2224
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubThrottlingPolicyConfig"), OutputType(typeof(PSEventHubThrottlingPolicyConfigAttributes))]
2325
public class NewAzureEventHubsThrottlingPolicyConfig: AzureEventHubsCmdletBase
2426
{

src/EventHub/EventHub/Cmdlets/ApplicationGroups/RemoveEventHubsApplicationGroup.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
using Microsoft.Azure.Commands.EventHub.Models;
1616
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1717
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
18+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1819
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1920
using System;
2021
using System.Management.Automation;
2122

2223
namespace Microsoft.Azure.Commands.EventHub.Commands.AppicationGroups
2324
{
25+
[GenericBreakingChange(BreakingChangeNotification, deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2426
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubApplicationGroup", DefaultParameterSetName = ApplicationGroupPropertiesParameterSet, SupportsShouldProcess = true), OutputType(typeof(void))]
2527
public class RemoveEventHubsApplicationGroups : AzureEventHubsCmdletBase
2628
{
@@ -37,9 +39,11 @@ public class RemoveEventHubsApplicationGroups : AzureEventHubsCmdletBase
3739
[ValidateNotNullOrEmpty]
3840
public string Name { get; set; }
3941

42+
[CmdletParameterBreakingChange("ResourceId", ReplaceMentCmdletParameterName = "InputObject")]
4043
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupResourceIdParameterSet, Position = 0, HelpMessage = "ResourceId of application group")]
4144
public string ResourceId { get; set; }
4245

46+
[CmdletParameterBreakingChange("InputObject", OldParamaterType = typeof(PSEventHubApplicationGroupAttributes), NewParameterTypeName = "Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup", ChangeDescription = ApplicationGroupInputObjectParameterSet + " parameter set is changing. Please refer the migration guide for examples.")]
4347
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = ApplicationGroupInputObjectParameterSet, Position = 0, HelpMessage = "Input Object of type PSEventHubApplicationGroupAttributes")]
4448
public PSEventHubApplicationGroupAttributes InputObject { get; set; }
4549

src/EventHub/EventHub/Cmdlets/ApplicationGroups/SetAzureEventHubsApplicationGroups.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
using Microsoft.Azure.Commands.EventHub.Models;
1616
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1717
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
18+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1819
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1920
using System;
2021
using System.Management.Automation;
2122

2223
namespace Microsoft.Azure.Commands.EventHub.Commands.AppicationGroups
2324
{
25+
26+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to `Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup`", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2427
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubApplicationGroup", DefaultParameterSetName = ApplicationGroupPropertiesParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSEventHubApplicationGroupAttributes))]
2528
public class SetAzureEventHubsApplicationGroups: AzureEventHubsCmdletBase
2629
{
@@ -41,13 +44,16 @@ public class SetAzureEventHubsApplicationGroups: AzureEventHubsCmdletBase
4144
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupResourceIdParameterSet, HelpMessage = "Determines if Application Group is allowed to create connection with namespace or not. Once the isEnabled is set to false, all the existing connections of application group gets dropped and no new connections will be allowed")]
4245
public SwitchParameter IsEnabled { get; set; }
4346

47+
[CmdletParameterBreakingChange("ThrottlingPolicyConfig", OldParamaterType = typeof(PSEventHubThrottlingPolicyConfigAttributes), ReplaceMentCmdletParameterName = "Policy", NewParameterTypeName = "Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IThrottlingPolicy")]
4448
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupPropertiesParameterSet, HelpMessage = "List of Throttling Policy Objects. Please use New-AzEventHubThrottlingPolicyConfig to create in memory object which can be one item in this list.")]
4549
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupResourceIdParameterSet, HelpMessage = "List of Throttling Policy Objects. Please use New-AzEventHubThrottlingPolicyConfig to create in memory object which can be one item in this list.")]
4650
public PSEventHubThrottlingPolicyConfigAttributes[] ThrottlingPolicyConfig { get; set; }
4751

52+
[CmdletParameterBreakingChange("ResourceId", ReplaceMentCmdletParameterName = "InputObject")]
4853
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ApplicationGroupResourceIdParameterSet, HelpMessage = "ResourceId of application group")]
4954
public string ResourceId { get; set; }
5055

56+
[CmdletParameterBreakingChange("InputObject", OldParamaterType = typeof(PSEventHubApplicationGroupAttributes), NewParameterTypeName = "Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IApplicationGroup", ChangeDescription = ApplicationGroupInputObjectParameterSet + " parameter set is changing. Please refer the migration guide for examples.")]
5157
[Parameter(Mandatory = true, ValueFromPipeline = true, ParameterSetName = ApplicationGroupInputObjectParameterSet, Position = 0, HelpMessage = "Input Object of type PSEventHubApplicationGroupAttributes")]
5258
public PSEventHubApplicationGroupAttributes InputObject { get; set; }
5359

src/EventHub/EventHub/Cmdlets/AuthorizationRule/GetAzureEventhubAuthorizationRules.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.Azure.Commands.Eventhub;
1616
using Microsoft.Azure.Commands.EventHub.Models;
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1819
using System.Collections.Generic;
1920
using System.Management.Automation;
2021

@@ -25,6 +26,7 @@ namespace Microsoft.Azure.Commands.EventHub.Commands
2526
/// <para> If AuthorizationRule name provided, a single AuthorizationRule detials will be returned</para>
2627
/// <para> If AuthorizationRule name not provided, list of AuthorizationRules will be returned</para>
2728
/// </summary>
29+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to 'Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAuthorizationRule'", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2830
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubAuthorizationRule", DefaultParameterSetName = NamespaceAuthoRuleParameterSet), OutputType(typeof(PSSharedAccessAuthorizationRuleAttributes))]
2931
public class GetAzureEventHubAuthorizationRule : AzureEventHubsCmdletBase
3032
{

src/EventHub/EventHub/Cmdlets/AuthorizationRule/GetAzureEventhubKey.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
using Microsoft.Azure.Commands.EventHub.Models;
1616
using System.Management.Automation;
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1819

1920
namespace Microsoft.Azure.Commands.EventHub.Commands
2021
{
2122
/// <summary>
2223
/// 'Get-AzRelayKey' Cmdlet gives key detials for the given Authorization Rule
2324
/// </summary>
25+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to 'Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAccessKeys'", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2426
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubKey", DefaultParameterSetName = NamespaceAuthoRuleParameterSet), OutputType(typeof(PSListKeysAttributes))]
2527
public class GetAzureEventhubKey : AzureEventHubsCmdletBase
2628
{

src/EventHub/EventHub/Cmdlets/AuthorizationRule/NewAzureEventhubAuthorizationRules.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1818
using Microsoft.Azure.Commands.EventHub.Models;
1919
using System;
20+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2021

2122
namespace Microsoft.Azure.Commands.EventHub.Commands
2223
{
2324
/// <summary>
2425
/// 'New-AzRelayAuthorizationRule' Cmdlet creates a new AuthorizationRule
2526
/// </summary>
27+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to 'Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAuthorizationRule'", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2628
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubAuthorizationRule", DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSSharedAccessAuthorizationRuleAttributes))]
2729
public class NewAzureEventhubAuthorizationRules : AzureEventHubsCmdletBase
2830
{
@@ -50,6 +52,7 @@ public class NewAzureEventhubAuthorizationRules : AzureEventHubsCmdletBase
5052
[Alias(AliasAuthorizationRuleName)]
5153
public string Name { get; set; }
5254

55+
[CmdletParameterBreakingChange("Rights", ChangeDescription = "- The output type of the parameter would change to 'Microsoft.Azure.PowerShell.Cmdlets.EventHub.Support.AccessRights[]'")]
5356
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Rights, e.g. \"" + Manage + "\",\"" + Send + "\",\"" + Listen + "\"")]
5457
[ValidateNotNullOrEmpty]
5558
[ValidateSet("Listen", "Send", "Manage", IgnoreCase = true)]

src/EventHub/EventHub/Cmdlets/AuthorizationRule/NewAzureEventhubKey.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@
1515
using Microsoft.Azure.Commands.EventHub.Models;
1616
using System.Management.Automation;
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
18+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1819

1920
namespace Microsoft.Azure.Commands.EventHub.Commands
2021
{
2122
/// <summary>
2223
/// 'New-AzRelayKey' Cmdlet creates a new specified (PrimaryKey / SecondaryKey) key for the given EventHub Authorization Rule
2324
/// </summary>
25+
[GenericBreakingChange(message: BreakingChangeNotification + "\n- Output type of the cmdlet would change to 'Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.IAccessKeys'", deprecateByVersion: DeprecateByVersion, changeInEfectByDate: ChangeInEffectByDate)]
2426
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "EventHubKey", DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(PSListKeysAttributes))]
2527
public class NewAzureEventhubKey : AzureEventHubsCmdletBase
2628
{
29+
[CmdletParameterBreakingChange("ResourceGroupName", ChangeDescription = "Parameter 'ResourceGroupName' would no longer support alias 'ResourceGroup'.")]
2730
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, Position = 0, HelpMessage = "Resource Group Name")]
2831
[ResourceGroupCompleter]
2932
[ValidateNotNullOrEmpty]

0 commit comments

Comments
 (0)