Skip to content
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

Deprecation of Switch-Azuremode #428

Closed
trondhindenes opened this issue May 26, 2015 · 138 comments
Closed

Deprecation of Switch-Azuremode #428

trondhindenes opened this issue May 26, 2015 · 138 comments

Comments

@trondhindenes
Copy link

The two "modes" in Azure are painful and confusing to work with. For example, there's two different "Get-AzureVM" cmdlets (one in each "mode"), each listing its own sets of vms (the "ServiceManagement" cmdlet lists "v1" vms and the "ResourceManager" cmdlet lists "v2" vms). This is a horrible design. Please build a PowerShell module where every module is available without having to perform confusing operations like "Switch-AzureMode": The Azure module is the only module on the planet with two modes, and for good reasons: It is a plain stupid design.

@brantb
Copy link

brantb commented Jun 1, 2015

Starting in v0.9.2, running Switch-AzureMode now emits a warning with the message "The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.", so it looks like you're getting your wish, but there doesn't seem to be any indication as to what (if anything) is replacing it.

@singhkays
Copy link

Adding @devigned. There should be more information on this in the next few days

@devigned
Copy link
Member

devigned commented Jun 2, 2015

Nothing has changed other than a warning, which will be followed up with some azure.com guidance (landing this week) regarding the upcoming changes and timeline for these changes.

We don’t expect to fully deprecate switch azure mode until after summer. Since it is such a large change, we want to start to warn users and get them thinking about what it means to no longer use switch azure mode. This change will be most impactful for users who are using both ASM and ARM cmdlets.

I'll reply back to this issue with the aforementioned guidance. Based on that guidance and timeline, we'd love to get some feedback regarding the upcoming changes and incorporate that feedback into the proposed solution.

@trondhindenes
Copy link
Author

Thanks for the feedback, @devigned ! Looking forward to more info on this.

@juneb
Copy link

juneb commented Jun 3, 2015

Ogail, David, is there any guidance for partners? Our products have custom code to handle the ASM/ARM switch and I can't wait to remove it.

@markcowl
Copy link
Member

markcowl commented Jun 5, 2015

@juneb There will be an article soon. The practical upshot is that switching mode will no longer be necessary as you should be able to load both modules at the same time.

@trondhindenes
Copy link
Author

Great news. Could you explain what will happen to v1/v2 vms as a result of this switch? Will "v2" vms be created by default after the switch? (that would mean that "Get-azurevm" will only list vms created via the arm api while we will have to use "get-asmvm" to list "v1" vms?). I think there's no getting around the fact that we need a unified set of cmdlets that lets us manipulate both v1 and v2 resources, or that v1 resources get converted into v2 resources somehow.

@devigned
Copy link
Member

@trondhindenes We will not be converting v1 to v2 resources. Transitioning from v1 to v2 resources is handled by a little differently by each Azure service. You will be able to leverage v1 cmdlets and v2 cmdlets side-by-side to manipulate v1 and v2.

@trondhindenes
Copy link
Author

Just to get clarification: "We will not be converting v1 to v2 resources": "We" as in Microsoft, or "we" as in the team working on the PowerShell cmdlets for Azure? What I'm trying to understand here is how I should tell my customers to handle this. Say you release updated cmdlets on sept 1st that switch to arm as the default api:
august 29: vm is created with new-azurevm, which will create a V1 vm. Get-azurevm lists all vms in subscription.
september 1st: customer updates the azure module from msi or via the Powershell package manager.
september 2nd: vm is created with new-azurevm, which will create a V2 vm. Get-azurevm lists only v2 vms in subscription.

Am I correct in assuming this?

@devigned
Copy link
Member

We as in Azure PowerShell.

The script that is calling New-AzureVM will fail as V2 expects different parameters than V1.

@devigned
Copy link
Member

@trondhindenes let me be a little more specific. The customer could also leverage a backwards compatibility script that we'll provide. This will make the script run as it would have before, but it is only meant to be a stop gap for folks only using ASM cmdlets.

@jodoglevy
Copy link

The full proposal from Azure PS and Azure Automation teams is here: https://github.com/Azure/azure-powershell/wiki/Deprecation-of-Switch-AzureMode-in-Azure-PowerShell

@alexandair
Copy link
Contributor

New Azure modules won't be offered through WebPI?
When you put new modules to PowerShellGallery, so that we can use PowerShellGet to install them, the installation path will change to c:\Program Files\WindowsPowerShell\Modules (by default) or equivalent path for the 32-bit modules. Is that correct?

@sriramvu
Copy link
Contributor

@devigned , in reply to your comment "The script that is calling New-AzureVM will fail as V2 expects different parameters than V1." -
For our service, we have planned to have same set of parameters with both V1 & V2 cmdlets (thought of not changing user experience). Can this cause any problem?

@RobinDotNet
Copy link

Let's talk about Azure Storage cmdlets. Some of these are in the ARM cmdlets, and I'm guessing that some aren't. Is that true? How will we know which cmdlet to use? Are there any in both that are the same in both?

@alexandair
Copy link
Contributor

There will be a lot of cmdlets with the same name in ASM-based module and ARM-based modules. However, they won't have the same parameters. For example, ASM-based Get-AzureVM has one parameter set and -ServiceName parameter. ARM-based Get-AzureVM has four parameter sets and -ResourceGroupName (in two of them).

@RobinDotNet
Copy link

Yeah, I got that. I've used both for creating VMs. However, I'm specifically asking about cmdlets having to do with Azure Storage, not VMs, especially the ones that may not be in ARM now. Examples:
New-AzureStorageContext -- I wouldn't expect this to change
New-AzureStorageContainer -- I would expect the ASR version to require the ResourceGroup
Get-AzureStorageContainer -- might have 2 versions, with ASR version requiring ResourceGroup
Get-AzureStorageBlob --- I wouldn't expect this one to be different
Set-AzureStorageBlobContent -- I wouldn't expect this one to be different
Get-AzureStorageBlobContent -- I wouldn't expect this one to be different
Start-AzureStorageBlobCopy -- I wouldn't expect this one to be different
the same ones for Files

Robin

@alexandair
Copy link
Contributor

Disregard my previous comment. I was thinking about some old discussions with Azure PowerShell team on this subject when we still talked about having the same names for both APIs and using modulequalified naming. With the current proposal, that won't be the case anymore. ASM-based module will have Get-AsmVM cmdlet and ARM-based will continue to use Get-AzureVM.

@devigned
Copy link
Member

@sriramvu if the cmdlets exist in both ASM and ARM modules, then there should be no issues. If they will exist in a module that would be used in both, then we should talk through that so we break them up properly.

@devigned
Copy link
Member

@RobinDotNet we should talk through breaking those cmdlets out from ASM and ARM if they have nothing to do with them. Sounds like the cmdlets you are mentioning are data plane cmdlets (non-management) and as such should be independent from the management related cmdlets (IMHO).

Thoughts?

@alexandair
Copy link
Contributor

Right now, all cmdlets that @RobinDotNet has mentioned exist in both modes--AzureServiceManagement and AzureResourceManager and are coming from the same DLL regardless of the mode (C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Storage\Microsoft.WindowsAzure.Commands.Storage.dll)
I expect them to get their own AzureStorage module and keep their name. They'll continue to work as before. For example, if I want to list all storage-related cmdlets:

Get-Command -Module AzureStorage

Are we on the same page?

@devigned
Copy link
Member

@alexandair, yes. That's precisely what I was thinking.

@chadiel
Copy link
Contributor

chadiel commented Jun 12, 2015

If we expect both cmdlets to live in the same module, would we be opening our customers to a source of frustration when they get a resource using the ASM cmdlet and try to use it with an ARM cmdlet (or vice versa) only to have the call fail? I'd imagine that a customer who has created a resource that lives side-by-side between ASM (RDFE) and ARM (e.g. SQL, Websites, etc.) to encounter this at some point (after all, from a customer standpoint they are interacting with the same resource and whether its ARM or ASM that is servicing the request is, to the customer, an implementation detail...) I worry that we may be solving one problem and introducing another...

@RobinDotNet
Copy link

@alexandair -- ALL of them are in both? But they're not identical. Get-AzureStorageAccount and New-AzureStorageAccount let you pass in a resource group in the ARM side. Does the assembly handle both?

I'm asking because I just wrote about a thousand lines of powershell for a storage course that's going to be hosted by Opsgility (like Pluralsight, but just Azure), and it's due to be published in July, and I'm trying to figure out if I am going to have to change the code or comment about the v1/v2 issue. If the cmdlets don't change, and you guys handle where they're pulled from, that works for me.

Does that make sense?

Robin

@RobinDotNet
Copy link

One other thing. You have to deal with the v1/v2 invisibility issue. I mean where you can not see v2 storage accounts from ASM and you can't see v1 storage account from ARM. So if you load both of those, are they going to have to use Get-ASMStorageAccount and Get-AzureStorageAccount in order to see all of their storage accounts? (Considering how many millions of people are using v1 assets on Azure, this would be a p.i.t.a.)

@alexandair
Copy link
Contributor

@RobinDotNet I said all cmdlets that you've listed in your comment are coming from the same DLL in both modes and will work in the future as they are working now. On the other hand, Get-AzureStorageAccount and New-AzureStorageAccount are not in the same DLL. ASM-based ones are in C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Compute\Microsoft.WindowsAzure.Commands.ServiceManagement.dll and ARM-based ones are in C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\StorageManagement\Microsoft.Azure.Commands.Management.Storage.dll
That means that new ASM-based ones will be renamed to Get-AsmStorageAccount and New-AsmStorageAccount. ARM-based ones will continue as Get-AzureStorageAccount and New-AzureStorageAccount.

I assume, if you want to work with v1 storage accounts, you need to use Get/New-AsmStorageAccount. Get/New-AzureStorageAccount will see v2 storage accounts.

@RobinDotNet
Copy link

You mean the old ones will be renamed to Get-Asm[etc], not the new ones, right? So that goes back to my original question. HOW MANY of them will be renamed? Will the ones that have the same functionality, like Get-AzureBlob, still be Get-AzureBlob, or am I going to have to change ALL of my Get-Azure[etc] cmdlets to Get-Asm[etc] ?

@pzerger
Copy link

pzerger commented Jun 14, 2015

@RobinDotNet - presumably the new naming convention would be applied to all the ASM cmdlets for sake of consistency. It would be confusing to have only those duplicated across modules renamed.

@Nepomuceno
Copy link
Member

Sorry for getting to this discussion a little bit to late but I think that this decision will have a HUGE cost on the evolution of the Azure platform as a whole. The adoption of v2 that is already slow is going to be even slower. If you are geting the command in few months for the first time and you see "Get-AzureVM" and "Get-AzureVMRM" which one would you use ? The answer is simple, so we are going to keep hearing that the automation on AWS is a lot easier than is on Azure. And people will not use the deployment template or worst than that will get frustrated because the resources that they create with the template cannot be used by the vm that they created using the PowerShell. This is going to create a lot of frustration in the future.

I agree that this decision is the one that is going to give the smaller headache now but the cost of that for Azure in the future will be huge.

I hope that this decision can be reverted in the future and we can favor the people that are trying to go forward, and not the ones that stick with the old resources. In my humble opinion if changing the command for {verb}-AzureSM{noun} it is going to break your old scripts and the cost of coordinating that is to high just don't update we should think about the future when taking decisions about new versions and how this will be in years from now.

@doctordns
Copy link
Contributor

I am going to disagree with Nepomuceno. And I'll correct him that it's the RM cmdlets that are changing , not the SM ones. That approach will mean less production automation has to be recalled and reworked to cater for this change.

The root cause of this change is the two-API monster created by MS in the first place. A more sensible approach would have been to change the SM API to accommodate resource groups, tags, etc. It would have been better to have ONLY had ONE API. But that is not what happened. This initial design decision made things bad, but the decision to create the dual module with similarly named cmdlets that are utterly incompatible just made things worse. I hope these design mistakes will serve as a great warning flag to other teams going down this road (creating multiple APIs, etc).

IMHO leaving things as they were was worse than any possible alternative. Two utterly different cmdlets with the same name contained somehow in a single module is simply bad PowerShell. It was confusing to customers and should never have happened. Fixing that mistake is going to cause pain, no matter HOW it was done - NOT doing it would have been worse. IMO.

Leaving the older Azure cmdlets alone and only changing the ARM cmdlet names is possibly the best of a bad situation. I still think refactoring the RM cmdlets into different modules is unnecessary and possibly confusing. All the more so when the SM cmdlets are not being refactored. But that's relatively minor given we have module autoload.

The decision as communicated to keep the SM cmdlets and redo the RM cmdlets appears to be the least bad of the alternatives. I appreciate that tough decisions had to be made and am glad they've been made and we are moving forward.

@pcgeek86
Copy link
Contributor

Once again, PowerShell already handles command name conflicts. Calling a command, with a conflicting name is done as follows: ModuleName\CommandName and ModuleName2\CommandName. It is painfully straightforward.

  1. If you don't use ASM, then don't install ASM. You don't need to specify the module prefix.
  2. If you don't use ARM, don't install ARM. You don't need to specify the module prefix.
  3. If you use both ARM and ASM, then use module prefixes.
  4. As a best practice, use module prefixes regardless, to ensure the highest reliability of your code.

The Microsoft team has already picked a direction though, and are going with it. I don't like it, but it's at least a step above where we are at today. All they really had to do was break out the separate modules and install them both at the same time into $env:PSModulePath. The fix was pretty simple, and didn't require the renaming of any commands, but they chose to go through the effort of renaming them to something confusing. In the end, it's not my final decision, and I've made it abundantly clear what a typical PowerShell user would expect. Get-AzureRMVM looks pretty ugly, and I'm not excited about the lack of readability for these commands.

We are in this mess because Microsoft chose to skirt around the built-in PowerShell mechanisms, and the "new" solution is doing the same thing, just to a lesser degree. Instead of relying on module prefixing, a PowerShell standard, they are renaming commands to avoid having to rely on that built-in mechanism. It really makes zero sense, and will only confuse users more, with ugly command names.

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell
http://trevorsullivan.net
http://twitter.com/pcgeek86

@doctordns
Copy link
Contributor

Trevor - I agree to your 1st and 2nd points. As for point 3 - I'm not convinced forcing module name prefixes is a great solution - it makes long command lines even longer!
IMO, what should haver happened was a simpler prefix (ASM and ARM) could have been adopted from the get go with sepearate modules. I agree with you about the ugliness and less than outstanding readability. But I do think the way proposed is better than what we have now.

@robplank
Copy link
Contributor

I agree with Trevor, only install the modules you need and if using both modules use the module prefix should have been the solution, it works even in Azure Automation. I just wish we could get the new module and move past this issue and ensure all of the cmdlets have the proper documentation.

@alexandair
Copy link
Contributor

Don't forget that there are scenarios when you need to use both ASM- and ARM-based cmdlets, just because some of the functionalities are still not implemented as ARM cmdlets.

@Nepomuceno
Copy link
Member

The question is actually quite simple is about how the things will look in
6 months. A lot of the current services are going to be deprecates like the
cloud services. Think How it is going to be in 1 year when someone that is
starting with azure and see 2 different commands New-AzureVM and
New-AzureRMVM which one they will choose?

On 21 August 2015 at 15:41, Thomas Lee notifications@github.com wrote:

I am going to disagree with Nepomuceno. And I'll correct him that it's the
RM cmdlets that are changing , not the SM ones. That approach will mean
less production automation has to be recalled and reworked to cater for
this change.

The root cause of this change is the two-API monster created by MS in the
first place. A more sensible approach would have been to change the SM API
to accommodate resource groups, tags, etc. It would have been better to
have ONLY had ONE API. But that is not what happened. This initial design
decision made things bad, but the decision to create the dual module with
similarly named cmdlets that are utterly incompatible just made things
worse. I hope these design mistakes will serve as a great warning flag to
other teams going down this road (creating multiple APIs, etc).

IMHO leaving things as they were was worse than any possible alternative.
Two utterly different cmdlets with the same name contained somehow in a
single module is simply bad PowerShell. It was confusing to customers and
should never have happened. Fixing that mistake is going to cause pain, no
matter HOW it was done - NOT doing it would have been worse. IMO.

Leaving the older Azure cmdlets alone and only changing the ARM cmdlet
names is possibly the best of a bad situation. I still thing refactoring
the RM cmdlets into different modules is unnecessary and possibly
confusing. All the more so when the SM cmdlets are not being refactored.
But that's relatively minor given we have module autoload.

The decision as communicated to keep the SM cmdlets and redo the RM
cmdlets appears to be the least bad of the alternatives. I appreciate that
tough decisions had to be made and am glad they've been made and we are
moving forward.


Reply to this email directly or view it on GitHub
#428 (comment)
.

@pcgeek86
Copy link
Contributor

@Nepomuceno +1, if they're going to destroy the command names, they should destroy the ones that are going to be deprecated, rather than ruining the "new" user experience.

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

@devigned
Copy link
Member

Well, after the old ones are gone what stops us from aliasing the ARM cmdlets back to the "Azure" names :)?

@Nepomuceno
Copy link
Member

If we want to go back after we are going to be in danger of breaking
compatibility. We should think in the future does who don't want to change
their old script just don't update the azure version
On 22 Aug 2015 21:43, "David Justice" notifications@github.com wrote:

Well, after the old ones are gone what stops us from aliasing the ARM
cmdlets back to the "Azure" names :)?


Reply to this email directly or view it on GitHub
#428 (comment)
.

@devigned
Copy link
Member

@Nepomuceno there are many options. That certainly is one that would work.

@pcgeek86
Copy link
Contributor

@devigned Nothing stopping you from aliasing them in the future, but you might want to consider the confusion to end users before making such decisions.

@devigned
Copy link
Member

@pcgeek86 any major choices will have the community involved.

@jodoglevy
Copy link

@Nepomuceno in terms of how they'd choose between New-AzureVM and New-AzureRMVM, its the same as how they choose between New-AzureVM (ASM) and New-AzureVM (ARM) today. Except now the names will be different, so it will be less confusing in documentation and samples. On top of that, if they are just starting out with Azure, they should use New-AzureRMVM since it is the new V2 VM model in Azure. If they don't know to do that then it is a failure in our documentation, and not related to cmdlet names, since regardless of cmdlet name they are picking the old model. I think what might help is if the Azure PowerShell installer let you choose whether to install the ASM cmdlets, the ARM cmdlets, or both, and for ASM labeled them as "V1, deprecated" and for ARM as "V2, recommended". Same on PSGallery. @devigned may be something to consider.

@pcgeek86 don't you think calling the adding of "RM" to cmdlet names as "destroying" and "ruining" them is a little much? You are a PowerShell MVP, so you know about prefixing. Most people do not know or use prefixing in their PowerShell scripts, because cmdlet names are almost always unique, which they should be. Prefixing is just a get out of jail free card. Can you suggest a better prefix? Maybe "AzureV2" instead of "AzureRM"?

@pcgeek86
Copy link
Contributor

I don't really think it's a "little much." I think it's an accurate assessment of how they are today, versus what they are becoming. If you tried doing the same thing in a PowerShell module that was much more popular with other PowerShell MVPs, you would have a similar uproar. The Azure PowerShell module is naturally "benefitting" from the lack of input from most PowerShell MVPs, who aren't using Azure.

I don't have to be a PowerShell MVP to know about module prefixing. It has been around for 10 years, and is simply a matter of training / awareness. Trying to solve a training problem with a technical solution is an exercise in disaster. I can't suggest a better noun prefix; I can only suggest using module prefixing, as defined by the PowerShell language specification.

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

@larrywa
Copy link

larrywa commented Aug 27, 2015

To the Azure PowerShell team, where do you stand in regard to the estimated dates you had listed above, ie 'Release PowerShell 0.9.9 ~ 8/25'. Just trying to prep some customers for the change.

@devigned
Copy link
Member

@larrywa we are targeting 10/01 for release at this point. We will still include 0.9.8 in the WebPI feed, so teams are not required to install the breaking changes. There will be a second feed item for this release.

@devigned
Copy link
Member

Update is Oct. 8th release.

@SamirFarhat
Copy link

I'm really surprised why does Microsoft reports each time the new change. You should know that there are customers using Powershell and Resource Manager on production, and we spend a lot of time to prepare the switch. And then, 1 hour/day before the change release, we are informed of the report time. Please, we support Microsoft because they follow Enterprise processes which respect the customers needs.

@pcgeek86
Copy link
Contributor

pcgeek86 commented Oct 2, 2015

@SamirFarhat To the defense of the Microsoft Azure PowerShell team, they have taken a leading approach to inviting and accepting customer feedback. In this particular case, they have not rushed into anything, and have been very solid about communicating with their customers, partners, and MVPs. I think that, in this case, the feedback is somewhat misdirected. There are plenty of other Azure feature teams rushing out features and functional changes, that your feedback would probably be better served to.

Honestly, the Azure PowerShell team is doing some of the best work out of the entire Azure platform, in terms of customer engagement. I still think that the Azure identity team (Travis Gross' team) is the absolute leader, and Azure Automation (Joe Levy's team) closely follows, but David and team are doing great work.

Cheers,
Trevor Sullivan
Microsoft MVP PowerShell
http://trevorsullivan.net
http://twitter.com/pcgeek86

@SamirFarhat
Copy link

Hi Trevor,
I was not complaining about the MS teams works, or approaches. On the contrary, i've been always their defender faced to angry customers. I know that they are spending all the efforts to provide the best solutions, and that they are giving possibility to the community to present ideas and feedback. In the meanwhile, when we announce that the switch to the new Azure mode will be on October 1st, we prepared everything for this (my customer is using ARM scripts), but few days before, we change the decision and report back to 1 week further. That made me think that even the next time, the change may not happen, and so on. I was hoping just more precise dates, that's it.

@trondhindenes
Copy link
Author

Valid point Samir. MS (although the do their best I'm sure) has a pretty bad track record when it comes to delivering on promised dates. We've given them a ton of feedback on this and communications in general needs improving, so we can only assume they listen.

@sakshi27
Copy link

sakshi27 commented Oct 8, 2015

Hi people,

I wanted to know few things-
• Will 9.8 version continue to support Switch-AzureMode cmdlet or not? If yes, till when if anyone knows?
• My understanding is - Switch-AzureMode functionality will stop working only if I upgrade to 9.9 and would work properly if I continue to use 9.8 version. Please correct me if I am wrong.
• Are there any other cmdlets getting changed with 9.9 version?

Hoping this is the right platform to ask these questions!

@patrik996
Copy link

Oct 8th is now passed, any release coming soon?

@doctordns
Copy link
Contributor

Sakshi:
The 0.9.8 release was put out about a month ago. It contains the Switch-AzureMode although it gives a warning message about being a depricated cmdlet when used. I guess that is to be accepted - but if you want to hide it in scripts - that can be done. Just ass the '-WarningAction SilentlyContinue' to any call to Switch-AzureMode

While with GitHub one can update a version, the tradition in this project is that each changed version is a new module. So anything that works in that version will continue to work forever.

OF course, when I say forever - I mean the client side behaviour should not change. Remember that the cmdlets are a wrapper around the 'real' API, which is REST based. This API can and sometimes does change - and those changes may render features in 0.9.8 no longer usable or compatible with the updated API. While I would not expect that to happen - Azure is evolving at 'Internet speed' and with that haste comes issues - so never say never.

WIth that said, you should be safe with 0.9.8 for some time. I would expect that should I be wrong in that assertion, we'd have plenty of warning and explanation here well in advance.

@markcowl
Copy link
Member

markcowl commented Oct 9, 2015

@markcowl
Copy link
Member

markcowl commented Oct 9, 2015

Closing (!!!!)

@markcowl markcowl closed this as completed Oct 9, 2015
huangpf added a commit to AzureRT/azure-powershell that referenced this issue Feb 23, 2016
HPF PR: vmss <- huangpf:dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests