Skip to content

Commit e9a4cb3

Browse files
authored
Merge pull request #4414 from markcowl/vssubid
Add back SubscriptionId and TenantId for visual studio script compati…
2 parents f4c9f4d + 544546d commit e9a4cb3

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

src/ResourceManager/Profile/Commands.Profile.Test/TenantCmdletTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
1717
using Microsoft.Azure.Commands.Common.Authentication.Models;
1818
using Microsoft.Azure.Commands.Profile.Models;
19-
using Microsoft.Azure.Commands.ResourceManager.Common;
2019
using Microsoft.Azure.Commands.ScenarioTest;
2120
using Microsoft.Azure.ServiceManagemenet.Common.Models;
22-
using Microsoft.WindowsAzure.Commands.Common;
2321
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
2422
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2523
using Microsoft.WindowsAzure.Commands.Utilities.Common;

src/ResourceManager/Profile/Commands.Profile.Test/TypeConversionTests.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2-
using Microsoft.Azure.Commands.Common.Authentication.Models;
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
316
using Microsoft.Azure.Commands.Profile.Models;
417
using Microsoft.Azure.ServiceManagemenet.Common.Models;
518
using Microsoft.WindowsAzure.Commands.ScenarioTest;
@@ -309,6 +322,7 @@ public void CanConvertValidAzureSubscriptions(string account, string name, strin
309322
Assert.Equal(expectedAccountName, subscription.CurrentStorageAccountName);
310323
Assert.Equal(storageAccount, subscription.CurrentStorageAccount);
311324
Assert.NotNull(subscription.ToString());
325+
Assert.Equal(oldSubscription.Id, subscription.SubscriptionId);
312326
}
313327

314328
[Fact]
@@ -372,6 +386,7 @@ public void CanConvertValidAzureTenants(string domain)
372386
Assert.Equal(oldTenant.Directory, tenant.Directory);
373387
Assert.Equal(oldTenant.Id.ToString(), tenant.Id);
374388
Assert.NotNull(tenant.ToString());
389+
Assert.Equal(oldTenant.Id, tenant.TenantId);
375390
}
376391

377392
[Fact]

src/ResourceManager/Profile/Commands.Profile/Models/PSAzureSubscription.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public PSAzureSubscription(IAzureSubscription other)
8787
/// </summary>
8888
public string State { get; set; }
8989

90+
/// <summary>
91+
/// For legacy support - return the subscription Id
92+
/// </summary>
93+
public string SubscriptionId { get { return Id; } }
94+
9095
/// <summary>
9196
/// The tenant home for the subscription.
9297
/// </summary>

src/ResourceManager/Profile/Commands.Profile/Models/PSAzureTenant.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public PSAzureTenant(IAzureTenant other)
7171
this.CopyFrom(other);
7272
}
7373
/// <summary>
74-
/// The subscription id.
74+
/// The tenant id.
7575
/// </summary>
7676
public string Id { get; set; }
7777

@@ -80,6 +80,11 @@ public PSAzureTenant(IAzureTenant other)
8080
/// </summary>
8181
public string Directory { get; set; }
8282

83+
/// <summary>
84+
/// For legacy support - the tenant id
85+
/// </summary>
86+
public string TenantId { get { return Id; } }
87+
8388
/// <summary>
8489
/// Extended proeprties of the tenant
8590
/// </summary>

0 commit comments

Comments
 (0)