-
Notifications
You must be signed in to change notification settings - Fork 4k
EventHub: RP version 2017-04-01 and cmdlet recommendations #4307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@v-Ajnava Test failures, please take a look |
NuGet.config
Outdated
@@ -1,9 +1,14 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change this
setup/azurecmdfiles.wxi
Outdated
@@ -2,6 +2,12 @@ | |||
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |||
<Fragment> | |||
<DirectoryRef Id="PowerShellFolder"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you changing this file? None of these changes are valid
/// 'Remove-AzureRmRelayAuthorizationRule' Cmdlet removes/deletes AuthorizationRule | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.Remove, EventHubAuthorizationRuleVerb, DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))] | ||
public class RemoveAzureRelayAuthorizationRule : AzureEventHubsCmdletBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class name should match file name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava ^ ping on this comment
/// 'New-AzureRmRelayKey' Cmdlet creates a new specified (PrimaryKey / SecondaryKey) key for the given WcfRelay Authorization Rule | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.New, EventHubKeyVerb, DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(AuthorizationRuleKeysAttributes))] | ||
public class NewAzureRmRelayKey : AzureEventHubsCmdletBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class name should match file name
/// 'New-AzureRmRelayAuthorizationRule' Cmdlet creates a new AuthorizationRule | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.New, EventHubAuthorizationRuleVerb, DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(AuthorizationRuleAttributes))] | ||
public class NewAzureRelayAuthorizationRule : AzureEventHubsCmdletBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class name shoudl match file name
/// 'Set-AzureRmRelayAuthorizationRule' Cmdlet updates the specified AuthorizationRule | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.Set, EventHubAuthorizationRuleVerb, DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(AuthorizationRuleAttributes))] | ||
public class SetAzureRelayAuthorizationRule : AzureEventHubsCmdletBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class name
<package id="Microsoft.Azure.Management.IotHub" version="1.1.2" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" /> | ||
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" /> | ||
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.6.7-preview" targetFramework="net45" /> | ||
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.7.0" targetFramework="net452" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this updated?
@@ -38,7 +38,7 @@ function Test-AzureRmIotHubLifecycle | |||
$resourceGroup = New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location | |||
|
|||
Write-Debug " Create new eventHub " | |||
$namespaceName = "IotHubPSEHNamespaceTest" | |||
$namespaceName = "IotHubPSEHNamespaceTest1212" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this updated?
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.GetAzureRmEventHubAuthorizationRule","Get-AzureRmEventHubAuthorizationRule","0","2100","The parameter 'EventHubName' in cmdlet 'Get-AzureRmEventHubAuthorizationRule' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'EventHubName' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.GetAzureEventHubKey","Get-AzureRmEventHubKey","0","1020","The cmdlet 'Get-AzureRmEventHubKey' no longer has output type 'Microsoft.Azure.Commands.EventHub.Models.ListKeysAttributes'.","Make cmdlet 'Get-AzureRmEventHubKey' return type 'Microsoft.Azure.Commands.EventHub.Models.ListKeysAttributes'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.GetAzureEventHubKey","Get-AzureRmEventHubKey","0","2100","The parameter 'NamespaceName' in cmdlet 'Get-AzureRmEventHubKey' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'NamespaceName' back to the parameter set '__AllParameterSets'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many of these look like actual breaking changes, which won't be accepted (for example, adding validation that wasn't ehere before)
@v-Ajnava it looks like this PR is out of sync with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava some comments that need to be resolved
@@ -19,7 +19,26 @@ | |||
--> | |||
## Current Release | |||
|
|||
## Version 0.4.2 | |||
## Version 4.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava please move the content below to under the Current Release
header, and revert the changes made to Version 0.4.2
header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
Write-Debug " Create new Evnethub namespace" | ||
Write-Debug " Namespace name : $namespaceName" | ||
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName -Location $location | ||
Wait-Seconds 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava why is this Wait-Seconds
command needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the wait command, used it for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not removed
Write-Debug "Namespace name : $namespaceName" | ||
|
||
$result = New-AzureRmEventHubNamespace -ResourceGroup $resourceGroupName -Name $namespaceName -Location $location | ||
Wait-Seconds 15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava same comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the wait command, used it for testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not removed
ValueFromPipelineByPropertyName = true, | ||
HelpMessage = "Rights, e.g. \"Listen\",\"Send\",\"Manage\"")] | ||
[ValidateNotNullOrEmpty] | ||
public string[] Rights { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava consider using ValidateSet
if the values that you can provide for this parameter are restricted to a set of strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added validate set
/// 'Remove-AzureRmRelayAuthorizationRule' Cmdlet removes/deletes AuthorizationRule | ||
/// </summary> | ||
[Cmdlet(VerbsCommon.Remove, EventHubAuthorizationRuleVerb, DefaultParameterSetName = NamespaceAuthoRuleParameterSet, SupportsShouldProcess = true), OutputType(typeof(bool))] | ||
public class RemoveAzureRelayAuthorizationRule : AzureEventHubsCmdletBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava ^ ping on this comment
public string Location { get; set; } | ||
|
||
[Parameter(Mandatory = true, | ||
ValueFromPipelineByPropertyName = true, | ||
Position = 3, | ||
Position = 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava why was this change made? You now have two parameters with the same position, which will cause an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted, by mistake
@@ -51,6 +53,7 @@ public class GetAzureEventHubNamespaceAuthorizationRule : AzureEventHubsCmdletBa | |||
|
|||
public override void ExecuteCmdlet() | |||
{ | |||
// WriteWarning("'Get-AzureRmEventHubNamespaceAuthorizationRule' cmdlet is mark as obsolete and will be depricated in upcoming breaking changes build. Please use the New cmdlet 'Get-AzureRmEventHubAuthorizationRule'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava please remove this line if it's going to be commented out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
HelpMessage = "Upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units.")] | ||
public int? MaximumThroughputUnits { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava please use ValidateSet
if you're going to limit the value to be between 0-20
Also, there is a typo in the above HelpMessage: vaule should be value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Validation I have used validate range.
[Parameter( | ||
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
HelpMessage = "Upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava what happens when this value is provided but AutoInflate
is disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when AutoInflate is disabled and try to set MaximumThroughputUnits is been, RP will return an error
Mandatory = false, | ||
ValueFromPipelineByPropertyName = true, | ||
HelpMessage = "Upper limit of throughput units when AutoInflate is enabled, vaule should be within 0 to 20 throughput units.")] | ||
public int? MaximumThroughputUnits { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava same comments about ValidateSet
, typo, and AutoInflate
being disabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when AutoInflate is disabled and try to set MaximumThroughputUnits is been, RP will return an error. For Validation I have used validate range.
@v-Ajnava This cmdlet is out of sync with the preview branch. Please merge - also, since you already have multiple merge commits, please clean up your commits. |
@@ -9,16 +9,22 @@ schema: 2.0.0 | |||
## SYNOPSIS | |||
Updates the specified Event Hubs namespace. | |||
|
|||
## SYNTAX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-Ajnava the ## SYNTAX
header should not have been removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected the markdown
@azuresdkci test this please |
@@ -218,6 +218,38 @@ | |||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.NewAzureLocalNetworkGatewayCommand","New-AzureRmLocalNetworkGateway","0","2020","The cmdlet 'New-AzureRmLocalNetworkGateway' no longer supports the type 'System.UInt32' for parameter 'Asn'.","Change the type for parameter 'Asn' back to 'System.UInt32'." | |||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.SetAzureLocalNetworkGatewayCommand","Set-AzureRmLocalNetworkGateway","0","2020","The cmdlet 'Set-AzureRmLocalNetworkGateway' no longer supports the type 'System.UInt32' for parameter 'Asn'.","Change the type for parameter 'Asn' back to 'System.UInt32'." | |||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Network\Microsoft.Azure.Commands.Network.dll","Microsoft.Azure.Commands.Network.ResetAzureVirtualNetworkGatewayConnectionSharedKeyCommand","Reset-AzureRmVirtualNetworkGatewayConnectionSharedKey","0","2020","The cmdlet 'Reset-AzureRmVirtualNetworkGatewayConnectionSharedKey' no longer supports the type 'System.UInt32' for parameter 'KeyLength'.","Change the type for parameter 'KeyLength' back to 'System.UInt32'." | |||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.NewAzureRmEventHubKey","New-AzureRmEventHubKey","0","2000","The cmdlet 'New-AzureRmEventHubKey' no longer supports the parameter 'ResourceGroup' and no alias was found for the original parameter name.","Add the parameter 'ResourceGroup' back to the cmdlet 'New-AzureRmEventHubKey', or add an alias to the original parameter name." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should leave in an alias to ResourceGroup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the exception, alias was added.
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.NewAzureEventHubNamespace","New-AzureRmEventHubNamespace","0","2100","The parameter 'SkuName' in cmdlet 'New-AzureRmEventHubNamespace' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'SkuName' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.NewAzureEventHubNamespace","New-AzureRmEventHubNamespace","0","2100","The parameter 'SkuCapacity' in cmdlet 'New-AzureRmEventHubNamespace' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'SkuCapacity' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.Namespace.NewAzureEventHubNamespace","New-AzureRmEventHubNamespace","0","2100","The parameter 'Tag' in cmdlet 'New-AzureRmEventHubNamespace' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'Tag' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.AnalysisServices\Microsoft.Azure.Commands.AnalysisServices.dll","Microsoft.Azure.Commands.AnalysisServices.NewAnalysisServicesServer","New-AzureRmAnalysisServicesServer","0","2060","The position of parameter 'Administrator' has changed for parameter set '__AllParameterSets' for cmdlet 'New-AzureRmAnalysisServicesServer'.","Revert the position change made to parameter 'Administrator' for parameter set '__AllParameterSets'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not removed
@markcowl , Resolved the comments. |
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.GetAzureRmEventHubAuthorizationRule","Get-AzureRmEventHubAuthorizationRule","0","2100","The parameter 'EventHubName' in cmdlet 'Get-AzureRmEventHubAuthorizationRule' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'EventHubName' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.GetAzureEventHubKey","Get-AzureRmEventHubKey","0","2100","The parameter 'NamespaceName' in cmdlet 'Get-AzureRmEventHubKey' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'NamespaceName' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.GetAzureEventHubKey","Get-AzureRmEventHubKey","0","2100","The parameter 'EventHubName' in cmdlet 'Get-AzureRmEventHubKey' is no longer in the parameter set '__AllParameterSets'.","Add parameter 'EventHubName' back to the parameter set '__AllParameterSets'." | ||
"D:\workspace\powershell\src\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.EventHub\Microsoft.Azure.Commands.EventHub.dll","Microsoft.Azure.Commands.EventHub.Commands.EventHub.NewAzureRmEventHub","New-AzureRmEventHub","0","2060","The position of parameter 'EventHubName' has changed for parameter set '__AllParameterSets' for cmdlet 'New-AzureRmEventHub'.","Revert the position change made to parameter 'EventHubName' for parameter set '__AllParameterSets'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New-AzureRmEventHub EventHubName position has changed. This is a breaking change. Please change it back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looks liek this is just stale. Please remove this in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will raise a separate PR.
Description
PR consist the changes related RP version 2017-04-01 and cmdlet recommendations from PowerShell review team.
RP version changes changes included 3 properties are marked as Obsolete and few properties added.
Recommendations include the 6 Namespace authorization rule cmdlet marked as Obsolete and
Updated Eventhub authorization rule cmdlet with Parameter sets to differentiate the authorization rule for Namespace and Eventhub.
renamed cmdlet parameters with recommended and added old names as alias.
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThru
parameter.Cmdlet Parameter Guidelines