Skip to content

Add back SubscriptionId and TenantId for visual studio script compati… #4414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Commands.Profile.Models;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Commands.ScenarioTest;
using Microsoft.Azure.ServiceManagemenet.Common.Models;
using Microsoft.WindowsAzure.Commands.Common;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Commands.Common.Authentication.Models;
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
using Microsoft.Azure.Commands.Profile.Models;
using Microsoft.Azure.ServiceManagemenet.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
Expand Down Expand Up @@ -309,6 +322,7 @@ public void CanConvertValidAzureSubscriptions(string account, string name, strin
Assert.Equal(expectedAccountName, subscription.CurrentStorageAccountName);
Assert.Equal(storageAccount, subscription.CurrentStorageAccount);
Assert.NotNull(subscription.ToString());
Assert.Equal(oldSubscription.Id, subscription.SubscriptionId);
}

[Fact]
Expand Down Expand Up @@ -372,6 +386,7 @@ public void CanConvertValidAzureTenants(string domain)
Assert.Equal(oldTenant.Directory, tenant.Directory);
Assert.Equal(oldTenant.Id.ToString(), tenant.Id);
Assert.NotNull(tenant.ToString());
Assert.Equal(oldTenant.Id, tenant.TenantId);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public PSAzureSubscription(IAzureSubscription other)
/// </summary>
public string State { get; set; }

/// <summary>
/// For legacy support - return the subscription Id
/// </summary>
public string SubscriptionId { get { return Id; } }

/// <summary>
/// The tenant home for the subscription.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public PSAzureTenant(IAzureTenant other)
this.CopyFrom(other);
}
/// <summary>
/// The subscription id.
/// The tenant id.
/// </summary>
public string Id { get; set; }

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

/// <summary>
/// For legacy support - the tenant id
/// </summary>
public string TenantId { get { return Id; } }

/// <summary>
/// Extended proeprties of the tenant
/// </summary>
Expand Down