Skip to content

Commit b32385d

Browse files
authored
Merge pull request #8130 from markcowl/migration
Add migration guide for Az 1.0
2 parents e3bb1e9 + b7edc29 commit b32385d

File tree

1 file changed

+374
-0
lines changed

1 file changed

+374
-0
lines changed
Lines changed: 374 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,374 @@
1+
# Migration Guide for Az 1.0.0
2+
3+
This document describes the changes between the 6.x versions of AzureRM and Az version 1.0.0
4+
5+
## Table of Contents
6+
- [General breaking changes](#general-breaking-changes)
7+
- [Cmdlet Noun Prefix Changes](#cmdlet-noun-prefix-changes)
8+
- [Module name changes](#module-name-changes)
9+
- [Removed modules](#removed-modules)
10+
- [Windows PowerShell 5.1 and .NET 4.7.2](#windows-powershell-51-and-net-472)
11+
- [Temporary removal of User login using PSCredential](#temporary-removal-of-user-login-using-pscredential)
12+
- [Default Device Code login instead of Web Browser prompt](#temporary-default-device-code-login-instead-of-web-browser-prompt)
13+
- [Module breaking changes](#module-breaking-changes)
14+
- [Az.ApiManagement (previously AzureRM.ApiManagement)](#azapimanagement-previously-azurermapimanagement)
15+
- [Az.Billing (previously AzureRM.Billing, AzureRM.Consumption, and AzureRM.UsageAggregates)](#azbilling-previously-azurermbilling-azurermconsumption-and-azurermusageaggregates)
16+
- [Az.CognitiveServices (previously AzureRM.CognitiveServices)](#azcognitiveservices-previously-azurermcognitiveservices)
17+
- [Az.Compute (previously AzureRM.Compute)](#azcompute-previously-azurermcompute)
18+
- [Az.DataFactory (previously AzureRM.DataFactories and AzureRM.DataFactoryV2)](#azdatafactory-previously-azurermdatafactories-and-azurermdatafactoryv2)
19+
- [Az.DataLakeAnalytics (previously AzureRM.DataLakeAnalytics)](#azdatalakeanalytics-previously-azurermdatalakeanalytics)
20+
- [Az.DataLakeStore (previously AzureRM.DataLakeStore)](#azdatalakestore-previously-azurermdatalakestore)
21+
- [Az.KeyVault (previously AzureRM.KeyVault)](#azkeyvault-previously-azurermkeyvault)
22+
- [Az.Media (previously AzureRM.Media)](#azmedia-previously-azurermmedia)
23+
- [Az.Monitor (previously AzureRM.Insights)](#azmonitor-previously-azurerminsights)
24+
- [Az.Network (previously AzureRM.Network)](#aznetwork-previously-azurermnetwork)
25+
- [Az.OperationalInsights (previously AzureRM.OperationalInsights)](#azoperationalinsights-previously-azurermoperationalinsights)
26+
- [Az.RecoveryServices (previously AzureRM.RecoveryServices, AzureRM.RecoveryServices.Backup, and AzureRM.RecoveryServices.SiteRecovery)](#azrecoveryservices-previously-azurermrecoveryservices-azurermrecoveryservicesbackup-and-azurermrecoveryservicessiterecovery)
27+
- [Az.Resources (previously AzureRM.Resources)](#azresources-previously-azurermresources)
28+
- [Az.ServiceFabric (previously AzureRM.ServiceFabric)](#azservicefabric-previously-azurermservicefabric)
29+
- [Az.Sql (previously AzureRM.Sql)](#azsql-previously-azurermsql)
30+
- [Az.Storage (previously Azure.Storage and AzureRM.Storage)](#azstorage-previously-azurestorage-and-azurermstorage)
31+
- [Az.Websites (previously AzureRM.Websites)](#azwebsites-previously-azurermwebsites)
32+
33+
## General breaking changes
34+
### Cmdlet Noun Prefix Changes
35+
In AzureRM, cmdlets used either 'AzureRM' or 'Azure' as a noun prefix. Az simplifies and normalizes cmndlet names, so that all cmdlets use 'Az' as their cmdlet noun prefix.
36+
For example:
37+
```powershell
38+
Get-AzureRMVM
39+
Get-AzureKeyVaultSecret
40+
```
41+
42+
Have changed to
43+
```powershell
44+
Get-AzVM
45+
Get-AzKeyVaultSecret
46+
```
47+
48+
To make the transition to these new cmdlet names simpler, Az introduces two new cmdlets, ```Enable-AzureRmAlias``` and ```Disable-AzureRmAlias```. ```Enable-AzureRmAlias``` creates aliases from the older cmdlet names in AzureRM to the newer Az cmdlet names. The cmdlet allows creating aliases in the current session, or across all sessions by changing your user or machine profile.
49+
50+
For example, the following script in AzureRM:
51+
```powershell
52+
#Requires -Modules AzureRM.Storage
53+
Get-AzureRmStorageAccount | Get-AzureStorageContainer | Get-AzureStorageBlob
54+
```
55+
56+
Could be run with minimal changes using ```Enable-AzureRmAlias```:
57+
```powershell
58+
#Requires -Modules Az.Storage
59+
Enable-AzureRmAlias
60+
Get-AzureRmStorageAccount | Get-AzureStorageContainer | Get-AzureStorageBlob
61+
```
62+
63+
Running ```Enable-AzureRmAlias -Scope CurrentUser``` will enable the aliases for all powershell sessions you open, so that after executing this cmdlet, a script like this would not need to be changed at all:
64+
```powershell
65+
Get-AzureRmStorageAccount | Get-AzureStorageContainer | Get-AzureStorageBlob
66+
```
67+
68+
For complete details on the usage of the alias cmdlets, execute ```Get-Help -Online Enable-AzureRmAlias``` from the powershell prompt.
69+
70+
```Disable-AzureRmAlias``` removes AzureRM cmdlet aliases created by ```Enable-AzureRmAlias```. For complete details, execute ```Get-Help -Online Disable-AzureRmAlias``` from the powershell prompt.
71+
72+
### Module Name Changes
73+
- The module names have changed from `AzureRM.*` to `Az.*`, except for the following modules:
74+
```
75+
AzureRM.Profile -> Az.Accounts
76+
Azure.AnalysisServices -> Az.AnalysisServices
77+
AzureRM.Consumption -> Az.Billing
78+
AzureRM.UsageAggregates -> Az.Billing
79+
AzureRM.DataFactories -> Az.DataFactory
80+
AzureRM.DataFactoryV2 -> Az.DataFactory
81+
AzureRM.MachineLearningCompute -> Az.MachineLearning
82+
AzureRM.Insights -> Az.Monitor
83+
AzureRM.RecoveryServices.Backup -> Az.RecoveryServices
84+
AzureRM.RecoveryServices.SiteRecovery -> Az.RecoveryServices
85+
AzureRM.Tags -> Az.Resources
86+
Azure.Storage -> Az.Storage
87+
```
88+
89+
The changes in module names mean that any script that uses ```#Requires``` or ```Import-Module``` to load specific modules will need to be changed to use the new module instead.
90+
91+
#### Migrating #Requires Statements
92+
Scripts that use #Requires to declare a dependency on AzureRM modules should be updated to use the new module names
93+
```powershell
94+
#Requires -Module AzureRM.Compute
95+
```
96+
97+
Should be changed to
98+
```powershell
99+
#Requires -Module Az.Compute
100+
```
101+
102+
#### Migrating Import-Module Statements
103+
Scripts that use ```Import-Module``` to load AzureRM modules will need to be updated to reflect the new module names.
104+
```powershell
105+
Import-Module -Name AzureRM.Compute
106+
```
107+
108+
Should be changed to
109+
```powershell
110+
Import-Module -Name Az.Compute
111+
```
112+
113+
### Migrating Fully-Qualified Cmdlet Invocations
114+
Scripts that use module-qualified cmdlet invocations, like
115+
```powershell
116+
AzureRM.Compute\Get-AzureRmVM
117+
```
118+
119+
Should be changed to use the new module and cmdlet names
120+
```powershell
121+
Az.Compute\Get-AzVM
122+
```
123+
124+
### Migrating Module Manifest Dependencies
125+
Modules that express dependencies on AzureRM modules through a module manifest (.psd1) file will need to updated the module names in their 'RequiredModules' section
126+
127+
```powershell
128+
RequiredModules = @(@{ModuleName="AzureRM.Profile"; ModuleVersion="5.8.2"})
129+
```
130+
131+
Should be changed to
132+
133+
```powershell
134+
RequiredModules = @(@{ModuleName="Az.Profile"; ModuleVersion="1.0.0"})
135+
```
136+
137+
### Removed modules
138+
- `AzureRM.Backup`
139+
- `AzureRM.Compute.ManagedService`
140+
- `AzureRM.Scheduler`
141+
142+
The tooling for these services are no longer actively supported. Customers are encouraged to move to alternative services as soon as it is convenient.
143+
144+
### Windows PowerShell 5.1 and .NET 4.7.2
145+
- Using Az with Windows PowerShell 5.1 requires the installation of .NET 4.7.2. However, using Az with PowerShell Core does not require .NET 4.7.2.
146+
147+
### Temporary removal of User login using PSCredential
148+
- Due to changes in the authentication flow for .NET Standard, we are temporarily removing user login via PSCredential. This capability will be re-introduced in the 1/15/2019 release for Windows PowerShell 5.1. This is duscussed in detail in [this issue.](https://github.com/Azure/azure-powershell/issues/7430)
149+
150+
### Default Device Code login instead of Web Browser prompt
151+
- Due to changes in the authentication flow for .NET Standard, we are using device login as the default login flow during interactive login. Web browser based login will be re-introduced for Windows PowerShell 5.1 as the default in the 1/15/2019 release. At that time, users will be able to choose device login using a Switch parameter.
152+
153+
## Module breaking changes
154+
155+
### Az.ApiManagement (previously AzureRM.ApiManagement)
156+
- Removing the following cmdlets:
157+
- New-AzureRmApiManagementHostnameConfiguration
158+
- Set-AzureRmApiManagementHostnames
159+
- Update-AzureRmApiManagementDeployment
160+
- Import-AzureRmApiManagementHostnameCertificate
161+
- Use **Set-AzApiManagement** cmdlet to set these properites instead
162+
- Following properties were removed
163+
- Removed property `PortalHostnameConfiguration`, `ProxyHostnameConfiguration`, `ManagementHostnameConfiguration` and `ScmHostnameConfiguration` of type `PsApiManagementHostnameConfiguration` from `PsApiManagementContext`. Instead use `PortalCustomHostnameConfiguration`, `ProxyCustomHostnameConfiguration`, `ManagementCustomHostnameConfiguration` and `ScmCustomHostnameConfiguration` of type `PsApiManagementCustomHostNameConfiguration`.
164+
- Removed property `StaticIPs` from PsApiManagementContext. The property has been split into `PublicIPAddresses` and `PrivateIPAddresses`.
165+
- Removed required property `Location` from New-AzureApiManagementVirtualNetwork cmdlet.
166+
167+
### Az.Billing (previously AzureRM.Billing, AzureRM.Consumption, and AzureRM.UsageAggregates)
168+
- The `InvoiceName` parameter was removed from the `Get-AzConsumptionUsageDetail` cmdlet. Scripts will need to use other identity parameters for the invoice.
169+
170+
### Az.CognitiveServices (previously AzureRM.CognitiveServices)
171+
- Removed `GetSkusWithAccountParamSetName` parameter set from `Get-AzCognitiveServicesAccountSkus` cmdlet. You must get Skus by Account Type and Location, instead of using ResourceGroupName and Account Name.
172+
173+
### Az.Compute (previously AzureRM.Compute)
174+
- `IdentityIds` are removed from `Identity` property in `PSVirtualMachine` and `PSVirtualMachineScaleSet` objects
175+
Scripts should no longer use the value of this field to make processing decisions.
176+
- The type of `InstanceView` property of `PSVirtualMachineScaleSetVM` object is changed from `VirtualMachineInstanceView` to `VirtualMachineScaleSetVMInstanceView`
177+
- `AutoOSUpgradePolicy` and `AutomaticOSUpgrade` properties are removed from `UpgradePolicy` property
178+
- The type of `Sku` property in `PSSnapshotUpdate` object is changed from `DiskSku` to `SnapshotSku`
179+
- `VmScaleSetVMParameterSet` is removed from `Add-AzVMDataDisk` cmdlet, you cna no longer add a data disk individually to a ScaleSet VM.
180+
181+
### Az.DataFactory (previously AzureRM.DataFactories and AzureRM.DataFactoryV2)
182+
- The `GatewayName` parameter has become mandatory in the `New-AzDataFactoryEncryptValue` cmdlet
183+
- Removed `New-AzDataFactoryGatewayKey` cmdlet
184+
- Removed `LinkedServiceName` parameter from `Get-AzDataFactoryV2ActivityRun` cmdlet
185+
Scripts should no longer use the value of this field to make processing decisions.
186+
187+
### Az.DataLakeAnalytics (previously AzureRM.DataLakeAnalytics)
188+
- Removed deprecated cmdlets: `New-AzDataLakeAnalyticsCatalogSecret`, `Remove-AzDataLakeAnalyticsCatalogSecret`, and `Set-AzDataLakeAnalyticsCatalogSecret`
189+
190+
### Az.DataLakeStore (previously AzureRM.DataLakeStore)
191+
- The following cmdlets have had the `Encoding` parameter changed from the type `FileSystemCmdletProviderEncoding` to `System.Text.Encoding`. This change removes the encoding values `String` and `Oem`. All the other prior encoding values remain.
192+
- New-AzureRmDataLakeStoreItem
193+
- Add-AzureRmDataLakeStoreItemContent
194+
- Get-AzureRmDataLakeStoreItemContent
195+
- Removed deprecated `Tags` property alias from `New-AzDataLakeStoreAccount` and `Set-AzDataLakeStoreAccount` cmdlets
196+
197+
Scripts using
198+
```powershell
199+
New-AzureRMDataLakeStoreAccount -Tags @{TagName="TagValue"}
200+
```
201+
202+
Should be changed to
203+
```powershell
204+
New-AzDataLakeStoreAccount -Tag @{TagName="TagValue"}
205+
```
206+
207+
- Removed deprecated properties ```Identity```, ```EncryptionState```, ```EncrypotionProvisioningState```, ```EncryptionConfig```, ```FirewallState```, ```FirewallRules```, ```VirtualNetworkRules```, ```TrustedIdProviderState```, ```TrustedIdProviders```, ```DefaultGroup```, ```NewTier```, ```CurrentTier```, ```FirewallAllowAzureIps``` from ```PSDataLakeStoreAccountBasic``` object. Any script that
208+
uses the ```PSDatalakeStoreAccount``` returned from ```Get-AzDataLakeStoreAccount``` should not reference these properties.
209+
210+
### Az.KeyVault (previously AzureRM.KeyVault)
211+
- The `PurgeDisabled` property was removed from the `PSKeyVaultKeyAttributes`, `PSKeyVaultKeyIdentityItem`, and `PSKeyVaultSecretAttributes` objects
212+
Scripts shoudl no longer reference the ```PurgeDisabled``` property to make processing decisions.
213+
214+
### Az.Media (previously AzureRM.Media)
215+
- Remove deprecated `Tags` property alias from `New-AzMediaService` cmdlet
216+
Scripts using
217+
```powershell
218+
New-AzureRMMediaService -Tags @{TagName="TagValue"}
219+
```
220+
221+
Should be changed to
222+
```powershell
223+
New-AzMMediaService -Tag @{TagName="TagValue"}
224+
```
225+
### Az.Monitor (previously AzureRM.Insights)
226+
- Removed plural names `Categories` and `Timegrains` parameter in favor of singular parameter names from `Set-AzDiagnosticSetting` cmdlet
227+
Scripts using
228+
```powershell
229+
Set-AzureRmDiagnosticSetting -Timegrains PT1M -Categories Category1, Category2
230+
```
231+
232+
Should be changed to
233+
```powershell
234+
Set-AzDiagnosticSetting -Timegrain PT1M -Category Category1, Category2
235+
```
236+
### Az.Network (previously AzureRM.Network)
237+
- Removed deprecated `ResourceId` parameter from `Get-AzServiceEndpointPolicyDefinition` cmdlet
238+
- Removed deprecated `EnableVmProtection` property from `PSVirtualNetwork` object
239+
- Removed deprecated `Set-AzVirtualNetworkGatewayVpnClientConfig` cmdlet
240+
241+
Scripts shoudl no longer make processing decisions based on the values fo these fields.
242+
243+
### Az.OperationalInsights (previously AzureRM.OperationalInsights)
244+
- Default parameter set for `Get-AzOperationalInsightsDataSource` is removed, and `ByWorkspaceNameByKind` has become the default parameter set
245+
246+
Scripts that listed data sources using
247+
```powershell
248+
Get-AzureRmOperationalInsightsDataSource
249+
```
250+
251+
Should be changed to specify a Kind
252+
```powershell
253+
Get-AzOperationalInsightsDataSource -Kind AzureActivityLog
254+
```
255+
256+
### Az.RecoveryServices (previously AzureRM.RecoveryServices, AzureRM.RecoveryServices.Backup, and AzureRM.RecoveryServices.SiteRecovery)
257+
- Removed `Encryption` parameter from `New/Set-AzRecoveryServicesAsrPolicy` cmdlet
258+
- `TargetStorageAccountName` parameter is now mandatory for managed disk restores in `Restore-AzRecoveryServicesBackupItem` cmdlet
259+
- Removed `StorageAccountName` and `StorageAccountResourceGroupName` parameters in `Restore-AzRecoveryServicesBackupItem` cmdlet
260+
- Removed `Name`parameter in `Get-AzRecoveryServicesBackupContainer` cmdlet
261+
262+
### Az.Resources (previously AzureRM.Resources)
263+
- Removed `Sku` parameter from `New/Set-AzPolicyAssignment` cmdlet
264+
- Removed `Password` parameter from `New-AzADServicePrincipal` and `New-AzADSpCredential` cmdlet
265+
Passwords are automatically generated, scripts that provided the password:
266+
```powershell
267+
New-AzAdSpCredential -ObjectId 1f99cf81-0146-4f4e-beae-2007d0668476 -Password $secPassword
268+
```
269+
270+
Should be changed to retriedve the password from the output:
271+
```powershell
272+
$credential = New-AzAdSpCredential -ObjectId 1f99cf81-0146-4f4e-beae-2007d0668476
273+
$secPassword = $credential.Secret
274+
```
275+
276+
### Az.ServiceFabric (previously AzureRM.ServiceFabric)
277+
- The following cmdlet return types have been changed:
278+
- The property `SerivceTypeHealthPolicies` of type `ApplicationHealthPolicy` has been removed.
279+
- The property `ApplicationHealthPolicies` of type `ClusterUpgradeDeltaHealthPolicy` has been removed.
280+
- The property `OverrideUserUpgradePolicy` of type `ClusterUpgradePolicy` has been removed.
281+
- These changes affect the following cmdlets:
282+
- Add-AzServiceFabricClientCertificate
283+
- Add-AzServiceFabricClusterCertificate
284+
- Add-AzServiceFabricNode
285+
- Add-AzServiceFabricNodeType
286+
- Get-AzServiceFabricCluster
287+
- Remove-AzServiceFabricClientCertificate
288+
- Remove-AzServiceFabricClusterCertificate
289+
- Remove-AzServiceFabricNode
290+
- Remove-AzServiceFabricNodeType
291+
- Remove-AzServiceFabricSetting
292+
- Set-AzServiceFabricSetting
293+
- Set-AzServiceFabricUpgradeType
294+
- Update-AzServiceFabricDurability
295+
- Update-AzServiceFabricReliability
296+
297+
### Az.Sql (previously AzureRM.Sql)
298+
- Removed `State` and `ResourceId` parameters from `Set-AzSqlDatabaseBackupLongTermRetentionPolicy` cmdlet
299+
- Removed deprecated cmdlets: `Get/Set-AzSqlServerBackupLongTermRetentionVault`, `Get/Start/Stop-AzSqlServerUpgrade`, `Get/Set-AzSqlDatabaseAuditingPolicy`, `Get/Set-AzSqlServerAuditingPolicy`, `Remove-AzSqlDatabaseAuditing`, `Remove-AzSqlServerAuditing`
300+
- Removed deprecated parameter `Current` from `Get-AzSqlDatabaseBackupLongTermRetentionPolicy` cmdlet
301+
- Removed deprecated parameter `DatabaseName` from `Get-AzSqlServerServiceObjective` cmdlet
302+
- Removed deprecated parameter `PrivilegedLogin` from `Set-AzSqlDatabaseDataMaskingPolicy` cmdlet
303+
304+
### Az.Storage (previously Azure.Storage and AzureRM.Storage)
305+
- To support creating an Oauth storage context with only the storage account name, the default parameter set has been changed to `OAuthParameterSet`
306+
- Example: `$ctx = New-AzureStorageContext -StorageAccountName $accountName`
307+
- The `Location` parameter has become mandatory in the `Get-AzStorageUsage` cmdlet
308+
- The Storage API methods now use the Task-based Asynchronous Pattern (TAP), instead of synchronous API calls.
309+
#### 1. Blob Snapshot
310+
##### Before:
311+
```powershell
312+
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -Context $ctx
313+
$b.ICloudBlob.Snapshot()
314+
```
315+
316+
##### After:
317+
```powershell
318+
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -Context $ctx
319+
$task = $b.ICloudBlob.SnapshotAsync()
320+
$task.Wait()
321+
$snapshot = $task.Result
322+
```
323+
324+
#### 2. Share Snapshot
325+
##### Before:
326+
```powershell
327+
$Share = Get-AzureStorageShare -Name $containerName -Context $ctx
328+
$snapshot = $Share.Snapshot()
329+
```
330+
##### After:
331+
```powershell
332+
333+
$Share = Get-AzureStorageShare -Name $containerName -Context $ctx
334+
$task = $Share.SnapshotAsync()
335+
$task.Wait()
336+
$snapshot = $task.Result
337+
```
338+
339+
#### 3. Undelete a soft delete blob
340+
##### Before:
341+
```powershell
342+
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -IncludeDeleted -Context $ctx
343+
$b.ICloudBlob.Undelete()
344+
```
345+
##### After:
346+
```powershell
347+
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -IncludeDeleted -Context $ctx
348+
$task = $b.ICloudBlob.UndeleteAsync()
349+
$task.Wait()
350+
```
351+
352+
#### 4. Set Blob Tier
353+
##### Before:
354+
```powershell
355+
$blockBlob = Get-AzureStorageBlob -Container $containerName -Blob $blockBlobName -Context $ctx
356+
$blockBlob.ICloudBlob.SetStandardBlobTier("hot")
357+
358+
$pageBlob = Get-AzureStorageBlob -Container $containerName -Blob $pageBlobName -Context $ctx
359+
$pageBlob.ICloudBlob.SetPremiumBlobTier("P4")
360+
```
361+
362+
##### After:
363+
```powershell
364+
$blockBlob = Get-AzureStorageBlob -Container $containerName -Blob $blockBlobName -Context $ctx
365+
$task = $blockBlob.ICloudBlob.SetStandardBlobTierAsync("hot")
366+
$task.Wait()
367+
368+
$pageBlob = Get-AzureStorageBlob -Container $containerName -Blob $pageBlobName -Context $ctx
369+
$task = $pageBlob.ICloudBlob.SetPremiumBlobTierAsync("P4")
370+
$task.Wait()
371+
```
372+
373+
### Az.Websites (previously AzureRM.Websites)
374+
- Removed deprecated properties from the `PSAppServicePlan`, `PSCertificate`, `PSCloningInfo`, and `PSSite` objects

0 commit comments

Comments
 (0)