Skip to content

Commit

Permalink
Merge pull request Azure#36 from huangpf/crp2
Browse files Browse the repository at this point in the history
Crp2
  • Loading branch information
AzureRT committed Apr 9, 2015
2 parents 686259b + 69aa493 commit a26d47f
Show file tree
Hide file tree
Showing 142 changed files with 1,384 additions and 698 deletions.
2 changes: 1 addition & 1 deletion setup/azurecmd.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>

<?define version="0.8.16" ?>
<?define version="0.8.16.1" ?>
<?define versionedStartMenuFolder="Microsoft Azure" ?>
<?define staleStartMenuFolder="Windows Azure" ?>

Expand Down
740 changes: 716 additions & 24 deletions setup/azurecmdfiles.wxi

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/.nuget/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<activePackageSource>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="internal share" value="\\aaptfile01\adxsdk\nuget\binaries\packages" />
</activePackageSource>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication">
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.18-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.22-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand All @@ -77,12 +77,13 @@
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.14.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/Common/Commands.Common.Storage/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.18-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.22-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand All @@ -11,7 +11,7 @@
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.14.201151115" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
Expand Down
15 changes: 7 additions & 8 deletions src/Common/Commands.Common.Test/Commands.Common.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@
<Reference Include="Microsoft.Azure.Common">
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.18-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Reference Include="Microsoft.Azure.Common.Authentication">
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.22-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
Expand All @@ -69,7 +68,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5562.19686-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5571.32271-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>
Expand All @@ -80,13 +79,13 @@
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/Common/Commands.Common.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.18-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.0.22-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5562.19686-prerelease" targetFramework="net45" />
Expand All @@ -12,7 +12,7 @@
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.12.111071459" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.14.201151115" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
Expand Down
38 changes: 20 additions & 18 deletions src/Common/Commands.Common/AzurePSCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Collections.Concurrent;
using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
Expand All @@ -26,7 +27,9 @@ namespace Microsoft.WindowsAzure.Commands.Utilities.Common
{
public abstract class AzurePSCmdlet : PSCmdlet
{
private readonly RecordingTracingInterceptor _httpTracingInterceptor = new RecordingTracingInterceptor();
private readonly ConcurrentQueue<string> _debugMessages = new ConcurrentQueue<string>();
private RecordingTracingInterceptor _httpTracingInterceptor;
private DebugStreamTraceListener _adalListener;
protected static AzureProfile _currentProfile = null;

[Parameter(Mandatory = false, HelpMessage = "In-memory profile.")]
Expand Down Expand Up @@ -79,7 +82,7 @@ static AzurePSCmdlet()
/// <summary>
/// Create the default profile, based on the default profile path
/// </summary>
/// <returns>The default prpofile, serialized from the default location on disk</returns>
/// <returns>The default profile, serialized from the default location on disk</returns>
protected static AzureProfile InitializeDefaultProfile()
{
if (!string.IsNullOrEmpty(AzureSession.ProfileDirectory) && !string.IsNullOrEmpty(AzureSession.ProfileFile))
Expand Down Expand Up @@ -164,7 +167,10 @@ protected override void BeginProcessing()
WriteDebugWithTimestamp(string.Format("using account id '{0}'...", Profile.Context.Account.Id));
}

_httpTracingInterceptor = _httpTracingInterceptor?? new RecordingTracingInterceptor(_debugMessages);
_adalListener = _adalListener?? new DebugStreamTraceListener(_debugMessages);
RecordingTracingInterceptor.AddToContext(_httpTracingInterceptor);
DebugStreamTraceListener.AddAdalTracing(_adalListener);

base.BeginProcessing();
}
Expand All @@ -191,16 +197,12 @@ protected override void EndProcessing()
WriteDebugWithTimestamp(message);

RecordingTracingInterceptor.RemoveFromContext(_httpTracingInterceptor);
FlushMessagesFromTracingInterceptor();
DebugStreamTraceListener.RemoveAdalTracing(_adalListener);
FlushDebugMessages();

base.EndProcessing();
}

/*public AzureContext Profile.Context
{
get { return Profile.Context; }
}*/

public bool HasCurrentSubscription
{
get { return Profile.Context.Subscription != null; }
Expand All @@ -223,49 +225,49 @@ protected bool IsVerbose()

public new void WriteError(ErrorRecord errorRecord)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteError(errorRecord);
}

public new void WriteObject(object sendToPipeline)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteObject(sendToPipeline);
}

public new void WriteObject(object sendToPipeline, bool enumerateCollection)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteObject(sendToPipeline, enumerateCollection);
}

public new void WriteVerbose(string text)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteVerbose(text);
}

public new void WriteWarning(string text)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteWarning(text);
}

public new void WriteCommandDetail(string text)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteCommandDetail(text);
}

public new void WriteProgress(ProgressRecord progressRecord)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteProgress(progressRecord);
}

public new void WriteDebug(string text)
{
FlushMessagesFromTracingInterceptor();
FlushDebugMessages();
base.WriteDebug(text);
}

Expand Down Expand Up @@ -342,10 +344,10 @@ protected override void ProcessRecord()
}
}

private void FlushMessagesFromTracingInterceptor()
private void FlushDebugMessages()
{
string message;
while (_httpTracingInterceptor.MessageQueue.TryDequeue(out message))
while (_debugMessages.TryDequeue(out message))
{
base.WriteDebug(message);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Common/Commands.Common/AzurePowerShell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public class AzurePowerShell

public const string AssemblyCopyright = "Copyright © Microsoft";

public const string AssemblyVersion = "0.8.16";
public const string AssemblyVersion = "0.8.16.1";

public const string AssemblyFileVersion = "0.8.16";
public const string AssemblyFileVersion = "0.8.16.1";

public const string ProfileFile = "AzureProfile.json";

Expand Down
15 changes: 8 additions & 7 deletions src/Common/Commands.Common/Commands.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.Azure.Common">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication">
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.18-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.0.22-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.Azure.Common.NetFramework">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
Expand All @@ -81,11 +81,11 @@
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.12.111071459\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
<HintPath>..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.14.201151115\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -145,6 +145,7 @@
<Compile Include="AzurePowerShell.cs" />
<Compile Include="Constants.cs" />
<Compile Include="ConversionUtilities.cs" />
<Compile Include="DebugStreamTraceListener.cs" />
<Compile Include="GeneralUtilities.cs" />
<Compile Include="Models\PSTagValuePair.cs" />
<Compile Include="PowerShellUtilities.cs" />
Expand Down
Loading

0 comments on commit a26d47f

Please sign in to comment.