Skip to content

Commit 6eb325e

Browse files
committed
Add "breaking changes to profile" cmdlets section
1 parent 11cb37d commit 6eb325e

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

documentation/release-notes/Stack/migration-guide.1.2.11.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Table of Contents
22
1. [Removal of Force parameters](#removal-of-force-parameters)
33
2. [Change of Tag parameters](#change-of-tag-parameters)
4+
3. [Breaking Changes to Profile Cmdlets](#breaking-changes-to-profile-cmdlets)
45

56
## Removal of Force parameters
67

@@ -114,4 +115,137 @@ New-AzureRmResourceGroup -Name $resourceGroupName -Location -location -Tags @{ N
114115
New-AzureRmResourceGroup -Name $resourceGroupName -Location -location -Tag @{ testtag = "testval" }
115116
```
116117

118+
<br>
119+
120+
## Breaking Changes to Profile Cmdlets
121+
122+
The following cmdlets and cmdlet output types were changed in this release.
123+
124+
### Add-AzureRmAccount breaking changes
125+
126+
- ```EnvironmentName``` parameter has been removed and replaced with ```Environment```, the ```Environment``` now takes a string and not an ```AzureEnvironment``` object
127+
128+
```powershell
129+
# Old
130+
Add-AzureRmAccount -EnvironmentName AzureStack
131+
132+
# New
133+
Add-AzureRmAccount -Environment AzureStack
134+
```
135+
136+
### Select-AzureRmProfile was renamed to Import-AzureRmContext
137+
138+
```Select-AzureRmProfile``` was renamed to ```Import-AzureRmContext```
139+
140+
```powershell
141+
# Old
142+
Select-AzureRmProfile -Path c:\mydir\myprofile.json
143+
144+
# New
145+
Import-AzureRmContext -Path c:\mydir\myprofile.json
146+
```
147+
148+
### Save-AzureRmProfile was renamed to Save-AzureRmContext
149+
150+
```Save-AzureRmProfile``` was renamed to ```Save-AzureRmContext```
151+
152+
```powershell
153+
# Old
154+
Save-AzureRmProfile -Path c:\mydir\myprofile.json
155+
156+
# New
157+
Save-AzureRmContext -Path c:\mydir\myprofile.json
158+
```
159+
### Breaking Changes to output PSAzureContext Type
160+
161+
- The ```TokenCache``` property changed to a type that implements ```IAzureTokenCache``` instead of a ```byte[]```
162+
163+
```powershell
164+
# Old
165+
$bytes = (Get-AzureRmContext).TokenCache
166+
$bytes = (Set-AzureRmContext -SubscriptionId xxx-xxx-xxx-xxx).TokenCache
167+
$bytes = (Add-AzureRmAccount).Context.TokenCache
168+
169+
# New
170+
$bytes = (Get-AzureRmContext).TokenCache.CacheData
171+
$bytes = (Set-AzureRmContext -SubscriptionId xxx-xxx-xxx-xxx).TokenCache.CacheData
172+
$bytes = (Add-AzureRmAccount).Context.TokenCache.CacheData
173+
```
174+
175+
### Breaking Changes to the output PSAzureAccount Type
176+
177+
- The ```AccountType``` property was changed to ```Type```
178+
179+
```powershell
180+
# Old
181+
$type = (Get-AzureRmContext).Account.AccountType
182+
$type = (Set-AzureRmContext -SubscriptionId xxx-xxx-xxx-xxx).Account.AccountType
183+
$type = (Add-AzureRmAccount).Context.Account.AccountType
184+
185+
# New
186+
$type = (Get-AzureRmContext).Account.Type
187+
$type = (Set-AzureRmContext -SubscriptionId xxx-xxx-xxx-xxx).Account.Type
188+
$type = (Add-AzureRmAccount).Context.Account.Type
189+
```
190+
191+
### Breaking Changes to the output PSAzureSubscription Type
192+
- The ```SubscriptionId``` property was changed to ```Id```
193+
194+
```powershell
195+
# Old
196+
$id =(Get-AzureRmSubscription -SubscriptionId xxxx-xxxx-xxxx-xxxx).SubscriptionId
197+
$id =(Add-AzureRmAccount -SubscriptionId xxxx-xxxx-xxxx-xxxx).Context.Subscription.SubscriptionId
198+
$id =(Get-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.SubscriptionId
199+
$id =(Set-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.SubscriptionId
200+
201+
# New
202+
$id =(Get-AzureRmSubscription -SubscriptionId xxxx-xxxx-xxxx-xxxx).Id
203+
$id =(Add-AzureRmAccount -SubscriptionId xxxx-xxxx-xxxx-xxxx).Context.Subscription.Id
204+
$id =(Get-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.Id
205+
$id =(Set-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.Id
206+
```
207+
208+
- The ```SubscriptionName``` property was changed to ```Name```
209+
210+
```powershell
211+
# Old
212+
$name =(Get-AzureRmSubscription -SubscriptionId xxxx-xxxx-xxxx-xxxx).SubscriptionName
213+
$name =(Add-AzureRmAccount -SubscriptionId xxxx-xxxx-xxxx-xxxx).Context.Subscription.SubscriptionName
214+
$name =(Get-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.SubscriptionName
215+
$name =(Set-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.SubscriptionName
216+
217+
# New
218+
$name =(Get-AzureRmSubscription -SubscriptionId xxxx-xxxx-xxxx-xxxx).Name
219+
$name =(Add-AzureRmAccount -SubscriptionId xxxx-xxxx-xxxx-xxxx).Context.Subscription.Name
220+
$name =(Get-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.Name
221+
$name =(Set-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Subscription.Name
222+
```
223+
224+
### Breaking Changes to the output PSAzureTenant Type
225+
226+
- The ```TenantId``` property was changed to ```Id```
227+
228+
```powershell
229+
# Old
230+
$id =(Get-AzureRmTenant -TenantId xxxx-xxxx-xxxx-xxxx).TenantId
231+
$id =(Add-AzureRmAccount -SubscriptionId xxxx-xxxx-xxxx-xxxx).Context.Tenant.TenantId
232+
$id =(Get-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Tenant.TenantId
233+
$id =(Set-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Tenant.TenantId
234+
235+
# New
236+
$id =(Get-AzureRmTenant -TenantId xxxx-xxxx-xxxx-xxxx).Id
237+
$id =(Add-AzureRmAccount -SubscriptionId xxxx-xxxx-xxxx-xxxx).Context.Tenant.Id
238+
$id =(Get-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Tenant.Id
239+
$id =(Set-AzureRmContext -SubscriptionId xxxx-xxxx-xxxx-xxxx).Tenant.Id
240+
```
241+
242+
- The ```Domain``` property was changed to ```Directory```
243+
244+
```powershell
245+
# Old
246+
$tenantName =(Get-AzureRmTenant -TenantId xxxx-xxxx-xxxx-xxxx).Domain
247+
248+
# New
249+
$tenantName =(Get-AzureRmTenant -TenantId xxxx-xxxx-xxxx-xxxx).Directory
250+
```
117251

0 commit comments

Comments
 (0)