Skip to content

Commit

Permalink
Merge pull request #1 from Azure/dev
Browse files Browse the repository at this point in the history
Pull latest upstream changes.
  • Loading branch information
adarce committed May 16, 2016
2 parents d83c3bb + d961066 commit 1baa5f9
Show file tree
Hide file tree
Showing 2,549 changed files with 50,589 additions and 23,296 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This repository contains a set of PowerShell cmdlets for developers and administ

For detail descriptions and examples of the cmdlets, type
* ```help azure``` to get all the cmdlets.
* ```help azurerm``` to get all the Azure Resource Manaber (ARM) cmdlets.
* ```help azurerm``` to get all the Azure Resource Manager (ARM) cmdlets.
* ```help <cmdlet name>``` to get the details of a specific cmdlet.

## Supported Environments
Expand All @@ -72,9 +72,9 @@ For detail descriptions and examples of the cmdlets, type
You can also find the standalone installers for all the versions at [Downloads](https://github.com/Azure/azure-powershell/releases)

### PowerShell Gallery
1. Install [Windows Management Framework 5 ot PowerShellGet cmdlets](https://www.powershellgallery.com/GettingStarted?section=Get%20Started)
1. Install [Windows Management Framework 5 with PowerShellGet cmdlets](https://www.powershellgallery.com/GettingStarted?section=Get%20Started)
2. In an elevated PowerShell session, run ```Install-Module AzureRM```
3. run ```Install-AzureRm```
3. Run ```Install-AzureRm```
4. Top install RDFE cmdlets, run ```Install-Module Azure```

### Source Code
Expand Down
110 changes: 110 additions & 0 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -2286,6 +2286,89 @@
<File Id="filBE0227C54B508F10C09F536EDD6BC540" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.Resources\System.Net.Http.Primitives.dll" />
</Component>
</Directory>
<Directory Id="dir14F62797AD72DE375C926D693DEB479C" Name="AzureRM.ServerManagement">
<Component Id="cmpF725005539C2C4CFDDDC204E3674DEAD" Guid="*">
<File Id="fil73381F22B6A918831220BB05A929BDF3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\AzureRM.ServerManagement.psd1" />
</Component>
<Component Id="cmpEDC95F54977C13A99FA427539106CE35" Guid="*">
<File Id="fil645B0C3C416CEF7E45264B5FA4518812" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\AzureRM.Tags.psd1" />
</Component>
<Component Id="cmpFB7F0A3E01F1374D24620B3886953A33" Guid="*">
<File Id="fil01A2FDC1821E718DD4CD652EC5F5B053" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Hyak.Common.dll" />
</Component>
<Component Id="cmp592197EFD5C708253467ABD403F4A5DB" Guid="*">
<File Id="fil2089864CA50D503B148C6E88106094D6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.ApplicationInsights.dll" />
</Component>
<Component Id="cmp817A8367CB097F66685088F17C76578F" Guid="*">
<File Id="fil160F9CC9E9429A0FED0E9B7B24F24202" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.Common.Authentication.dll" />
</Component>
<Component Id="cmp641A55172552752A0A19DDA524157054" Guid="*">
<File Id="filE2FCE5F3FB749C8925E10706B3AEFD74" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.ResourceManager.Common.dll" />
</Component>
<Component Id="cmp8EC8B3EAD2057B30B326C05F9D9C376D" Guid="*">
<File Id="filC46746B9CF56A68FB86F605FA6AA3918" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.ServerManagement.dll" />
</Component>
<Component Id="cmpDEC10E607D922A8AE8F14D4D43FD1AF5" Guid="*">
<File Id="fil5C2D6A3508ECBF9DFF05BEB19EA44A99" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.ServerManagement.dll-Help.xml" />
</Component>
<Component Id="cmpA09E0591EFE7AF2F3C3F3503D78A1751" Guid="*">
<File Id="fil3F9AA2E11CC130F0A5D12847711D3FBD" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.ServerManagement.Format.ps1xml" />
</Component>
<Component Id="cmp17C8392DAD4019C4F95CA7C6E1CE0860" Guid="*">
<File Id="fil6B62BEB317188AB3AAAB912F6AB6F0E2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.Tags.dll" />
</Component>
<Component Id="cmpDA509BC0DD6F873D0B77B3CF4010F78C" Guid="*">
<File Id="fil497A8EA6B9E4C588AFD7E02DFF72FC57" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.Tags.dll-help.xml" />
</Component>
<Component Id="cmpE759C3E5C6722343927630513B99819A" Guid="*">
<File Id="fil583F3F61A481C820F3B63EAC766DADBF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Commands.Tags.format.ps1xml" />
</Component>
<Component Id="cmp57ED324D8FA865BB9A2DE9C8EB9889BA" Guid="*">
<File Id="fil4446A57D4674DBA57620E2881D617424" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Common.dll" />
</Component>
<Component Id="cmp32DDA2B33740B316C60A5318E6C94F05" Guid="*">
<File Id="fil49DEA4867C8D8C39946C0127A5A53E25" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Common.NetFramework.dll" />
</Component>
<Component Id="cmpF7CF2EDADDB3C6A4D24A2D73463F60D8" Guid="*">
<File Id="filB195AB3151250DC5125D4A139BBE795E" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.Management.ServerManagement.dll" />
</Component>
<Component Id="cmpE228D1DBB5AAB5C0C37552258721AC65" Guid="*">
<File Id="fil36C816C1986E3A1950FC2E805D5A86BD" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Azure.ResourceManager.dll" />
</Component>
<Component Id="cmp1C4B26683FFB0DBE7A08A3D45F1BDA99" Guid="*">
<File Id="filD9436F7E5E9714450E065E6A83E64678" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" />
</Component>
<Component Id="cmp02DD1EC816057E30612FD7DC15076387" Guid="*">
<File Id="filDC6C45C67A40D5BAE078D9B2C2A410A4" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll" />
</Component>
<Component Id="cmpD8BA9CABA7640D80C031E84CB655F0D3" Guid="*">
<File Id="fil4DAA80C2670DE99AF70E4C14DCB85C59" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Rest.ClientRuntime.Azure.dll" />
</Component>
<Component Id="cmp95413CC345F9BD796303ED5D77E057E3" Guid="*">
<File Id="fil5F60969C30A10B1F58610438579A2FE2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Rest.ClientRuntime.dll" />
</Component>
<Component Id="cmp1ADE806D06163DB828DC8D1A514DF3B9" Guid="*">
<File Id="fil26D0E9B5EC76183152ADF0EFE26D42BF" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Threading.Tasks.dll" />
</Component>
<Component Id="cmpBB1E1E0FFD2110DD0C406E56705A577D" Guid="*">
<File Id="fil8CB6E327EB10A83AA3C02D0445D374F5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Threading.Tasks.Extensions.Desktop.dll" />
</Component>
<Component Id="cmpC15C00B5D79892B6637B3136279C9145" Guid="*">
<File Id="fil013D0AEDCD6FE1A45E6D2EDE1EE3D90D" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.Threading.Tasks.Extensions.dll" />
</Component>
<Component Id="cmp5301D89C061F426377FC442040837761" Guid="*">
<File Id="filADA99CFEF4A777F77297B287244DB1FA" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Microsoft.WindowsAzure.Commands.Common.dll" />
</Component>
<Component Id="cmpC71298F3ADA1AEBD92C8E49A3E9FBCDE" Guid="*">
<File Id="fil748975CDEE7144B1BF98C239A41EDAC3" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\Newtonsoft.Json.dll" />
</Component>
<Component Id="cmpCB722985905F7FDE06F3BFBA79C3B296" Guid="*">
<File Id="fil3B5CADA4D90E21CF8865A1D8C99A22E5" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\System.Net.Http.Extensions.dll" />
</Component>
<Component Id="cmpEDFCEE40FFADD7B2D89FE968BF011310" Guid="*">
<File Id="fil1BA7DDCC9E306E41944084A1D4327887" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.ServerManagement\System.Net.Http.Primitives.dll" />
</Component>
</Directory>
<Directory Id="dirC63F4F2C0F6AE7B19B68616D946C4B21" Name="AzureRM.SiteRecovery">
<Component Id="cmpF9C7E5E1065CAC726499F6E0E92B2FBF" Guid="*">
<File Id="fil81232881981F6C69DCFBF96303CB1365" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\AzureRM.SiteRecovery\AzureRM.RecoveryServices.psd1" />
Expand Down Expand Up @@ -5804,6 +5887,33 @@
<ComponentRef Id="cmp3BB1527FA803EB75EB5EC78C281B3212" />
<ComponentRef Id="cmpA534986DA2E43D7E50E9A6E219478266" />
<ComponentRef Id="cmp6D34FB8F9A9678D4511D4BB8E0800104" />
<ComponentRef Id="cmpF725005539C2C4CFDDDC204E3674DEAD" />
<ComponentRef Id="cmpEDC95F54977C13A99FA427539106CE35" />
<ComponentRef Id="cmpFB7F0A3E01F1374D24620B3886953A33" />
<ComponentRef Id="cmp592197EFD5C708253467ABD403F4A5DB" />
<ComponentRef Id="cmp817A8367CB097F66685088F17C76578F" />
<ComponentRef Id="cmp641A55172552752A0A19DDA524157054" />
<ComponentRef Id="cmp8EC8B3EAD2057B30B326C05F9D9C376D" />
<ComponentRef Id="cmpDEC10E607D922A8AE8F14D4D43FD1AF5" />
<ComponentRef Id="cmpA09E0591EFE7AF2F3C3F3503D78A1751" />
<ComponentRef Id="cmp17C8392DAD4019C4F95CA7C6E1CE0860" />
<ComponentRef Id="cmpDA509BC0DD6F873D0B77B3CF4010F78C" />
<ComponentRef Id="cmpE759C3E5C6722343927630513B99819A" />
<ComponentRef Id="cmp57ED324D8FA865BB9A2DE9C8EB9889BA" />
<ComponentRef Id="cmp32DDA2B33740B316C60A5318E6C94F05" />
<ComponentRef Id="cmpF7CF2EDADDB3C6A4D24A2D73463F60D8" />
<ComponentRef Id="cmpE228D1DBB5AAB5C0C37552258721AC65" />
<ComponentRef Id="cmp1C4B26683FFB0DBE7A08A3D45F1BDA99" />
<ComponentRef Id="cmp02DD1EC816057E30612FD7DC15076387" />
<ComponentRef Id="cmpD8BA9CABA7640D80C031E84CB655F0D3" />
<ComponentRef Id="cmp95413CC345F9BD796303ED5D77E057E3" />
<ComponentRef Id="cmp1ADE806D06163DB828DC8D1A514DF3B9" />
<ComponentRef Id="cmpBB1E1E0FFD2110DD0C406E56705A577D" />
<ComponentRef Id="cmpC15C00B5D79892B6637B3136279C9145" />
<ComponentRef Id="cmp5301D89C061F426377FC442040837761" />
<ComponentRef Id="cmpC71298F3ADA1AEBD92C8E49A3E9FBCDE" />
<ComponentRef Id="cmpCB722985905F7FDE06F3BFBA79C3B296" />
<ComponentRef Id="cmpEDFCEE40FFADD7B2D89FE968BF011310" />
<ComponentRef Id="cmpF9C7E5E1065CAC726499F6E0E92B2FBF" />
<ComponentRef Id="cmpE1FBC775E0C4E8ECA1EB6C0F338FEDFA" />
<ComponentRef Id="cmp02DCD4998B3C2CF365F95C5A38848DB3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ public AccessTokenCredential(Guid subscriptionId, IAccessToken token)
this.token = token;
this.TenantID = token.TenantId;
}

public override Task ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
token.AuthorizeRequest((tokenType, tokenValue) => {
token.AuthorizeRequest((tokenType, tokenValue) =>
{
request.Headers.Authorization = new AuthenticationHeaderValue(tokenType, tokenValue);
});
return base.ProcessHttpRequestAsync(request, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AdalConfiguration
// These constants define the default values to use for AD authentication
// against RDFE
//
public const string PowerShellClientId = "1950a258-227b-4e31-a9cf-717495945fc2";
public const string PowerShellClientId = "1950a258-227b-4e31-a9cf-717495945fc2";

public static readonly Uri PowerShellRedirectUri = new Uri("urn:ietf:wg:oauth:2.0:oob");

Expand All @@ -37,7 +37,7 @@ public class AdalConfiguration
// login window. Also adding popup flag to handle overly large login windows.
public const string EnableEbdMagicCookie = "site_id=501358&display=popup";

public string AdEndpoint { get;set; }
public string AdEndpoint { get; set; }

public bool ValidateAuthority { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ public AdalTokenProvider()
public AdalTokenProvider(IWin32Window parentWindow)
{
this.userTokenProvider = new UserTokenProvider(parentWindow);
servicePrincipalTokenProvider = new ServicePrincipalTokenProvider();
this.servicePrincipalTokenProvider = new ServicePrincipalTokenProvider();
}

public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId, SecureString password,
public IAccessToken GetAccessToken(
AdalConfiguration config,
ShowDialog promptBehavior,
string userId,
SecureString password,
AzureAccount.AccountType credentialType)
{
switch (credentialType)
Expand All @@ -54,7 +58,11 @@ public IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBe
}
}

public IAccessToken GetAccessTokenWithCertificate(AdalConfiguration config, string clientId, string certificate, AzureAccount.AccountType credentialType)
public IAccessToken GetAccessTokenWithCertificate(
AdalConfiguration config,
string clientId,
string certificate,
AzureAccount.AccountType credentialType)
{
switch (credentialType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Rest.Azure.Authentication;
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;

Expand All @@ -35,7 +34,7 @@ public CertificateApplicationCredentialProvider(string certificateThumbprint)
{
this._certificateThumbprint = certificateThumbprint;
}

/// <summary>
/// Authenticate using certificate thumbprint from the datastore
/// </summary>
Expand All @@ -47,7 +46,7 @@ public async Task<AuthenticationResult> AuthenticateAsync(string clientId, strin
{
var task = new Task<X509Certificate2>(() =>
{
return AzureSession.DataStore.GetCertificate(this._certificateThumbprint);
return AzureSession.DataStore.GetCertificate(this._certificateThumbprint);
});
task.Start();
var certificate = await task.ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static class CredStore
internal enum CredentialType
{
Generic = 1,
}
}

internal static class NativeMethods
{
Expand Down Expand Up @@ -69,7 +69,10 @@ internal extern static bool CredFree(
IntPtr pCredential
);

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable", Justification = "Wrapper for native struct")]
[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
"CA1049:TypesThatOwnNativeResourcesShouldBeDisposable",
Justification = "Wrapper for native struct")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal struct Credential
{
Expand Down Expand Up @@ -108,7 +111,7 @@ public Credential(string userName, string key, string value)
internal IntPtr attributes;
internal string targetAlias;
internal string userName;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface IAccessToken
string UserId { get; }

string TenantId { get; }

LoginType LoginType { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ public interface ITokenProvider
/// <param name="password">Secure strings with password/service principal key.</param>
/// <param name="credentialType">Credential type.</param>
/// <returns>An access token.</returns>
IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, string userId,
SecureString password, AzureAccount.AccountType credentialType);
IAccessToken GetAccessToken(
AdalConfiguration config,
ShowDialog promptBehavior,
string userId,
SecureString password,
AzureAccount.AccountType credentialType);

/// <summary>
/// Get a new authentication token for the given environment
Expand All @@ -44,7 +48,10 @@ IAccessToken GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior,
/// <param name="certificateThumbprint">The certificate thumbprint for this user</param>
/// <param name="credentialType">The account type</param>
/// <returns>An access token, which can be renewed</returns>
IAccessToken GetAccessTokenWithCertificate(AdalConfiguration config, string principalId, string certificateThumbprint,
IAccessToken GetAccessTokenWithCertificate(
AdalConfiguration config,
string principalId,
string certificateThumbprint,
AzureAccount.AccountType credentialType);
}
}
Loading

0 comments on commit 1baa5f9

Please sign in to comment.