-
Notifications
You must be signed in to change notification settings - Fork 4k
Support create RM storage Account with Kind "Storagev2" #5012
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
updated on-demand : https://azuresdkci.westus2.cloudapp.azure.com/job/powershell-demand/196/ |
@azuresdkci test this please |
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.
@blueww a couple of minor comments. Also, the NetworkAcls
property of type StorageAccount
was removed in the SDK, which is a breaking change. It looks like it was replaced by the NetworkRuleSet
property, so this here's how it can be mitigated:
Create a new type PSStorageAccount
, which is a wrapper over StorageAccount
, and add the property NetworkAcls
, which will just point to the NetworkRuleSet
property. Add the Obsolete
attribute on this property and add a message saying that this property will be removed in a future release. Let me know if you have any questions about this.
@@ -67,10 +67,13 @@ | |||
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.8.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath> | |||
<Private>True</Private> | |||
</Reference> | |||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> |
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.
@blueww you can remove the references added in this file (Microsoft.Rest.*
, Newtonsoft.Json
) since they are already referenced by the Common.Dependencies.targets
file
<packages> | ||
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" /> | ||
<package id="Microsoft.Azure.Management.Storage" version="6.5.0-preview" targetFramework="net452" /> | ||
<package id="Microsoft.Azure.Management.Storage" version="7.1.0-preview" targetFramework="net452" /> | ||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.10" 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.
@blueww same comment about removing the added references since they are already referenced from a common project
For the breaking change, it's for New/Set-AzureStorageAccount cmdelts output has type "Microsoft.Azure.Management.Storage.Models.StorageAccount", and NetworkAcls is remove from the type. But actually, the real return type of New/Set-AzureStorageAccount is "PSStorageAccount" (Yes, PSStorageAccount is already defined in PSH code, and used as output type of account cmdlets), you can see both cmdelts use "WriteStorageAccount(storageAccount)" to write output, and actually output Type is "PSStorageAccount":
So I have correct the output type in New/Set-AzureStorageAccount to "PSStorageAccount". This will show a breaking change in StaticAnalysis for the output type change, but it's actually not breaking, since the output of the 2 cmdelts not change (only the output section in help *.md change). So I have added the 2 output type change into Exception of breaking change.
I have fixed all other comments from you. |
@blueww the issue still remains: the |
@blueww one other thing, please make sure to update the |
@cormacpayne For the The original output type of the 2 effected cmdelts The before breaking alarm is come from the output Type declared in the begin of cmdlet code is wrong:
So I just correct the output type for the 2 cmdelts to It's interesting that the OutputType of a cmdlet don't enforce to be aligned with the real output type of the cmdelts, actually there are some discussion on it like link |
@blueww thanks for the clarification |
Description
Support create RM storage Account with Kind "Storagev2"
Also need to upgrade SRP SDK to 7.0. Since there's a breaking change in SRP SDK API for NetworkACL->NetworkRuleSet, PowerShell also has code change on it. But since Powershell has wrappered all interface for NetworkRuleSet, PowerShell don't have breaking on it.
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