Skip to content

Instantly share code, notes, and snippets.

@MiYanni
Last active December 13, 2018 21:42
Show Gist options
  • Save MiYanni/a697d43e2d17e9e13c245e7852fabff6 to your computer and use it in GitHub Desktop.
Save MiYanni/a697d43e2d17e9e13c245e7852fabff6 to your computer and use it in GitHub Desktop.
AzMigrationGuide

Migration Guide for Az 1.0.0

This document describes the changes between the 6.x versions of AzureRM and Az version 1.0.0

Table of Contents

General breaking changes

Module name changes

  • The module names have changed from AzureRM.* to Az.*, except for the following modules:
AzureRM.Profile                       -> Az.Accounts
Azure.AnalysisServices                -> Az.AnalysisServices
AzureRM.Consumption                   -> Az.Billing
AzureRM.UsageAggregates               -> Az.Billing
AzureRM.DataFactories                 -> Az.DataFactory
AzureRM.DataFactoryV2                 -> Az.DataFactory
AzureRM.MachineLearningCompute        -> Az.MachineLearning
AzureRM.Insights                      -> Az.Monitor
AzureRM.RecoveryServices.Backup       -> Az.RecoveryServices
AzureRM.RecoveryServices.SiteRecovery -> Az.RecoveryServices
AzureRM.Tags                          -> Az.Resources
Azure.Storage                         -> Az.Storage
  • For full details on migrating from AzureRM to Az, see our blog post.

Removed modules

  • AzureRM.Backup
  • AzureRM.Compute.ManagedService
  • AzureRM.Scheduler

Windows PowerShell 5.1 and .NET 4.7.2

  • 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. For full details, see our blog post.

Temporary removal of User login using PSCredential

  • Due to changes in the authenication flow for .NET Standard, we are temporarily removing user login via PSCredential. This will be re-implemented in the near future. For full details, see our blog post.

Temporary default Device Code login instead of Web Browser prompt

  • Due to changes in the authenication flow for .NET Standard, we are temporarily using device login as the default login flow during interactive login. Web browser based login will be re-added as the default in the near future. At that time, device login will available via a parameter. For full details, see our blog post.

Module breaking changes

Az.ApiManagement (previously AzureRM.ApiManagement)

  • Removing the following cmdlets:
    • New-AzureRmApiManagementHostnameConfiguration
    • Set-AzureRmApiManagementHostnames
    • Update-AzureRmApiManagementDeployment
    • Import-AzureRmApiManagementHostnameCertificate
    • Please refer to examples of Set-AzApiManagement cmdlet instead
  • Following properties were removed
    • Removed property PortalHostnameConfiguration, ProxyHostnameConfiguration, ManagementHostnameConfiguration and ScmHostnameConfiguration of type PsApiManagementHostnameConfiguration from PsApiManagementContext. Instead use PortalCustomHostnameConfiguration, ProxyCustomHostnameConfiguration, ManagementCustomHostnameConfiguration and ScmCustomHostnameConfiguration of type PsApiManagementCustomHostNameConfiguration.
    • Removed property StaticIPs from PsApiManagementContext. The property has been split into PublicIPAddresses and PrivateIPAddresses.
    • Removed required property Location from NewAzureApiManagementVirtualNetwork cmdlet, as it was redundant parameter.

Az.Billing (previously AzureRM.Billing, AzureRM.Consumption, and AzureRM.UsageAggregates)

  • The InvoiceName parameter was removed from the Get-AzConsumptionUsageDetail cmdlet

Az.CognitiveServices (previously AzureRM.CognitiveServices)

  • Removed GetSkusWithAccountParamSetName parameter set from Get-AzCognitiveServicesAccountSkus cmdlet

Az.Compute (previously AzureRM.Compute)

  • IdentityIds are removed from Identity property in PSVirtualMachine and PSVirtualMachineScaleSet objects
  • The type of InstanceView property of PSVirtualMachineScaleSetVM object is changed from VirtualMachineInstanceView to VirtualMachineScaleSetVMInstanceView
  • AutoOSUpgradePolicy and AutomaticOSUpgrade properties are removed from UpgradePolicy property
  • The type of Sku property in PSSnapshotUpdate object is changed from DiskSku to SnapshotSku
  • VmScaleSetVMParameterSet is removed from Add-AzVMDataDisk cmdlet

Az.DataFactory (previously AzureRM.DataFactories and AzureRM.DataFactoryV2)

  • The GatewayName parameter has become mandatory in the New-AzDataFactoryEncryptValue cmdlet
  • Removed New-AzDataFactoryGatewayKey cmdlet
  • Removed LinkedServiceName parameter from Get-AzDataFactoryV2ActivityRun cmdlet

Az.DataLakeAnalytics (previously AzureRM.DataLakeAnalytics)

  • Removed deprecated cmdlets: New-AzDataLakeAnalyticsCatalogSecret, Remove-AzDataLakeAnalyticsCatalogSecret, and Set-AzDataLakeAnalyticsCatalogSecret

Az.DataLakeStore (previously AzureRM.DataLakeStore)

  • 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.
    • New-AzureRmDataLakeStoreItem
    • Add-AzureRmDataLakeStoreItemContent
    • Get-AzureRmDataLakeStoreItemContent
  • Removed deprecated Tags property alias from New-AzDataLakeStoreAccount and Set-AzDataLakeStoreAccount cmdlets
  • Removed deprecated properties from PSDataLakeStoreAccountBasic object

Az.KeyVault (previously AzureRM.KeyVault)

  • The PurgeDisabled property was removed from the PSKeyVaultKeyAttributes, PSKeyVaultKeyIdentityItem, and PSKeyVaultSecretAttributes objects

Az.Media (previously AzureRM.Media)

  • Remove deprecated Tags property alias from New-AzMediaService cmdlet

Az.Monitor (previously AzureRM.Insights)

  • Removed plural names Categories and Timegrains parameter in favor of singular parameter names from Set-AzDiagnosticSetting cmdlet

Az.Network (previously AzureRM.Network)

  • Removed deprecated ResourceId parameter from Get-AzServiceEndpointPolicyDefinition cmdlet
  • Removed deprecated EnableVmProtection property from PSVirtualNetwork object
  • Removed deprecated Set-AzVirtualNetworkGatewayVpnClientConfig cmdlet

Az.OperationalInsights (previously AzureRM.OperationalInsights)

  • Default parameter set for Get-AzOperationalInsightsDataSource is removed, and ByWorkspaceNameByKind has become the default parameter set

Az.RecoveryServices (previously AzureRM.RecoveryServices, AzureRM.RecoveryServices.Backup, and AzureRM.RecoveryServices.SiteRecovery)

  • Removed Encryption parameter from New/Set-AzRecoveryServicesAsrPolicy cmdlet
  • TargetStorageAccountName parameter is now mandatory for managed disk restores in Restore-AzRecoveryServicesBackupItem cmdlet
  • Removed StorageAccountName and StorageAccountResourceGroupName parameters in Restore-AzRecoveryServicesBackupItem cmdlet
  • Removed Nameparameter in Get-AzRecoveryServicesBackupContainer cmdlet

Az.Resources (previously AzureRM.Resources)

  • Removed Sku parameter from New/Set-AzPolicyAssignment cmdlet
  • Removed Password parameter from New-AzADServicePrincipal and New-AzADSpCredential cmdlet

Az.ServiceFabric (previously AzureRM.ServiceFabric)

  • The following cmdlet return types have been changed:
    • The property SerivceTypeHealthPolicies of type ApplicationHealthPolicy has been removed.
    • The property ApplicationHealthPolicies of type ClusterUpgradeDeltaHealthPolicy has been removed.
    • The property OverrideUserUpgradePolicy of type ClusterUpgradePolicy has been removed.
    • These changes affect the following cmdlets:
      • Add-AzServiceFabricClientCertificate
      • Add-AzServiceFabricClusterCertificate
      • Add-AzServiceFabricNode
      • Add-AzServiceFabricNodeType
      • Get-AzServiceFabricCluster
      • Remove-AzServiceFabricClientCertificate
      • Remove-AzServiceFabricClusterCertificate
      • Remove-AzServiceFabricNode
      • Remove-AzServiceFabricNodeType
      • Remove-AzServiceFabricSetting
      • Set-AzServiceFabricSetting
      • Set-AzServiceFabricUpgradeType
      • Update-AzServiceFabricDurability
      • Update-AzServiceFabricReliability

Az.Sql (previously AzureRM.Sql)

  • Removed State and ResourceId parameters from Set-AzSqlDatabaseBackupLongTermRetentionPolicy cmdlet
  • Removed deprecated cmdlets: Get/Set-AzSqlServerBackupLongTermRetentionVault, Get/Start/Stop-AzSqlServerUpgrade, Get/Set-AzSqlDatabaseAuditingPolicy, Get/Set-AzSqlServerAuditingPolicy, Remove-AzSqlDatabaseAuditing, Remove-AzSqlServerAuditing
  • Removed deprecated parameter Current from Get-AzSqlDatabaseBackupLongTermRetentionPolicy cmdlet
  • Removed deprecated parameter DatabaseName from Get-AzSqlServerServiceObjective cmdlet
  • Removed deprecated parameter PrivilegedLogin from Set-AzSqlDatabaseDataMaskingPolicy cmdlet

Az.Storage (previously Azure.Storage and AzureRM.Storage)

  • To support creating an Oauth storage context with only the storage account name, the default parameter set has been changed to OAuthParameterSet
    • Example: $ctx = New-AzureStorageContext -StorageAccountName $accountName
  • The Location parameter has become mandatory in the Get-AzStorageUsage cmdlet
  • The XSCL API changes include, but not limited to:

1. Blob Snapshot

Before:
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -Context $ctx
$b.ICloudBlob.Snapshot()
After:
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -Context $ctx
$task = $b.ICloudBlob.SnapshotAsync()
$task.Wait()
$snapshot = $task.Result

2. Share Snapshot

Before:
$Share = Get-AzureStorageShare -Name $containerName -Context $ctx
$snapshot = $Share.Snapshot()
After:
$Share = Get-AzureStorageShare -Name $containerName -Context $ctx
$task = $Share.SnapshotAsync()
$task.Wait()
$snapshot = $task.Result

3. Undelete a soft delete blob

Before:
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -IncludeDeleted -Context $ctx
$b.ICloudBlob.Undelete()
After:
$b = Get-AzureStorageBlob -Container $containerName -Blob $blobName -IncludeDeleted -Context $ctx
$task = $b.ICloudBlob.UndeleteAsync()
$task.Wait()

4. Set Blob Tier

Before:
$blockBlob = Get-AzureStorageBlob -Container $containerName -Blob $blockBlobName -Context $ctx
$blockBlob.ICloudBlob.SetStandardBlobTier("hot")

$pageBlob = Get-AzureStorageBlob -Container $containerName -Blob $pageBlobName -Context $ctx
$pageBlob.ICloudBlob.SetPremiumBlobTier("P4")
After:
$blockBlob = Get-AzureStorageBlob -Container $containerName -Blob $blockBlobName -Context $ctx
$task = $blockBlob.ICloudBlob.SetStandardBlobTierAsync("hot")
$task.Wait()

$pageBlob = Get-AzureStorageBlob -Container $containerName -Blob $pageBlobName -Context $ctx
$task = $pageBlob.ICloudBlob.SetPremiumBlobTierAsync("P4")
$task.Wait()

Az.Websites (previously AzureRM.Websites)

  • Removed deprecated properties from the PSAppServicePlan, PSCertificate, PSCloningInfo, and PSSite objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment