Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This document describes the changes between the 1.0.0 and 2.0.0 versions of Az
Table of Contents
Module breaking changes
Az.Compute
Removed
ManagedParameter fromNew-AzAvailabilitySetandUpdate-AzAvailabilitySetcmdlets in favor of usingSku = AlignedBefore
Update-AzAvailabilitySet -ManagedAfter
Update-AzAvailabilitySet -Sku AlignedFor consistency, removed
Imageparameter from 'ByName' and 'ByResourceId' parameter sets inUpdate-AzImageBefore
Note that the below code is functional, but the passed-in ImageName is not used, so removing this parameter has no functional impact.
Update-AzImage -ResourceGroupName $Rg -ImageName $Name -Image $Image -Tag $tags Update-AzImage -ResourceId $Id -Image $Image -Tag $tagsAfter
Update-AzImage -ResourceGroupName $Rg -ImageName $Name -Tag $tags Update-AzImage -ResourceId $Id -Tag $tagsFor consistency, removed
Nameparameter from 'ByObject' and 'ByResourceId' parameter sets inRestart-AzVMBefore
Note that the below code is functional, but the passed-in Name is not used, so removing this parameter has no functional impact.
Restart-AzVM -InputObject $VM -Name $Name Restart-AzVM -ResourceId $Id -Name $NameAfter
Restart-AzVM -InputObject $VM Restart-AzVM -ResourceId $IdFor consistency, removed
Nameparameter from 'ByObject' and 'ByResourceId' parameter sets inStart-AzVMBefore
Note that the below code is functional, but the passed-in Name is not used, so removing this parameter has no functional impact.
Start-AzVM -InputObject $VM -Name $Name Start-AzVM -ResourceId $Id -Name $NameAfter
Start-AzVM -InputObject $VM Start-AzVM -ResourceId $IdFor consistency, removed
Nameparameter from 'ByObject' and 'ByResourceId' parameter sets inStop-AzVMBefore
Note that the below code is functional, but the passed-in Name is not used, so removing this parameter has no functional impact.
Stop-AzVM -InputObject $VM -Name $Name Stop-AzVM -ResourceId $Id -Name $NameAfter
Stop-AzVM -InputObject $VM Stop-AzVM -ResourceId $IdFor consistency, removed
Nameparameter from 'ByObject' and 'ByResourceId' parameter sets inRemove-AzVMBefore
Note that the below code is functional, but the passed-in Name is not used, so removing this parameter has no functional impact.
Remove-AzVM -InputObject $VM -Name $Name Remove-AzVM -ResourceId $Id -Name $NameAfter
Remove-AzVM -InputObject $VM Remove-AzVM -ResourceId $IdFor consistency, removed
Nameparameter from 'ByObject' and 'ByResourceId' parameter sets inSet-AzVMBefore
Note that the below code is functional, but the passed-in Name is not used, so removing this parameter has no functional impact.
Set-AzVM -InputObject $VM -Name $Name ... Set-AzVM -ResourceId $Id -Name $Name ...After
Set-AzVM -InputObject $VM ... Set-AzVM -ResourceId $Id ...For consistency, removed
Nameparameter from 'ByObject' and 'ByResourceId' parameter sets inSave-AzVMImageBefore
Note that the below code is functional, but the passed-in Name is not used, so removing this parameter has no functional impact.
Save-AzVMImage -InputObject $VM -Name $Name ... Save-AzVMImage -ResourceId $Id -Name $Name ...After
Save-AzVMImage -InputObject $VM ... Save-AzVMImage -ResourceId $Id ...Added ProtectionPolicy property to encapsulate
ProtectFromScaleInproperty inPSVirtualMachineScaleSetVMBefore
$vmss = Get-AzVMssVM ... $vmss.ProtectFromScaleIn = $true $vmss = Update-AzVMssVM ... $vmss.ProtectFromScaleIn = $true $vmss = Remove-AzVMssVMDataDisk ... $vmss.ProtectFromScaleIn = $trueAfter
$vmss = Get-AzVMssVM ... $vmss.ProtectionPolicy.ProtectFromScaleIn = $true $vmss = Update-AzVMssVM ... $vmss.ProtectionPolicy.ProtectFromScaleIn = $true $vmss = Remove-AzVMssVMDataDisk ... $vmss.ProtectionPolicy.ProtectFromScaleIn = $trueAdded
EncryptionSettingsCollectionProperty to encloseEncryptionSettingsproperty inPSDiskBefore
$disk = New-AzDisk ... | Set-AzDiskDiskEncrytionKey ... $disk.EncryptionSettings $disk = New-AzDisk ... | Set-AzDiskKeyEncrytionKey ... $disk.EncryptionSettings $update = New-AzDiskUpdateConfig | Set-AzDiskUpdateDiskEncryptionKey ... $update.EncryptionSettings $update = New-AzDiskUpdateConfig | Set-AzDiskUpdateKeyEncryptionKey ... $update.EncryptionSettingsAfter
$disk = New-AzDisk ... | Set-AzDiskDiskEncrytionKey ... $disk.EncryptionSettingsCollection.EncryptionSettings $disk = New-AzDisk ... | Set-AzDiskKeyEncrytionKey ... $disk.EncryptionSettingsCollection.EncryptionSettings $update = New-AzDiskUpdateConfig | Set-AzDiskUpdateDiskEncryptionKey ... $update.EncryptionSettingsCollection.EncryptionSettings $update = New-AzDiskUpdateConfig | Set-AzDiskUpdateKeyEncryptionKey ... $update.EncryptionSettingsCollection.EncryptionSettingsAdded
EncryptionSettingsCollectionProperty to encloseEncryptionSettingsproperty inPSSnapshotBefore
$snap = New-AzSnapshotConfig ... | Set-AzSnapshotDiskEncryptionKey ... $snap.EncryptionSettings $snap = New-AzSnapshotConfig ... | Set-AzSnapshotKeyEncryptionKey ... $snap.EncryptionSettings $update = New-AzSnapshotUpdateConfig ... | Set-AzSnapshotUpdateDiskEncryptionKey ... $update.EncryptionSettings $update = New-AzSnapshotUpdateConfig ... | Set-AzSnapshotUpdateKeyEncryptionKey ... $update.EncryptionSettingsAfter
$snap = New-AzSnapshotConfig ... | Set-AzSnapshotDiskEncryptionKey ... $snap.EncryptionSettingsCollection.EncryptionSettings $snap = New-AzSnapshotConfig ... | Set-AzSnapshotKeyEncryptionKey ... $snap.EncryptionSettingsCollection.EncryptionSettings $update = New-AzSnapshotUpdateConfig ... | Set-AzSnapshotUpdateDiskEncryptionKey ... $update.EncryptionSettingsCollection.EncryptionSettings $update = New-AzSnapshotUpdateConfig ... | Set-AzSnapshotUpdateKeyEncryptionKey ... $update.EncryptionSettingsCollection.EncryptionSettingsRemoved
VirtualMachineProfileproperty fromPSVirtualMachineScaleSetBefore
$vmss = New-AzVMSSConfig ... $vmss.VirtualMachineProfile.AdditionalCapabilities.UltraSSDEnabled = $trueAfter
$vmss = New-AzVMSSConfig ... $vmss.AdditionalCapabilities.UltraSSDEnabled = $trueCmdlet
Set-AzVMBootDiagnosticremoved alias toSet-AzVMBootDiagnosticsBefore
Using deprecated alias
Set-AzVMBootDiagnosticsAfter
Set-AzVMBootDIagnosticCmdlet
Export-AzLogAnalyticThrottledRequestremoved alias toExport-AzLogAnalyticThrottledRequestsBefore
Using deprectaed alias
Export-AzLogAnalyticThrottledRequestsAfter
Export-AzLogAnalyticThrottledRequest
Az.HDInsight
- Removed the
Grant-AzHDInsightHttpServicesAccessandRevoke-AzHDInsightHttpServicesAccesscmdlets. These are no longer necessary because HTTP access is always enabled on all HDInsight clusters. - Added a new
Set-AzHDInsightGatewayCredentialcmdlet. Use this cmdlet to change the gateway HTTP username and password (replacesGrant-AzHDInsightHttpServicesAccess). - Updated the
Get-AzHDInsightJobOutputcmdlet to support granular role-based access to the storage key.- Users with HDInsight Cluster Operator, Contributor, or Owner roles will not be affected.
- Users with only the Reader role will need to specify
DefaultStorageAccountKeyparameter explicitly.
For more information about these role-based access changes, see aka.ms/hdi-config-update
Before
Grant-AzHDInsightHttpServicesAccess -ClusterName $cluster -HttpCredential $credential
After
Set-AzHDInsightGatewayCredential -ClusterName $cluster -HttpCredential $credential
Users with only Reader role for cmdlet Get-AzHDInsightJobOutput
Before
Get-AzHDInsightJobOutput -ClusterName $clusterName -JobId $jobId
After
Get-AzHDInsightJobOutput -ClusterName $clusterName -JobId $jobId -DefaultStorageAccountKey $storageAccountKey
Az.Storage
Namespaces for types returned from Blob, Queue, and File cmdlets have changed their namespace from
Microsoft.WindowsAzure.StoragetoMicrosoft.Azure.Storage. While this is not technically a breaking change according to the breaking change policy, it may require some changes in code that uses the methods from the Storage .Net SDK to interact with the objects returned from these cmdlets.Example 1: Add a message to a Queue (change CloudQueueMessage object namespace)
Before:
$queue = Get-AzStorageQueue –Name $queueName –Context $ctx $queueMessage = New-Object -TypeName "Microsoft.WindowsAzure.Storage.Queue.CloudQueueMessage,$($queue.CloudQueue.GetType().Assembly.FullName)" -ArgumentList "This is message 1" $queue.CloudQueue.AddMessageAsync($QueueMessage)After:
$queue = Get-AzStorageQueue –Name $queueName –Context $ctx $queueMessage = New-Object -TypeName "Microsoft.Azure.Storage.Queue.CloudQueueMessage,$($queue.CloudQueue.GetType().Assembly.FullName)" -ArgumentList "This is message 1" $queue.CloudQueue.AddMessageAsync($QueueMessage)Example 2: Fetch Blob/File Attributes with AccessCondition (change AccessCondition object namespace)
Before:
$accessCondition= New-Object Microsoft.WindowsAzure.Storage.AccessCondition $blob = Get-AzureStorageBlob -Container $containerName -Blob $blobName $blob.ICloudBlob.FetchAttributes($accessCondition) $file = Get-AzureStorageFile -ShareName $shareName -Path $filepath $file.FetchAttributes($accessCondition)After:
$accessCondition= New-Object Microsoft.Azure.Storage.AccessCondition $blob = Get-AzureStorageBlob -Container $containerName -Blob $blobName $blob.ICloudBlob.FetchAttributes($accessCondition) $file = Get-AzureStorageFile -ShareName $shareName -Path $filepath $file.FetchAttributes($accessCondition)While not technically a breaking change, you will notice output differences in the Sku.Name property of Storage Accounts returned from
New/Get/Set-AzStorageAccountchanges are as follows. (After the change, output and input SkuName are aligned.)- "StandardLRS" -> "Standard_LRS";
- "StandardGRS" -> "Standard_GRS";
- "StandardRAGRS" -> "Standard_RAGRS";
- "StandardZRS" -> "Standard_ZRS";
- "PremiumLRS" -> "Premium_LRS";
The default service behavior when creating a storage account withous specifying a Kind has changed. In previous versions, when a storage account was created with no
Kindspecified, the Storage account Kind ofStoragewas used, in the new versionStorageV2is the defaultKindvalue. If you need to create a V1 Storage account with Kind 'Storage', add parameter '-Kind Storage'Example : Create a storage Account (Default Kind change)
Before:
PS c:\> New-AzStorageAccount -ResourceGroupName groupname -Name accountname -SkuName Standard_LRS -Location "westus" StorageAccountName ResourceGroupName Location SkuName Kind AccessTier CreationTime ProvisioningState EnableHttpsTrafficOnly ------------------ ----------------- -------- ------- ---- ---------- ------------ ----------------- ---------------------- accountname groupname westus StandardLRS Storage Hot 4/17/2018 10:34:32 AM Succeeded FalseAfter:
PS c:\> New-AzStorageAccount -ResourceGroupName groupname -Name accountname -SkuName Standard_LRS -Location "westus" StorageAccountName ResourceGroupName Location SkuName Kind AccessTier CreationTime ProvisioningState EnableHttpsTrafficOnly ------------------ ----------------- -------- ------- ---- ---------- ------------ ----------------- ---------------------- accountname groupname westus Standard_LRS StorageV2 Hot 4/17/2018 10:34:32 AM Succeeded False
Azure PowerShell