Skip to content

Commit d267f56

Browse files
committed
Merge branch 'dev' into resourcemanager-api20180501
2 parents 8b9372a + b1813ad commit d267f56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+192
-26
lines changed

src/Authentication.Abstractions/AzureRmProfileProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
16+
#if NETSTANDARD
17+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
18+
#endif
19+
1620
using System;
1721
using System.Threading;
1822

src/Authentication.Abstractions/AzureSMProfileProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
16+
#if NETSTANDARD
17+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
18+
#endif
1619
using System;
1720
using System.Threading;
1821

src/Authentication.Abstractions/Extensions/AzureAccountExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
using System;
1616
using System.Collections.Generic;
1717
using System.Linq;
18+
#if NETSTANDARD
19+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
20+
#endif
21+
1822

1923
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
2024
{

src/Authentication.Abstractions/Extensions/AzureContextExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
using System;
1616
using System.Linq;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
19+
#endif
1720

1821
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
1922
{

src/Authentication.Abstractions/Interfaces/IAzureContextContainer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414

1515
using System.Collections.Generic;
1616

17+
#if NETSTANDARD
18+
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core
19+
#else
1720
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
21+
#endif
1822
{
1923
/// <summary>
2024
/// Storage container for all targeted environments, allowing the user to store named target configurations

src/Authentication.Abstractions/Interfaces/IClientAction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
using Microsoft.Rest;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
19+
#endif
1720

1821
namespace Microsoft.Azure.Commands.Common.Authentication.Models
1922
{

src/Authentication.Abstractions/Interfaces/IHyakClientAction.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
using Hyak.Common;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
19+
#endif
1720

1821
namespace Microsoft.Azure.Commands.Common.Authentication.Models
1922
{

src/Authentication.Abstractions/Interfaces/IHyakClientFactory.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
using Hyak.Common;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
19+
#endif
1720

1821
namespace Microsoft.Azure.Commands.Common.Authentication
1922
{

src/Authentication.Abstractions/Interfaces/IProfileProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
#if NETSTANDARD
16+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
17+
#endif
18+
1519
namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
1620
{
1721
public interface IProfileProvider

src/Authentication.ResourceManager/AzureRmProfile.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
using System.Collections.Generic;
1818
using System.Linq;
1919
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
20+
#if NETSTANDARD
21+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
22+
#endif
2023
using Microsoft.Azure.Commands.ResourceManager.Common;
2124
using System.Xml.Serialization;
2225
using Microsoft.Azure.Commands.ResourceManager.Common.Serialization;

src/Authentication.ResourceManager/AzureRmProfileConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
using Microsoft.Azure.Commands.Common.Authentication;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Core;
19+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
20+
#endif
1721
using Microsoft.Azure.Commands.Common.Authentication.Models;
1822
using Microsoft.Azure.Commands.ResourceManager.Common.Serialization;
1923
using Newtonsoft.Json;

src/Authentication.ResourceManager/AzureRmServicePrincipalKeyStore.Netcore.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// ----------------------------------------------------------------------------------
1414
using Microsoft.Azure.Commands.Common.Authentication;
1515
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
16+
#if NETSTANDARD
17+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
18+
#endif
1619
using Microsoft.Azure.Commands.Common.Authentication.Models;
1720
using Microsoft.Azure.Commands.Common.Authentication.ResourceManager;
1821
using System;

src/Authentication.ResourceManager/ContextModelExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
1616
using System;
1717
using System.Linq;
18+
#if NETSTANDARD
19+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
20+
#endif
1821

1922
namespace Microsoft.Azure.Commands.Common.Authentication.ResourceManager
2023
{

src/Authentication.ResourceManager/Models/AzureContextConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
using System.Collections.Generic;
1717
using System.Management.Automation;
1818
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
19+
#if NETSTANDARD
20+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
21+
using Microsoft.Azure.Commands.Profile.Models.Core;
22+
#endif
1923
using System.Collections;
2024
using Microsoft.Azure.Commands.Profile.Common;
2125
using Microsoft.Azure.Commands.Common.Authentication.Models;

src/Authentication.ResourceManager/Models/PSAzureContext.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Common.Authentication;
16+
#if NETSTANDARD
17+
using Microsoft.Azure.Commands.Common.Authentication.Core;
18+
#endif
1619
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
1720
using Microsoft.Azure.Commands.Profile.Common;
1821
using System;
1922
using System.Collections.Generic;
2023
using System.Management.Automation;
2124
using Microsoft.WindowsAzure.Commands.Common.Attributes;
2225

26+
#if NETSTANDARD
27+
namespace Microsoft.Azure.Commands.Profile.Models.Core
28+
#else
2329
namespace Microsoft.Azure.Commands.Profile.Models
30+
#endif
2431
{
2532
/// <summary>
2633
/// The context for connecting cmdlets in the current session to Azure.
@@ -143,30 +150,30 @@ public PSAzureContext(PSObject other)
143150
/// <summary>
144151
/// The name of the context. The context may be selected by name
145152
/// </summary>
146-
[Ps1Xml(Label = "Context Name", Target = ViewControl.Table)]
153+
[Ps1Xml(Label = "Name", Target = ViewControl.Table, Position = 0)]
147154
public string Name { get; set; }
148155
/// <summary>
149156
/// The account used to connect to Azure.
150157
/// </summary>
151-
[Ps1Xml(Label = "Account id", Target = ViewControl.Table, ScriptBlock = "$_.Account.Id")]
158+
[Ps1Xml(Label = "Account", Target = ViewControl.Table, Position = 1)]
152159
public IAzureAccount Account { get; set; }
153160

154161
/// <summary>
155162
/// The endpoint and connection metadata for the targeted instance of the Azure cloud.
156163
/// </summary>
157-
[Ps1Xml(Label = "Environment Name", Target = ViewControl.Table, ScriptBlock = "$_.Environment.Name")]
164+
[Ps1Xml(Label = "Environment", Target = ViewControl.Table, Position = 3)]
158165
public IAzureEnvironment Environment { get; set; }
159166

160167
/// <summary>
161168
/// The subscription targeted in Azure.
162169
/// </summary>
163-
[Ps1Xml(Label = "Subscription Name", Target = ViewControl.Table, ScriptBlock = "$_.Subscription.Name")]
170+
[Ps1Xml(Label = "SubscriptionName", Target = ViewControl.Table, ScriptBlock = "$_.Subscription.Name", Position = 2)]
164171
public IAzureSubscription Subscription { get; set; }
165172

166173
/// <summary>
167174
/// The targeted tenant in Azure.
168175
/// </summary>
169-
[Ps1Xml(Label = "Tenant Id", Target = ViewControl.Table, ScriptBlock = "$_.Tenant.Id")]
176+
[Ps1Xml(Label = "TenantId", Target = ViewControl.Table, ScriptBlock = "$_.Tenant.ToString()", Position = 4)]
170177
public IAzureTenant Tenant { get; set; }
171178

172179
public IAzureTokenCache TokenCache { get; set; }

src/Authentication.ResourceManager/Models/PSAzureEnvironment.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
1616
using Microsoft.Azure.Commands.Profile.Common;
17+
using Microsoft.WindowsAzure.Commands.Common.Attributes;
1718
using System;
1819
using System.Collections.Generic;
1920
using System.Linq;
@@ -117,6 +118,7 @@ public PSAzureEnvironment(PSObject other)
117118
/// <summary>
118119
/// Gets or sets the name of the environment.
119120
/// </summary>
121+
[Ps1Xml(Label = "Name", Target = ViewControl.Table, Position = 0)]
120122
public string Name { get; set; }
121123

122124
/// <summary>
@@ -170,6 +172,7 @@ public bool OnPremise
170172
/// <summary>
171173
/// Gets or sets the Uri of the Azure Resource Manager (ARM) service.
172174
/// </summary>
175+
[Ps1Xml(Label = "Resource Manager Url", Target = ViewControl.Table, Position = 1)]
173176
public string ResourceManagerUrl { get; set; }
174177

175178
/// <summary>
@@ -185,6 +188,7 @@ public bool OnPremise
185188
/// <summary>
186189
/// Gets or sets the Uri of the Active Directory authentication endpoint.
187190
/// </summary>
191+
[Ps1Xml(Label = "ActiveDirectory Authority", Target = ViewControl.Table, Position = 2)]
188192
public string ActiveDirectoryAuthority { get; set; }
189193

190194
/// <summary>

src/Authentication.ResourceManager/Models/PSAzureProfile.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
using System.Collections.Generic;
1919
using Microsoft.WindowsAzure.Commands.Common.Attributes;
2020

21+
#if NETSTANDARD
22+
namespace Microsoft.Azure.Commands.Profile.Models.Core
23+
#else
2124
namespace Microsoft.Azure.Commands.Profile.Models
25+
#endif
2226
{
2327
/// <summary>
2428
/// Credential and environment data for connecting with an Azure instance in the current session.
@@ -80,10 +84,10 @@ public IDictionary<string, PSAzureEnvironment> Environments
8084
/// <summary>
8185
/// The current credentials and metadata for connecting with the current Azure cloud instance.
8286
/// </summary>
83-
[Ps1Xml(Label = "Account Name", Target = ViewControl.Table, ScriptBlock = "$_.Context.Account.Name")]
84-
[Ps1Xml(Label = "Subscription Name", Target = ViewControl.Table, ScriptBlock = "$_.Context.Subscription.Name")]
85-
[Ps1Xml(Label = "Tenant Id", Target = ViewControl.Table, ScriptBlock = "$_.Context.Tenant.Name")]
86-
[Ps1Xml(Label = "Environment Name", Target = ViewControl.Table, ScriptBlock = "$_.Context.Environment.Name")]
87+
[Ps1Xml(Label = "Account", Target = ViewControl.Table, ScriptBlock = "$_.Context.Account.ToString()", Position = 0)]
88+
[Ps1Xml(Label = "SubscriptionName", Target = ViewControl.Table, ScriptBlock = "$_.Context.Subscription.Name", Position = 1)]
89+
[Ps1Xml(Label = "TenantId", Target = ViewControl.Table, ScriptBlock = "$_.Context.Tenant.ToString()", Position = 2)]
90+
[Ps1Xml(Label = "Environment", Target = ViewControl.Table, ScriptBlock = "$_.Context.Environment.ToString()", Position = 3)]
8791
public PSAzureContext Context { get; set; }
8892

8993
public override string ToString()

src/Authentication.ResourceManager/Models/PSAzureSubscription.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public PSAzureSubscription(PSObject other)
8888
}
8989

9090
/// <inheritdoc />
91-
[Ps1Xml(Label = "Subscription Id", Target = ViewControl.Table)]
91+
[Ps1Xml(Label = "Id", Target = ViewControl.Table, Position = 1)]
9292
public string Id { get; set; }
9393

9494
/// <inheritdoc />
95-
[Ps1Xml(Label = "Subscription Name", Target = ViewControl.Table)]
95+
[Ps1Xml(Label = "Name", Target = ViewControl.Table, Position = 0)]
9696
public string Name { get; set; }
9797

9898
/// <inheritdoc />
99-
[Ps1Xml]
99+
[Ps1Xml(Label = "State", Target = ViewControl.Table, Position = 3)]
100100
public string State { get; set; }
101101

102102
/// <summary>
@@ -107,7 +107,7 @@ public PSAzureSubscription(PSObject other)
107107
/// <summary>
108108
/// The tenant home for the subscription.
109109
/// </summary>
110-
[Ps1Xml(Label = "Tenant Id", Target = ViewControl.Table)]
110+
[Ps1Xml(Label = "TenantId", Target = ViewControl.Table, Position = 2)]
111111
public string TenantId
112112
{
113113
get

src/Authentication.ResourceManager/Models/PSAzureTenant.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ public PSAzureTenant(PSObject other)
8888
/// <summary>
8989
/// The tenant id.
9090
/// </summary>
91-
[Ps1Xml(Label = "Tenant Id", Target = ViewControl.Table)]
91+
[Ps1Xml(Label = "Id", Target = ViewControl.Table, Position = 0)]
9292
public string Id { get; set; }
9393

9494
/// <summary>
9595
/// The name of the subscription.
9696
/// </summary>
97-
[Ps1Xml(Label = "Directory Name", Target = ViewControl.Table)]
97+
[Ps1Xml(Label = "Directory", Target = ViewControl.Table, Position = 1)]
9898
public string Directory { get; set; }
9999

100100
/// <summary>

src/Authentication.ResourceManager/ProtectedProfileProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
using Microsoft.Azure.Commands.Common.Authentication;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
19+
using Microsoft.Azure.Commands.Common.Authentication.Core;
20+
#endif
1721
using Microsoft.Azure.Commands.Common.Authentication.Models;
1822
using Microsoft.Azure.Commands.Common.Authentication.ResourceManager;
1923
using Microsoft.IdentityModel.Clients.ActiveDirectory;

src/Authentication.ResourceManager/ResourceManagerProfileProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
using Microsoft.Azure.Commands.Common.Authentication;
1616
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
17+
#if NETSTANDARD
18+
using Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core;
19+
using Microsoft.Azure.Commands.Common.Authentication.Core;
20+
#endif
1721
using Microsoft.Azure.Commands.Common.Authentication.Models;
1822
using Microsoft.Azure.Commands.Common.Authentication.ResourceManager;
1923
using Microsoft.IdentityModel.Clients.ActiveDirectory;

src/Authentication.Test/AzureSessionTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Commands.Common.Authentication;
16+
#if NETSTANDARD
17+
using Microsoft.Azure.Commands.Common.Authentication.Core;
18+
#endif
1619
using Microsoft.Azure.Commands.Common.Authentication.Factories;
1720
using Microsoft.Azure.Commands.Common.Authentication.Models;
1821
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;

src/Authentication.Test/Cmdlets/ConnectAccount.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ public class ConnectAccount : AzureRMCmdlet
5858
[Parameter(Mandatory = false)]
5959
public string Password { get; set; }
6060

61+
[Parameter(Mandatory = false)]
62+
public string ApplicationId { get; set; }
63+
64+
[Parameter(Mandatory = false)]
65+
public string CertificateThumbprint { get; set; }
66+
6167
protected override void BeginProcessing()
6268
{
6369
_profile = new AzureRmAutosaveProfile(
@@ -89,6 +95,16 @@ public override void ExecuteCmdlet()
8995
password = _credential.Password;
9096
}
9197

98+
if (!string.IsNullOrEmpty(ApplicationId))
99+
{
100+
Account.Id = ApplicationId;
101+
}
102+
103+
if (!string.IsNullOrEmpty(CertificateThumbprint))
104+
{
105+
Account.SetThumbprint(CertificateThumbprint);
106+
}
107+
92108
if (!string.IsNullOrEmpty(TenantId))
93109
{
94110
Account.SetProperty(AzureAccount.Property.Tenants, new[] { TenantId });

0 commit comments

Comments
 (0)