|
| 1 | + |
| 2 | +This document serves as both a breaking change notification and migration guide for consumers of the azure powershell version 2.3.0. This release is specific to 2018-03-01-hybrid profile. The list of api versions supported by this profile can be found at https://aka.ms/2018profile. |
| 3 | + |
| 4 | +## Table of Contents |
| 5 | + |
| 6 | +- [Common Changes](#common-changes) |
| 7 | +- [Breaking changes to Storage cmdlets](#breaking-changes-to-storage-cmdlets) |
| 8 | +- [Breaking changes to Compute cmdlets](#breaking-changes-to-compute-cmdlets) |
| 9 | +- [Breaking changes to Resources cmdlets](#breaking-changes-to-resources-cmdlets) |
| 10 | +- [Breaking changes to Network cmdlets](#breaking-changes-to-network-cmdlets) |
| 11 | + |
| 12 | +## Common Changes |
| 13 | + |
| 14 | +### Context autosave enabled by default |
| 15 | +Context autosave is the storage of Azure login information that can be used between new and different PowerShell sessions. For more information on context autosave, please see (https://docs.microsoft.com/en-us/powershell/azure/context-persistence). |
| 16 | +Previously by default, context autosave was disabled, which meant the user's Azure login information was not stored between sessions until they ran the `Enable-AzureRmContextAutosave` cmdlet to turn on context persistence. Moving forward, context autosave will be enabled by default, which means that users _with no saved context autosave settings_ will have their context stored the next time they login. Users can opt out of this functionality by using the `Disable-AzureRmContextAutosave` cmdlet. |
| 17 | + |
| 18 | +### AzureRm.Profile dependency |
| 19 | +All the modules in the AzureRm 2.3.0 are taking ModuleVersion dependency on the AzureRm.Profile module. This means that any future versions of AzureRm.Profile modules will also be compatible with all other modules getting shipped part of AzureRm 2.3.0 version |
| 20 | + |
| 21 | +## Breaking changes to Storage cmdlets |
| 22 | + |
| 23 | +### **Get-AzureRmStorageAccountKey** |
| 24 | +- The cmdlet now returns a list of keys, rather than an object with properties for each key |
| 25 | + |
| 26 | +```powershell |
| 27 | +# Old |
| 28 | +$key = (Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $accountName).Key1 |
| 29 | + # New |
| 30 | +$key = (Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $accountName)[0].Value |
| 31 | +``` |
| 32 | + |
| 33 | +**New-AzureRmStorageAccountKey** |
| 34 | +- `StorageAccountRegenerateKeyResponse` field in output of this cmdlet is renamed to `StorageAccountListKeysResults`, which is now a list of keys rather than an object with properties for each key |
| 35 | + |
| 36 | +```powershell |
| 37 | +# Old |
| 38 | +$key = (New-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $accountName).StorageAccountKeys.Key1 |
| 39 | + # New |
| 40 | +$key = (New-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $accountName).Keys[0].Value |
| 41 | +``` |
| 42 | + |
| 43 | +### **New/Get/Set-AzureRmStorageAccount** |
| 44 | +- `AccountType` field in output of this cmdlet is renamed to `Sku.Name` |
| 45 | +- Output type for PrimaryEndpoints/Secondary endpoints blob/table/queue/file changed from `Uri` to `String` |
| 46 | + |
| 47 | +```powershell |
| 48 | +# Old |
| 49 | +$accountType = (Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $accountName).AccountType |
| 50 | + # New |
| 51 | +$accountType = (Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $accountName).Sku.Name |
| 52 | +``` |
| 53 | + |
| 54 | +```powershell |
| 55 | +# Old |
| 56 | +$blobEndpoint = (Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $accountName).PrimaryEndpoints.Blob.ToString() |
| 57 | +$blobEndpoint = (Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $accountName).PrimaryEndpoints.Blob.AbsolutePath |
| 58 | + # New |
| 59 | +$blobEndpoint = (Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $accountName).PrimaryEndpoints.Blob.ToString() |
| 60 | +$blobEndpoint = (Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $accountName).PrimaryEndpoints.Blob |
| 61 | +``` |
| 62 | + |
| 63 | + |
| 64 | +## Breaking changes to Compute cmdlets |
| 65 | + |
| 66 | +### Add-AzureRmVmssExtension |
| 67 | + The parameter name VirtualMachineScaleSetExtensionType got changed to Type |
| 68 | + |
| 69 | +### Remove-AzureRmVmss |
| 70 | + Needs -Force parameter to suppress confirmation |
| 71 | + |
| 72 | +### Stop-AzureRmVmss |
| 73 | + Needs -Force parameter to suppress confirmation |
| 74 | + |
| 75 | + |
| 76 | +### PSVirtualMachine |
| 77 | +- Top level properties `DataDiskNames` and `NetworkInterfaceIDs` of nthe `PSVirtualMachine` object have been removed from the output type. These properties have always been available in the `StorageProfile` and `NetworkProfile` properties of the `PSVirtualMachine` object and will be the way they will need to be accessed going forward. |
| 78 | +- This change affects the following cmdlets: |
| 79 | + - `Add-AzureRmVMDataDisk` |
| 80 | + - `Add-AzureRmVMNetworkInterface` |
| 81 | + - `Get-AzureRmVM` |
| 82 | + - `Remove-AzureRmVMDataDisk` |
| 83 | + - `Remove-AzureRmVMNetworkInterface` |
| 84 | + - `Set-AzureRmVMDataDisk` |
| 85 | + |
| 86 | +```powershell |
| 87 | +# Old |
| 88 | +$vm.DataDiskNames |
| 89 | +$vm.NetworkInterfaceIDs |
| 90 | + # New |
| 91 | +$vm.StorageProfile.DataDisks | Select -Property Name |
| 92 | +$vm.NetworkProfile.NetworkInterfaces | Select -Property Id |
| 93 | +``` |
| 94 | + |
| 95 | +### **Set-AzureRmVMAccessExtension** |
| 96 | +- Parameters "UserName" and "Password" are being replaced in favor of a PSCredential |
| 97 | + |
| 98 | +```powershell |
| 99 | +# Old |
| 100 | +Set-AzureRmVMAccessExtension [other required parameters] -UserName "plain-text string" -Password "plain-text string" |
| 101 | + # New |
| 102 | +Set-AzureRmVMAccessExtension [other required parameters] -Credential $PSCredential |
| 103 | +``` |
| 104 | + |
| 105 | +### **Find-AzureRmResource** |
| 106 | +- This cmdlet was removed and the functionality was moved into `Get-AzureRmResource` |
| 107 | + |
| 108 | +```powershell |
| 109 | +# Old |
| 110 | +Find-AzureRmResource -ResourceType "Microsoft.Web/sites" -ResourceGroupNameContains "ResourceGroup" |
| 111 | +Find-AzureRmResource -ResourceType "Microsoft.Web/sites" -ResourceNameContains "test" |
| 112 | + # New |
| 113 | +Get-AzureRmResource -ResourceType "Microsoft.Web/sites" -ResourceGroupName "*ResourceGroup*" |
| 114 | +Get-AzureRmResource -ResourceType "Microsoft.Web/sites" -Name "*test*" |
| 115 | +``` |
| 116 | + |
| 117 | +### **Find-AzureRmResourceGroup** |
| 118 | +- This cmdlet was removed and the functionality was moved into `Get-AzureRmResourceGroup` |
| 119 | + |
| 120 | +```powershell |
| 121 | +# Old |
| 122 | +Find-AzureRmResourceGroup |
| 123 | +Find-AzureRmResourceGroup -Tag @{ "testtag" = $null } |
| 124 | +Find-AzureRmResourceGroup -Tag @{ "testtag" = "testval" } |
| 125 | + # New |
| 126 | +Get-AzureRmResourceGroup |
| 127 | +Get-AzureRmResourceGroup -Tag @{ "testtag" = $null } |
| 128 | +Get-AzureRmResourceGroup -Tag @{ "testtag" = "testval" } |
| 129 | +``` |
| 130 | + |
| 131 | +### **New-AzureRmADAppCredential** |
| 132 | +- Parameter "Password" being replaced in favor of a SecureString |
| 133 | +```powershell |
| 134 | +# Old |
| 135 | +New-AzureRmADAppCredential [other required parameters] -Password "plain-text string" |
| 136 | + # New |
| 137 | +New-AzureRmADAppCredential [other required parameters] -Password $SecureStringVariable |
| 138 | +``` |
| 139 | + |
| 140 | +### **New-AzureRmADApplication** |
| 141 | +- Parameter "Password" being replaced in favor of a SecureString |
| 142 | +```powershell |
| 143 | +# Old |
| 144 | +New-AzureRmADApplication [other required parameters] -Password "plain-text string" |
| 145 | + # New |
| 146 | +New-AzureRmADApplication [other required parameters] -Password $SecureStringVariable |
| 147 | +``` |
| 148 | +### **New-AzureRmADServicePrincipal** |
| 149 | +- Parameter "Password" being replaced in favor of a SecureString |
| 150 | +```powershell |
| 151 | +# Old |
| 152 | +New-AzureRmADServicePrincipal [other required parameters] -Password "plain-text string" |
| 153 | + # New |
| 154 | +New-AzureRmADServicePrincipal [other required parameters] -Password $SecureStringVariable |
| 155 | +``` |
| 156 | + |
| 157 | +### **New-AzureRmADSpCredential** |
| 158 | +- Parameter "Password" being replaced in favor of a SecureString |
| 159 | +```powershell |
| 160 | +# Old |
| 161 | +New-AzureRmADSpCredential [other required parameters] -Password "plain-text string" |
| 162 | + # New |
| 163 | +New-AzureRmADSpCredential [other required parameters] -Password $SecureStringVariable |
| 164 | +``` |
| 165 | +### **New-AzureRmADUser** |
| 166 | +- Parameter "Password" being replaced in favor of a SecureString |
| 167 | +```powershell |
| 168 | +# Old |
| 169 | +New-AzureRmADUser [other required parameters] -Password "plain-text string" |
| 170 | + # New |
| 171 | +New-AzureRmADUser [other required parameters] -Password $SecureStringVariable |
| 172 | +``` |
| 173 | +### **Set-AzureRmADUser** |
| 174 | +- Parameter "Password" being replaced in favor of a SecureString |
| 175 | +```powershell |
| 176 | +# Old |
| 177 | +Set-AzureRmADUser [other required parameters] -Password "plain-text string" |
| 178 | + # New |
| 179 | +Set-AzureRmADUser [other required parameters] -Password $SecureStringVariable |
| 180 | +``` |
| 181 | + |
| 182 | +## Breaking changes to Network cmdlets |
| 183 | + |
| 184 | +###**New-AzureRmVirtualNetworkGateway** |
| 185 | +- Description of what has changed ``:- Bool parameter:-ActiveActive`` is removed and ``SwitchParameter:-EnableActiveActiveFeature`` is added for enabling Active-Active feature on newly creating virtual network gateway. |
| 186 | +```powershell |
| 187 | +# Old |
| 188 | +# Sample of how the cmdlet was previously called |
| 189 | +New-AzureRmVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -Location $location -IpConfigurations $vnetIpConfig1,$vnetIpConfig2 -GatewayType Vpn -VpnType RouteBased -EnableBgp $false -GatewaySku HighPerformance -ActiveActive $true |
| 190 | + # New |
| 191 | +# Sample of how the cmdlet should now be called |
| 192 | +New-AzureRmVirtualNetworkGateway -ResourceGroupName $rgname -name $rname -Location $location -IpConfigurations $vnetIpConfig1,$vnetIpConfig2 -GatewayType Vpn -VpnType RouteBased -EnableBgp $false -GatewaySku HighPerformance -EnableActiveActiveFeature |
| 193 | +``` |
| 194 | + |
| 195 | +### **Set-AzureRmVirtualNetworkGateway** |
| 196 | +- Description of what has changed ``:- Bool parameter:-ActiveActive`` is removed and 2 ``SwitchParameters:-EnableActiveActiveFeature`` / ``DisableActiveActiveFeature`` are added for enabling and disabling Active-Active feature on virtual network gateway. |
| 197 | + |
| 198 | +```powershell |
| 199 | +# Old |
| 200 | +# Sample of how the cmdlet was previously called |
| 201 | +Set-AzureRmVirtualNetworkGateway -VirtualNetworkGateway $gw -ActiveActive $true |
| 202 | +Set-AzureRmVirtualNetworkGateway -VirtualNetworkGateway $gw -ActiveActive $false |
| 203 | + # New |
| 204 | +# Sample of how the cmdlet should now be called |
| 205 | +Set-AzureRmVirtualNetworkGateway -VirtualNetworkGateway $gw -EnableActiveActiveFeature |
| 206 | +Set-AzureRmVirtualNetworkGateway -VirtualNetworkGateway $gw -DisableActiveActiveFeature |
| 207 | +``` |
| 208 | + |
| 209 | + |
| 210 | +### New-AzureRmVirtualNetworkGatewayConnection |
| 211 | +- `EnableBgp` parameter has been changed to take a `boolean` instead of a `string` |
| 212 | + |
| 213 | +```powershell |
| 214 | +# Old |
| 215 | +New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName "RG" -name "conn1" -VirtualNetworkGateway1 $vnetGateway -LocalNetworkGateway2 $localnetGateway -ConnectionType IPsec -SharedKey "key" -EnableBgp "true" |
| 216 | +# New |
| 217 | +New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName "RG" -name "conn1" -VirtualNetworkGateway1 $vnetGateway -LocalNetworkGateway2 $localnetGateway -ConnectionType IPsec -SharedKey "key" -EnableBgp $true |
0 commit comments