Skip to content

Commit 825eae3

Browse files
author
Stephen Tramer
committed
Change side-by-side instructions and clarify ways to use the Az module while also still using AzureRM.
1 parent c4597bf commit 825eae3

File tree

3 files changed

+55
-28
lines changed

3 files changed

+55
-28
lines changed

docs-conceptual/azps-2.0.0/migrate-from-azurerm-to-az.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: sttramer
66
manager: carmonm
77
ms.devlang: powershell
88
ms.topic: conceptual
9-
ms.date: 12/13/2018
9+
ms.date: 05/10/2019
1010
---
1111

1212
# Migrate from AzureRM to Azure PowerShell Az
@@ -17,7 +17,8 @@ module. To make the transition easier, Az offers tools to allow you to run your
1717
using AzureRM. No migration to a new command set is ever convenient, but this article will help
1818
you get started on transitioning to the new module.
1919

20-
To see the full list of breaking changes between AzureRM and Az, see the [Migration guide for Az 1.0.0](migrate-az-1.0.0.md)
20+
To see the full list of breaking changes between AzureRM and Az, see the
21+
[Migration guide for Az 1.0.0](migrate-az-1.0.0.md)
2122

2223
## Check for installed versions of AzureRM
2324

@@ -36,28 +37,33 @@ Get-InstalledModule -Name AzureRM -AllVersions
3637

3738
This is the most important step! Run your existing scripts, and make sure that they work with the
3839
_latest_ release of AzureRM (__6.13.1__). If your scripts don't work, make sure to read
39-
the [AzureRM migration guide](/powershell/azure/azurerm/migration-guide.6.0.0).
40+
the [AzureRM 5.x to 6.x migration guide](/powershell/azure/azurerm/migration-guide.6.0.0).
41+
42+
## Uninstall AzureRM
43+
44+
The Az module is not guaranteed to be compatible with any existing AzureRM installs in PowerShell 5.1 for Windows.
45+
Before you install the Az module, you should [uninstall AzureRM](/powershell/azure/uninstall-az-ps#uninstall-the-azurerm-module).
46+
47+
If you want to keep AzureRM in your local environment, it's possible to do so, but requires that you
48+
have [PowerShell Core](/powershell/scripting/install/installing-powershell-core-on-windows) 6.x or later
49+
installed. Then you can keep the AzureRM module installed under PowerShell 5.1 for Windows, and install
50+
the Az module in PowerShell Core. This unfortunately requires using two different PowerShell environments, but is
51+
the only way to guarantee success with having both modules installed at once on a system.
4052

4153
## Install the Azure PowerShell Az module
4254

4355
The first step is to install the Az module on your platform. When you install Az, it's recommended
4456
that you uninstall AzureRM. In the following steps, you'll learn how to keep running your existing
4557
scripts and enable compatibility for old cmdlet names.
4658

47-
To install the Azure PowerShell Az module, follow these steps:
59+
To install the Azure PowerShell Az module, follow the instructions in [Install the Az module](install-az-ps.md).
4860

49-
* __RECOMMENDED__: [Uninstall the AzureRM module](/powershell/azure/uninstall-az-ps#uninstall-the-azurerm-module).
50-
Make sure that you remove _all_ installed versions of AzureRM, not just the most recent version.
51-
* [Install the Az module](install-az-ps.md)
61+
> [!NOTE]
62+
> At this point, you might want to run the [Uninstall-AzureRM](/powershell/module/az.accounts/uninstall-azurerm)
63+
> cmdlet provided in the Az module, just to make sure that all versions of AzureRM have been uninstalled
64+
> and won't cause conflicts.
5265
53-
## <a name="aliases"/>Enable AzureRM compatibility aliases
54-
55-
> [!IMPORTANT]
56-
>
57-
> Only enable compatibility mode if you've uninstalled _all_ versions of AzureRM. Enabling compatibility
58-
> mode with AzureRM cmdlets still available may result in unpredictable behavior. Skip this step if you
59-
> decided to keep AzureRM installed, but be aware that any AzureRM cmdlets will use
60-
> the older modules and not call any Az cmdlets.
66+
## <a name="aliases"/>Enable AzureRM compatibility aliases
6167

6268
With AzureRM uninstalled and your scripts working with the latest AzureRM version, the next step is to
6369
enable the compatibility mode for the Az module. Compatibility is enabled with the command:

docs-conceptual/azps-2.0.0/new-azureps-module-az.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Introducing the Azure PowerShell Az module
33
description: Introducing the new Azure PowerShell module Az, the replacement for the AzureRM module.
4-
ms.date: 12/13/2018
4+
ms.date: 05/10/2019
55
author: sptramer
66
ms.author: sttramer
77
ms.manager: carmonm
@@ -45,12 +45,25 @@ Azure with PowerShell cmdlets.
4545

4646
## Upgrade to Az
4747

48-
It's recommended that all users upgrade to the new Az module. To do so:
48+
To keep up with the latest Azure features in PowerShell, you should migrate to the Az module as soon as
49+
possible. If you're not ready to install the Az module as a replacement for AzureRM, you have a couple of
50+
options available to experiment with Az:
4951

50-
* __RECOMMENDED__: [Uninstall the Azure PowerShell AzureRM module](/powershell/azure/uninstall-az-ps#uninstall-the-azurerm-module)
51-
* [Install the Azure PowerShell Az module](/powershell/azure/install-az-ps)
52-
* Enable compatibility mode to add aliases for AzureRM cmdlets with `Enable-AzureRMAlias`
53-
while you become familiar with the new command set. __Only__ enable aliases if you do not have AzureRM installed.
52+
* Use a `PowerShell` environment with [Azure Cloud Shell](https://docs.microsoft.com/en-us/azure/cloud-shell/overview).
53+
Azure Cloud Shell is an environment which comes with the Az module installed, `Enable-AzureRM` compatibility aliases
54+
enabled, and the [Azure CLI](/cli/azure).
55+
* Keep the AzureRM module installed with PowerShell 5.1 for Windows, but install the Az module for PowerShell Core 6.x
56+
or later. PowerShell 5.1 for Windows and PowerShell Core use separate collections of modules. Follow the instructions
57+
to [install PowerShell Core](/powershell/scripting/install/installing-powershell-core-on-windows) and then
58+
[install the Az module](install-az-ps.md) from a PowerShell Core terminal.
59+
60+
To upgrade from an existing AzureRM install:
61+
62+
1. [Uninstall the Azure PowerShell AzureRM module](/powershell/azure/uninstall-az-ps#uninstall-the-azurerm-module)
63+
2. [Install the Azure PowerShell Az module](install-az-ps.md)
64+
3. __OPTIONAL__: Enable compatibility mode to add aliases for AzureRM cmdlets with
65+
[Enable-AzureRMAlias](/powershell/module/az.accounts/enable-azurermalias) while you become familiar with
66+
the new command set.
5467

5568
## Migrate existing scripts to Az
5669

@@ -69,8 +82,10 @@ in cmdlet names, use `Az`. For example, the old command `New-AzureRMVm` has beco
6982

7083
For a full description of the migration process, see [Migrate from AzureRM to Az](migrate-from-azurerm-to-az.md).
7184

72-
## The future of support for AzureRM
85+
## Continued support for AzureRM
7386

7487
The existing AzureRM module will no longer receive new cmdlets or features. However, AzureRM is still officially
75-
maintained and will get bug fixes up through December 2020. To keep up with the latest Azure services and features,
76-
switch to the Az module.
88+
maintained and will get bug fixes up through at least December 2020.
89+
90+
The Az module is production-ready, in GA, and does not incur any additional costs on Azure. We recommend
91+
that you switch to the Az module as soon as possible to keep up with the latest Azure features.

docs-conceptual/azps-2.0.0/uninstall-az-ps.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Uninstall Azure PowerShell
33
description: How to perform a complete uninstall of Azure PowerShell
4-
ms.date: 12/13/2018
4+
ms.date: 05/10/2019
55
author: sptramer
66
ms.author: sttramer
77
ms.manager: carmonm
@@ -13,7 +13,7 @@ ms.topic: conceptual
1313
This article tells you how to uninstall an older version of Azure PowerShell, or completely remove it from
1414
your system. If you've decided to completely uninstall the Azure PowerShell, give us some feedback
1515
through the [Send-Feedback](/powershell/module/az.accounts/send-feedback) cmdlet.
16-
If you encounter a bug, we'd appreciate it if you [file a GitHub issue](https://github.com/azure/azure-powershell/issues).
16+
If you encountered a bug, we'd appreciate it if you [file a GitHub issue](https://github.com/azure/azure-powershell/issues) so that it can be fixed.
1717

1818
## Uninstall the Az module
1919

@@ -40,6 +40,7 @@ The following script queries the PowerShell Gallery to get a list of dependent s
4040
uninstalls the correct version of each submodule. You will need to have administrator access to run this script
4141
in a scope other than `Process` or `CurrentUser`.
4242

43+
<a name="uninstall-script"/>
4344
```powershell-interactive
4445
function Uninstall-AllModules {
4546
param(
@@ -119,7 +120,7 @@ $versions[1..($versions.Length-1)] | foreach { Uninstall-AllModules -TargetModu
119120

120121
If you have the Az module installed on your system and would like to uninstall AzureRM, there are two options that
121122
don't require running the `Uninstall-AllModules` script above. Which method you follow depends on how you installed the AzureRM module.
122-
If you're not sure, follow the steps for uninstalling an MSI first.
123+
If you're not sure of your original install method, follow the steps for uninstalling an MSI first.
123124

124125
### Uninstall Azure PowerShell MSI
125126

@@ -143,4 +144,9 @@ part of the `Az.Accounts` module. This removes _all_ AzureRM modules from your m
143144
Uninstall-AzureRm
144145
```
145146

146-
If you can't successfully run the `Uninstall-AzureRM` command, use the `Uninstall-AllModules` script provided in this article instead.
147+
If you can't successfully run the `Uninstall-AzureRM` command, use the [`Uninstall-AllModules` script](#uninstall-script) provided in this article, with the following invocation:
148+
149+
```powershell-interactive
150+
$versions = (Get-InstalledModule AzureRM -AllVersions | Select-Object Version)
151+
$versions | foreach { Uninstall-AllModules -TargetModule AzureRM -Version ($_.Version) -Force }
152+
```

0 commit comments

Comments
 (0)