azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Deprecation of Switch-Azuremode

Open trondhindenes opened this issue 11 years ago • 138 comments

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.

trondhindenes avatar May 26 '15 19:05 trondhindenes

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.

brantb avatar Jun 01 '15 23:06 brantb

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

singhkays avatar Jun 02 '15 00:06 singhkays

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.

devigned avatar Jun 02 '15 00:06 devigned

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

trondhindenes avatar Jun 02 '15 07:06 trondhindenes

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.

juneb avatar Jun 03 '15 21:06 juneb

@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.

markcowl avatar Jun 05 '15 16:06 markcowl

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.

trondhindenes avatar Jun 11 '15 19:06 trondhindenes

@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.

devigned avatar Jun 11 '15 21:06 devigned

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?

trondhindenes avatar Jun 11 '15 21:06 trondhindenes

We as in Azure PowerShell.

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

devigned avatar Jun 11 '15 21:06 devigned

@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.

devigned avatar Jun 11 '15 22:06 devigned

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

JAL9302 avatar Jun 12 '15 00:06 JAL9302

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?

alexandair avatar Jun 12 '15 00:06 alexandair

@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?

sriramvu avatar Jun 12 '15 04:06 sriramvu

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?

RobinDotNet avatar Jun 12 '15 17:06 RobinDotNet

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).

alexandair avatar Jun 12 '15 17:06 alexandair

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

RobinDotNet avatar Jun 12 '15 18:06 RobinDotNet

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.

alexandair avatar Jun 12 '15 18:06 alexandair

@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 avatar Jun 12 '15 18:06 devigned

@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?

devigned avatar Jun 12 '15 18:06 devigned