Skip to content

Commit 30b4505

Browse files
committed
Merge pull request Azure#77 from markcowl/release-0.8.13
Release 0.8.13
2 parents f9b1964 + 676e167 commit 30b4505

File tree

503 files changed

+21692
-1189
lines changed

Some content is hidden

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

503 files changed

+21692
-1189
lines changed

AzurePowershell.Test.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<SqlDatabaseTestDebug>.\src\ServiceManagement\Sql\Commands.SqlDatabase.Test\bin\Debug\Microsoft.WindowsAzure.Commands.SqlDatabase.Test.dll</SqlDatabaseTestDebug>
2222
<HDInsightTestDebug>.\src\ServiceManagement\HDInsight\Commands.HDInsight.Test\bin\Debug\Microsoft.WindowsAzure.Commands.HDInsight.Test.dll</HDInsightTestDebug>
2323
<StorageTestDebug>.\src\ServiceManagement\Storage\Commands.Storage.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Storage.Test.dll</StorageTestDebug>
24+
<KeyVaultTestDebug>.\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll</KeyVaultTestDebug>
2425
<TestFilter>"!Functional&#x26;!Scenario&#x26;!AzureRTScenario&#x26;!Sequential&#x26;!PIRTest&#x26;!Preview&#x26;!ADDomain"</TestFilter>
2526
<ScenarioTestFilter>All</ScenarioTestFilter>
2627
<OneSDKCITFilter>"OneSDK&#x26;CIT"</OneSDKCITFilter>
@@ -137,6 +138,13 @@
137138
<Xunit.Runner.MSBuild.xunit Assemblies="$(SqlTestDebug)" Html="$(TestOutputDirectory)\SqlTests.xunit.dll.html" Verbose="false"
138139
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
139140
</Target>
141+
142+
<!-- Run the KeyVault tests -->
143+
<Target Name="KeyVaultTests">
144+
<Message Importance="high" Text="Running KeyVault tests" />
145+
<Xunit.Runner.MSBuild.xunit Assemblies="$(KeyVaultTestDebug)" Html="$(TestOutputDirectory)\KeyVaultTests.xunit.dll.html" Verbose="true"
146+
ExcludeTraits="$(XUnitExcludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false"/>
147+
</Target>
140148

141149
<!-- Run the scenario tests with Mocks -->
142150
<Target Name="MockedScenarioTests">

ChangeLog.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2015.01.08 version 0.8.13
2+
* Key Vault Service - new cmdlets in AzureResourceManager mode:
3+
* Keys:
4+
* Add-AzureKeyVaultKey
5+
* Get-AzureKeyVaultKey
6+
* Set-AzureKeyVaultKey
7+
* Backup-AzureKeyVaultKey
8+
* Restore-AzureKeyVaultKey
9+
* Remove-AzureKeyVaultKey
10+
* Secrets:
11+
* Get-AzureKeyVaultSecret
12+
* Set-AzureKeyVaultSecret
13+
* Remove-AzureKeyVaultSecret
14+
115
2014.12.12 version 0.8.12
216
* StreamAnalytics
317
* New cmdlets in AzureResourceManager mode

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
<!-- Run checkin tests for each pull request -->
196196
<Target Name="Test" DependsOnTargets="BuildDebug;BeforeRunTests">
197197
<Message Importance="high" Text="Running check in tests..." />
198-
<CallTarget Targets="SqlTests; CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests; TestDSCExtension_x64; TestBatch; TestDataFactoryManager; TestRecoveryServices; TestStreamAnalyticsManager"/>
198+
<CallTarget Targets="KeyVaultTests; SqlTests; CommonTests; TestManagement; TestHDInsight; TestManagedCache; TestServiceManagement; TestServiceManagementExtensions; TestSqlDatabase; TestStorage; TestResourceManager; MockedScenarioTests; TestDSCExtension_x64; TestBatch; TestDataFactoryManager; TestRecoveryServices; TestStreamAnalyticsManager"/>
199199
</Target>
200200

201201
<!-- Run Full switch with scenario tests -->

setup/azurecmd.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33

4-
<?define productName="Microsoft Azure PowerShell - December 2014" ?>
4+
<?define productName="Microsoft Azure PowerShell - January 2015" ?>
55
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
66
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
77

8-
<?define version="0.8.12" ?>
8+
<?define version="0.8.13" ?>
99
<?define versionedStartMenuFolder="Microsoft Azure" ?>
1010
<?define staleStartMenuFolder="Windows Azure" ?>
1111

setup/azurecmdfiles.wxi

Lines changed: 254 additions & 4 deletions
Large diffs are not rendered by default.

src/AzurePowershell.sln

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network", "Service
143143
EndProject
144144
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network.Test", "ServiceManagement\Network\Commands.Network.Test\Commands.Network.Test.csproj", "{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}"
145145
EndProject
146+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.KeyVault", "ResourceManager\KeyVault\Commands.KeyVault\Commands.KeyVault.csproj", "{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}"
147+
EndProject
148+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.KeyVault.Test", "ResourceManager\KeyVault\Commands.KeyVault.Test\Commands.KeyVault.Test.csproj", "{080B0477-7E52-4455-90AB-23BD13D1B1CE}"
149+
EndProject
146150
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices", "ServiceManagement\RecoveryServices\Commands.RecoveryServices\Commands.RecoveryServices.csproj", "{98B10548-DF97-4FB1-8D82-2A12945D4F21}"
147151
EndProject
148152
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices.Test", "ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\Commands.RecoveryServices.Test.csproj", "{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}"
@@ -151,6 +155,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StreamAnalytics",
151155
EndProject
152156
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.StreamAnalytics.Test", "ResourceManager\StreamAnalytics\Commands.StreamAnalytics.Test\Commands.StreamAnalytics.Test.csproj", "{7E6683BE-ECFF-4709-89EB-1325E9E70512}"
153157
EndProject
158+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Extensions", "Common\Azure.Common.Extensions\Common.Extensions.csproj", "{B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}"
159+
EndProject
154160
Global
155161
GlobalSection(SolutionConfigurationPlatforms) = preSolution
156162
Debug|Any CPU = Debug|Any CPU
@@ -345,6 +351,10 @@ Global
345351
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Debug|Any CPU.Build.0 = Debug|Any CPU
346352
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.ActiveCfg = Release|Any CPU
347353
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.Build.0 = Release|Any CPU
354+
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
355+
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.Build.0 = Debug|Any CPU
356+
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.ActiveCfg = Release|Any CPU
357+
{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.Build.0 = Release|Any CPU
348358
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
349359
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.Build.0 = Debug|Any CPU
350360
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -353,6 +363,10 @@ Global
353363
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
354364
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
355365
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.Build.0 = Release|Any CPU
366+
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
367+
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
368+
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
369+
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.Build.0 = Release|Any CPU
356370
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
357371
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.Build.0 = Debug|Any CPU
358372
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -361,6 +375,10 @@ Global
361375
{7E6683BE-ECFF-4709-89EB-1325E9E70512}.Debug|Any CPU.Build.0 = Debug|Any CPU
362376
{7E6683BE-ECFF-4709-89EB-1325E9E70512}.Release|Any CPU.ActiveCfg = Release|Any CPU
363377
{7E6683BE-ECFF-4709-89EB-1325E9E70512}.Release|Any CPU.Build.0 = Release|Any CPU
378+
{B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
379+
{B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Debug|Any CPU.Build.0 = Debug|Any CPU
380+
{B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Release|Any CPU.ActiveCfg = Release|Any CPU
381+
{B95C489C-8CB7-4DCF-8D5F-B9AEBDBBAF89}.Release|Any CPU.Build.0 = Release|Any CPU
364382
EndGlobalSection
365383
GlobalSection(SolutionProperties) = preSolution
366384
HideSolutionNode = FALSE
@@ -390,6 +408,7 @@ Global
390408
{F4ABAD68-64A5-4B23-B09C-42559A7524DE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
391409
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
392410
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
411+
{080B0477-7E52-4455-90AB-23BD13D1B1CE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
393412
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
394413
EndGlobalSection
395414
EndGlobal

src/Common/Commands.Common/Authentication/AadAuthenticationException.cs renamed to src/Common/Azure.Common.Extensions/Authentication/AadAuthenticationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using System;
1616

17-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
17+
namespace Microsoft.Azure.Common.Extensions.Authentication
1818
{
1919
/// <summary>
2020
/// Base class representing an exception that occurs when

src/Common/Commands.Common/Authentication/AccessTokenCredential.cs renamed to src/Common/Azure.Common.Extensions/Authentication/AccessTokenCredential.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.WindowsAzure;
1516
using System;
1617
using System.Net.Http;
1718
using System.Net.Http.Headers;
1819
using System.Threading;
1920
using System.Threading.Tasks;
2021

21-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
22+
namespace Microsoft.Azure.Common.Extensions.Authentication
2223
{
2324
public class AccessTokenCredential : SubscriptionCloudCredentials
2425
{

src/Common/Commands.Common/Authentication/AdalConfiguration.cs renamed to src/Common/Azure.Common.Extensions/Authentication/AdalConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using System;
1616
using System.Linq;
1717

18-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
18+
namespace Microsoft.Azure.Common.Extensions.Authentication
1919
{
2020
/// <summary>
2121
/// Class storing the configuration information needed

src/Common/Commands.Common/Authentication/AdalTokenProvider.cs renamed to src/Common/Azure.Common.Extensions/Authentication/AdalTokenProvider.cs

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

15+
using Microsoft.Azure.Common.Extensions.Models;
16+
using Microsoft.Azure.Common.Extensions.Properties;
1517
using System;
1618
using System.Security;
1719
using System.Windows.Forms;
18-
using Microsoft.WindowsAzure.Commands.Common.Models;
19-
using Microsoft.WindowsAzure.Commands.Common.Properties;
2020

21-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
21+
namespace Microsoft.Azure.Common.Extensions.Authentication
2222
{
2323
/// <summary>
2424
/// A token provider that uses ADAL to retrieve

src/Common/Commands.Common/Authentication/ConsoleParentWindow.cs renamed to src/Common/Azure.Common.Extensions/Authentication/ConsoleParentWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.Runtime.InteropServices;
1717
using System.Windows.Forms;
1818

19-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
19+
namespace Microsoft.Azure.Common.Extensions.Authentication
2020
{
2121
/// <summary>
2222
/// An implementation of <see cref="IWin32Window"/> that gives the

src/Common/Commands.Common/Authentication/CredStore.cs renamed to src/Common/Azure.Common.Extensions/Authentication/CredStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using System.Runtime.ConstrainedExecution;
1717
using System.Runtime.InteropServices;
1818

19-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
19+
namespace Microsoft.Azure.Common.Extensions.Authentication
2020
{
2121
/// <summary>
2222
/// Class wrapping PInvoke signatures for Windows Credential store

src/Common/Commands.Common/Authentication/IAccessToken.cs renamed to src/Common/Azure.Common.Extensions/Authentication/IAccessToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using System;
1616

17-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
17+
namespace Microsoft.Azure.Common.Extensions.Authentication
1818
{
1919
public interface IAccessToken
2020
{

src/Common/Commands.Common/Authentication/ITokenProvider.cs renamed to src/Common/Azure.Common.Extensions/Authentication/ITokenProvider.cs

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

15+
using Microsoft.Azure.Common.Extensions.Models;
1516
using System.Security;
16-
using Microsoft.WindowsAzure.Commands.Common.Models;
1717

18-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
18+
namespace Microsoft.Azure.Common.Extensions.Authentication
1919
{
2020
/// <summary>
2121
/// This interface represents objects that can be used

src/Common/Commands.Common/Authentication/LoginType.cs renamed to src/Common/Azure.Common.Extensions/Authentication/LoginType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
15+
namespace Microsoft.Azure.Common.Extensions.Authentication
1616
{
1717
public enum LoginType
1818
{

src/Common/Commands.Common/Authentication/ProtectedFileTokenCache.cs renamed to src/Common/Azure.Common.Extensions/Authentication/ProtectedFileTokenCache.cs

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

15+
using Microsoft.IdentityModel.Clients.ActiveDirectory;
1516
using System;
1617
using System.IO;
1718
using System.Security.Cryptography;
18-
using Microsoft.IdentityModel.Clients.ActiveDirectory;
19-
using Microsoft.WindowsAzure.Commands.Common;
2019

21-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
20+
namespace Microsoft.Azure.Common.Extensions.Authentication
2221
{
2322
/// <summary>
2423
/// An implementation of the Adal token cache that stores the cache items
2524
/// in the DPAPI-protected file.
2625
/// </summary>
2726
public class ProtectedFileTokenCache : TokenCache
2827
{
29-
private static readonly string CacheFileName = Path.Combine(AzurePowerShell.ProfileDirectory, "TokenCache.dat");
28+
private static readonly string CacheFileName = Path.Combine(AzureSession.ProfileDirectory, AzureSession.TokenCacheFile);
3029

3130
private static readonly object fileLock = new object();
3231

src/Common/Commands.Common/Authentication/ServicePrincipalKeyStore.cs renamed to src/Common/Azure.Common.Extensions/Authentication/ServicePrincipalKeyStore.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
using System;
1616
using System.Runtime.InteropServices;
1717
using System.Security;
18-
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
1918
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
2019

21-
namespace Microsoft.WindowsAzure.Commands.Common.Authentication
20+
namespace Microsoft.Azure.Common.Extensions.Authentication
2221
{
2322
/// <summary>
2423
/// Helper class to store service principal keys and retrieve them
@@ -27,7 +26,7 @@ namespace Microsoft.WindowsAzure.Commands.Common.Authentication
2726
public static class ServicePrincipalKeyStore
2827
{
2928
private const string keyStoreUserName = "PowerShellServicePrincipalKey";
30-
private const string targetNamePrefix = "AzurePowershell:target=";
29+
private const string targetNamePrefix = "AzureSession:target=";
3130

3231
public static void SaveKey(string appId, string tenantId, SecureString serviceKey)
3332
{

src/Common/Commands.Common/Authentication/ServicePrincipalTokenProvider.cs renamed to src/Common/Azure.Common.Extensions/Authentication/ServicePrincipalTokenProvider.cs

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

15+
using Microsoft.Azure.Common.Extensions.Models;
16+
using Microsoft.Azure.Common.Extensions.Properties;
17+
using Microsoft.IdentityModel.Clients.ActiveDirectory;
1518
using System;
1619
using System.Collections.Generic;
1720
using System.Security;
18-
using Microsoft.IdentityModel.Clients.ActiveDirectory;
19-
using Microsoft.WindowsAzure.Commands.Common.Authentication;
20-
using Microsoft.WindowsAzure.Commands.Common.Models;
21-
using Microsoft.WindowsAzure.Commands.Common.Properties;
2221

23-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
22+
namespace Microsoft.Azure.Common.Extensions.Authentication
2423
{
2524
internal class ServicePrincipalTokenProvider : ITokenProvider
2625
{

src/Common/Commands.Common/Authentication/ShowDialog.cs renamed to src/Common/Azure.Common.Extensions/Authentication/ShowDialog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
15+
namespace Microsoft.Azure.Common.Extensions.Authentication
1616
{
1717
public enum ShowDialog
1818
{

src/Common/Commands.Common/Authentication/UserTokenProvider.cs renamed to src/Common/Azure.Common.Extensions/Authentication/UserTokenProvider.cs

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

15+
using Microsoft.Azure.Common.Extensions.Models;
16+
using Microsoft.Azure.Common.Extensions.Properties;
17+
using Microsoft.IdentityModel.Clients.ActiveDirectory;
1518
using System;
1619
using System.Runtime.InteropServices;
1720
using System.Security;
1821
using System.Threading;
1922
using System.Windows.Forms;
20-
using Microsoft.IdentityModel.Clients.ActiveDirectory;
21-
using Microsoft.WindowsAzure.Commands.Common.Models;
22-
using Microsoft.WindowsAzure.Commands.Common.Properties;
2323

24-
namespace Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication
24+
namespace Microsoft.Azure.Common.Extensions.Authentication
2525
{
2626
/// <summary>
2727
/// A token provider that uses ADAL to retrieve

src/Common/Commands.Common/AzureSession.cs renamed to src/Common/Azure.Common.Extensions/AzureSession.cs

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,32 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.Azure.Common.Extensions.Factories;
16+
using Microsoft.Azure.Common.Extensions.Models;
17+
using Microsoft.Azure.Common.Extensions.Properties;
1518
using System;
16-
using System.Collections.Generic;
17-
using Microsoft.WindowsAzure.Commands.Common.Common;
18-
using Microsoft.WindowsAzure.Commands.Common.Factories;
19-
using Microsoft.WindowsAzure.Commands.Common.Models;
20-
using Microsoft.WindowsAzure.Commands.Common.Properties;
21-
using Microsoft.WindowsAzure.Commands.Utilities.Common;
22-
using Microsoft.WindowsAzure.Commands.Utilities.Common.Authentication;
23-
24-
namespace Microsoft.WindowsAzure.Commands.Common
19+
using System.IO;
20+
21+
namespace Microsoft.Azure.Common.Extensions
2522
{
2623
public static class AzureSession
2724
{
2825
static AzureSession()
2926
{
30-
ClientFactory = new AzurePowerShellClientFactory();
27+
ClientFactory = new ClientFactory();
3128
AuthenticationFactory = new AuthenticationFactory();
3229
CurrentContext = new AzureContext();
3330
CurrentContext.Environment = AzureEnvironment.PublicEnvironments[EnvironmentName.AzureCloud];
31+
AzureSession.OldProfileFile = "WindowsAzureProfile.xml";
32+
AzureSession.OldProfileFileBackup = "WindowsAzureProfile.xml.bak";
33+
AzureSession.ProfileDirectory = Path.Combine(
34+
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
35+
Resources.AzureDirectoryName); ;
36+
AzureSession.ProfileFile = "AzureProfile.json";
37+
AzureSession.TokenCacheFile = "TokenCache.dat";
3438
}
3539

36-
public static AzureContext CurrentContext {get; private set; }
40+
public static AzureContext CurrentContext { get; private set; }
3741

3842
public static void SetCurrentContext(AzureSubscription subscription, AzureEnvironment environment, AzureAccount account)
3943
{
@@ -89,5 +93,15 @@ public static void SetCurrentContext(AzureSubscription subscription, AzureEnviro
8993
public static IClientFactory ClientFactory { get; set; }
9094

9195
public static IAuthenticationFactory AuthenticationFactory { get; set; }
96+
97+
public static string ProfileDirectory { get; set; }
98+
99+
public static string TokenCacheFile { get; set; }
100+
101+
public static string ProfileFile { get; set; }
102+
103+
public static string OldProfileFileBackup { get; set; }
104+
105+
public static string OldProfileFile { get; set; }
92106
}
93107
}

0 commit comments

Comments
 (0)