diff --git a/AzurePowershell.Test.targets b/AzurePowershell.Test.targets
index efe88235c84e..a65a3a1882e7 100644
--- a/AzurePowershell.Test.targets
+++ b/AzurePowershell.Test.targets
@@ -21,6 +21,7 @@
.\src\ServiceManagement\Sql\Commands.SqlDatabase.Test\bin\Debug\Microsoft.WindowsAzure.Commands.SqlDatabase.Test.dll
.\src\ServiceManagement\HDInsight\Commands.HDInsight.Test\bin\Debug\Microsoft.WindowsAzure.Commands.HDInsight.Test.dll
.\src\ServiceManagement\Storage\Commands.Storage.Test\bin\Debug\Microsoft.WindowsAzure.Commands.Storage.Test.dll
+ .\src\ResourceManager\KeyVault\Commands.KeyVault.Test\bin\Debug\Microsoft.Azure.Commands.KeyVault.Test.dll
"!Functional&!Scenario&!AzureRTScenario&!Sequential&!PIRTest&!Preview&!ADDomain"
All
"OneSDK&CIT"
@@ -137,6 +138,13 @@
+
+
+
+
+
+
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 8b85214022f8..5283a4ee0381 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,17 @@
+2015.01.08 version 0.8.13
+* Key Vault Service - new cmdlets in AzureResourceManager mode:
+ * Keys:
+ * Add-AzureKeyVaultKey
+ * Get-AzureKeyVaultKey
+ * Set-AzureKeyVaultKey
+ * Backup-AzureKeyVaultKey
+ * Restore-AzureKeyVaultKey
+ * Remove-AzureKeyVaultKey
+ * Secrets:
+ * Get-AzureKeyVaultSecret
+ * Set-AzureKeyVaultSecret
+ * Remove-AzureKeyVaultSecret
+
2014.12.12 version 0.8.12
* StreamAnalytics
* New cmdlets in AzureResourceManager mode
diff --git a/build.proj b/build.proj
index 8f11595dc782..2f3cf1d77e9b 100644
--- a/build.proj
+++ b/build.proj
@@ -195,7 +195,7 @@
-
+
diff --git a/setup/azurecmd.wxs b/setup/azurecmd.wxs
index aeb953834b9e..6c8904626739 100644
--- a/setup/azurecmd.wxs
+++ b/setup/azurecmd.wxs
@@ -1,11 +1,11 @@
-
+
-
+
diff --git a/setup/azurecmdfiles.wxi b/setup/azurecmdfiles.wxi
index 4c5401b9c16c..bb751da17f58 100644
--- a/setup/azurecmdfiles.wxi
+++ b/setup/azurecmdfiles.wxi
@@ -17,6 +17,9 @@
+
+
+
@@ -70,6 +73,9 @@
+
+
+
@@ -149,6 +155,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,6 +230,9 @@
+
+
+
@@ -224,6 +298,15 @@
+
+
+
+
+
+
+
+
+
@@ -266,6 +349,9 @@
+
+
+
@@ -352,6 +438,9 @@
+
+
+
@@ -420,6 +509,9 @@
+
+
+
@@ -497,6 +589,9 @@
+
+
+
@@ -584,6 +679,9 @@
+
+
+
@@ -649,6 +747,12 @@
+
+
+
+
+
+
@@ -682,6 +786,9 @@
+
+
+
@@ -843,6 +950,9 @@
+
+
+
@@ -896,6 +1006,9 @@
+
+
+
@@ -997,6 +1110,12 @@
+
+
+
+
+
+
@@ -1030,6 +1149,9 @@
+
+
+
@@ -1170,6 +1292,9 @@
+
+
+
@@ -1238,6 +1363,9 @@
+
+
+
@@ -1300,6 +1428,12 @@
+
+
+
+
+
+
@@ -1327,6 +1461,9 @@
+
+
+
@@ -1767,6 +1904,12 @@
+
+
+
+
+
+
@@ -1794,6 +1937,9 @@
+
+
+
@@ -1949,6 +2095,9 @@
+
+
+
@@ -2029,6 +2178,9 @@
+
+
+
@@ -2103,6 +2255,7 @@
+
@@ -2120,6 +2273,7 @@
+
@@ -2146,9 +2300,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2170,6 +2346,9 @@
+
+
+
@@ -2184,6 +2363,7 @@
+
@@ -2212,6 +2392,7 @@
+
@@ -2234,6 +2415,7 @@
+
@@ -2259,6 +2441,7 @@
+
@@ -2286,6 +2469,7 @@
+
@@ -2307,6 +2491,8 @@
+
+
@@ -2318,6 +2504,7 @@
+
@@ -2371,6 +2558,7 @@
+
@@ -2388,6 +2576,7 @@
+
@@ -2421,6 +2610,8 @@
+
+
@@ -2432,6 +2623,7 @@
+
@@ -2478,6 +2670,7 @@
+
@@ -2500,6 +2693,7 @@
+
@@ -2520,6 +2714,8 @@
+
+
@@ -2529,6 +2725,7 @@
+
@@ -2661,6 +2858,8 @@
+
+
@@ -2670,6 +2869,7 @@
+
@@ -2721,6 +2921,7 @@
+
@@ -2747,6 +2948,7 @@
+
diff --git a/src/AzurePowershell.sln b/src/AzurePowershell.sln
index 3f7fd0758a94..8b680bdf26d1 100644
--- a/src/AzurePowershell.sln
+++ b/src/AzurePowershell.sln
@@ -143,6 +143,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network", "Service
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Network.Test", "ServiceManagement\Network\Commands.Network.Test\Commands.Network.Test.csproj", "{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.KeyVault", "ResourceManager\KeyVault\Commands.KeyVault\Commands.KeyVault.csproj", "{9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.KeyVault.Test", "ResourceManager\KeyVault\Commands.KeyVault.Test\Commands.KeyVault.Test.csproj", "{080B0477-7E52-4455-90AB-23BD13D1B1CE}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices", "ServiceManagement\RecoveryServices\Commands.RecoveryServices\Commands.RecoveryServices.csproj", "{98B10548-DF97-4FB1-8D82-2A12945D4F21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.RecoveryServices.Test", "ServiceManagement\RecoveryServices\Commands.RecoveryServices.Test\Commands.RecoveryServices.Test.csproj", "{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}"
@@ -347,6 +351,10 @@ Global
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9FFC40CC-A341-4D0C-A25D-DC6B78EF6C94}.Release|Any CPU.Build.0 = Release|Any CPU
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98B10548-DF97-4FB1-8D82-2A12945D4F21}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -355,6 +363,10 @@ Global
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.Build.0 = Release|Any CPU
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F49A314A-A235-47D3-A654-1EC19ACA366C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -396,6 +408,7 @@ Global
{F4ABAD68-64A5-4B23-B09C-42559A7524DE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{FDB897BD-FCB4-44A1-8D66-AC99F22EC737} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{A415F75B-EB6A-49A6-934E-5BA71B83D6EB} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
+ {080B0477-7E52-4455-90AB-23BD13D1B1CE} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
{7E6683BE-ECFF-4709-89EB-1325E9E70512} = {95C16AED-FD57-42A0-86C3-2CF4300A4817}
EndGlobalSection
EndGlobal
diff --git a/src/Common/Azure.Common.Extensions/Common.Extensions.csproj b/src/Common/Azure.Common.Extensions/Common.Extensions.csproj
index 65358fb47311..b3bb3472a230 100644
--- a/src/Common/Azure.Common.Extensions/Common.Extensions.csproj
+++ b/src/Common/Azure.Common.Extensions/Common.Extensions.csproj
@@ -189,6 +189,7 @@
+
Designer
diff --git a/src/Common/Azure.Common.Extensions/Common/RequiredResourceLookup.cs b/src/Common/Azure.Common.Extensions/Common/RequiredResourceLookup.cs
index 21cf5093a03f..4219493b6d8d 100644
--- a/src/Common/Azure.Common.Extensions/Common/RequiredResourceLookup.cs
+++ b/src/Common/Azure.Common.Extensions/Common/RequiredResourceLookup.cs
@@ -52,7 +52,8 @@ internal static IList RequiredProvidersForResourceManager() where T :
"microsoft.visualstudio",
"microsoft.insights",
"successbricks.cleardb",
- "microsoft.cache" };
+ "microsoft.cache",
+ "Microsoft.KeyVault"};
}
if (typeof(T).FullName.EndsWith("BatchManagementClient"))
{
diff --git a/src/Common/Azure.Common.Extensions/Factories/AuthenticationFactory.cs b/src/Common/Azure.Common.Extensions/Factories/AuthenticationFactory.cs
index f280a0d4e4a1..b50f7dd74574 100644
--- a/src/Common/Azure.Common.Extensions/Factories/AuthenticationFactory.cs
+++ b/src/Common/Azure.Common.Extensions/Factories/AuthenticationFactory.cs
@@ -32,14 +32,15 @@ public AuthenticationFactory()
}
public ITokenProvider TokenProvider { get; set; }
+
- public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior)
+ public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior,
+ AzureEnvironment.Endpoint resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)
{
- var token = TokenProvider.GetAccessToken(GetAdalConfiguration(environment, tenant), promptBehavior, account.Id, password, account.Type);
+ var token = TokenProvider.GetAccessToken(GetAdalConfiguration(environment, tenant, resourceId), promptBehavior, account.Id, password, account.Type);
account.Id = token.UserId;
return token;
}
-
public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context)
{
if (context.Subscription == null)
@@ -77,20 +78,21 @@ public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext
throw new ArgumentException(Resources.InvalidSubscriptionState, ex);
}
}
-
- private AdalConfiguration GetAdalConfiguration(AzureEnvironment environment, string tenantId)
+
+
+ private AdalConfiguration GetAdalConfiguration(AzureEnvironment environment, string tenantId,
+ AzureEnvironment.Endpoint resourceId)
{
if (environment == null)
{
throw new ArgumentNullException("environment");
}
var adEndpoint = environment.Endpoints[AzureEnvironment.Endpoint.ActiveDirectory];
- var adResourceId = environment.Endpoints[AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId];
-
+
return new AdalConfiguration
{
AdEndpoint = adEndpoint,
- ResourceClientUri = adResourceId,
+ ResourceClientUri = environment.Endpoints[resourceId],
AdDomain = tenantId
};
}
diff --git a/src/Common/Azure.Common.Extensions/Interfaces/IAuthenticationFactory.cs b/src/Common/Azure.Common.Extensions/Interfaces/IAuthenticationFactory.cs
index 6f9b40579783..77740ca0debe 100644
--- a/src/Common/Azure.Common.Extensions/Interfaces/IAuthenticationFactory.cs
+++ b/src/Common/Azure.Common.Extensions/Interfaces/IAuthenticationFactory.cs
@@ -29,8 +29,9 @@ public interface IAuthenticationFactory
///
///
///
- ///
- IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior);
+ ///
+ IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior,
+ AzureEnvironment.Endpoint resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId);
SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context);
}
diff --git a/src/Common/Azure.Common.Extensions/Models/AzureEnvironment.Methods.cs b/src/Common/Azure.Common.Extensions/Models/AzureEnvironment.Methods.cs
index ac0aafbb806f..a9934d8fd173 100644
--- a/src/Common/Azure.Common.Extensions/Models/AzureEnvironment.Methods.cs
+++ b/src/Common/Azure.Common.Extensions/Models/AzureEnvironment.Methods.cs
@@ -96,6 +96,8 @@ private string StorageFileEndpointFormat()
{ AzureEnvironment.Endpoint.SqlDatabaseDnsSuffix, AzureEnvironmentConstants.AzureSqlDatabaseDnsSuffix },
{ AzureEnvironment.Endpoint.Graph, AzureEnvironmentConstants.AzureGraphEndpoint },
{ AzureEnvironment.Endpoint.TrafficManagerDnsSuffix, AzureEnvironmentConstants.AzureTrafficManagerDnsSuffix },
+ { AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix, AzureEnvironmentConstants.AzureKeyVaultDnsSuffix },
+ { AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId, AzureEnvironmentConstants.AzureKeyVaultServiceEndpointResourceId },
}
}
},
@@ -254,7 +256,7 @@ public string GetPublishSettingsFileUrlWithRealm(string realm = null)
public enum Endpoint
{
- ActiveDirectoryServiceEndpointResourceId,
+ ActiveDirectoryServiceEndpointResourceId,
AdTenant,
@@ -277,6 +279,10 @@ public enum Endpoint
Graph,
TrafficManagerDnsSuffix,
+
+ AzureKeyVaultDnsSuffix,
+
+ AzureKeyVaultServiceEndpointResourceId,
}
}
@@ -322,5 +328,9 @@ public static class AzureEnvironmentConstants
public const string AzureTrafficManagerDnsSuffix = "trafficmanager.net";
public const string ChinaTrafficManagerDnsSuffix = "trafficmanager.cn";
+
+ public const string AzureKeyVaultDnsSuffix = "vault.azure.net";
+
+ public const string AzureKeyVaultServiceEndpointResourceId = "https://vault.azure.net";
}
}
diff --git a/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs b/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs
index 271051bc6811..334469eefacf 100644
--- a/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs
+++ b/src/Common/Commands.Common.Test/Common/ProfileClientTests.cs
@@ -1424,6 +1424,8 @@ private void SetMockData()
{ AzureEnvironment.Endpoint.ActiveDirectory, "https://login.windows-ppe.net/" },
{ AzureEnvironment.Endpoint.Gallery, "https://current.gallery.azure-test.net" },
{ AzureEnvironment.Endpoint.ResourceManager, "https://api-current.resources.windows-int.net/" },
+ { AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix, "vault-int.azure-int.net"},
+ { AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId, "https://vault-int.azure-int.net/"}
}
};
azureAccount = new AzureAccount
diff --git a/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs b/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
index 856392d00b8e..b72bb2c66b66 100644
--- a/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
+++ b/src/Common/Commands.Common.Test/Common/ProfileCmdltsTests.cs
@@ -736,7 +736,9 @@ private void SetMockData()
{ AzureEnvironment.Endpoint.AdTenant, "https://login.windows-ppe.net/" },
{ AzureEnvironment.Endpoint.ActiveDirectory, "https://login.windows-ppe.net/" },
{ AzureEnvironment.Endpoint.Gallery, "https://current.gallery.azure-test.net" },
- { AzureEnvironment.Endpoint.ResourceManager, "https://api-current.resources.windows-int.net/" },
+ { AzureEnvironment.Endpoint.ResourceManager, "https://api-current.resources.windows-int.net/" },
+ { AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix, "vault-int.azure-int.net" },
+ { AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId, "https://vault-int.azure-int.net/" },
}
};
azureAccount = new AzureAccount
diff --git a/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs
index e2b68c5b2143..792e281095a5 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockCertificateAuthenticationFactory.cs
@@ -34,7 +34,8 @@ public MockCertificateAuthenticationFactory(string userId, X509Certificate2 cert
Certificate = certificate;
}
- public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior)
+ public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior,
+ AzureEnvironment.Endpoint resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)
{
if (account.Id == null)
{
diff --git a/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs b/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs
index 5675b84696e5..b5925680cf8d 100644
--- a/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs
+++ b/src/Common/Commands.Common.Test/Mocks/MockTokenAuthenticationFactory.cs
@@ -54,7 +54,8 @@ public MockTokenAuthenticationFactory(string userId, string accessToken)
};
}
- public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior)
+ public IAccessToken Authenticate(AzureAccount account, AzureEnvironment environment, string tenant, SecureString password, ShowDialog promptBehavior,
+ AzureEnvironment.Endpoint resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)
{
if (account.Id == null)
{
diff --git a/src/Common/Commands.Common/AzurePowerShell.cs b/src/Common/Commands.Common/AzurePowerShell.cs
index b4be4772a6ed..8a83a71d76c5 100644
--- a/src/Common/Commands.Common/AzurePowerShell.cs
+++ b/src/Common/Commands.Common/AzurePowerShell.cs
@@ -27,9 +27,9 @@ public class AzurePowerShell
public const string AssemblyCopyright = "Copyright © Microsoft";
- public const string AssemblyVersion = "0.8.12";
+ public const string AssemblyVersion = "0.8.13";
- public const string AssemblyFileVersion = "0.8.12";
+ public const string AssemblyFileVersion = "0.8.13";
public const string ProfileFile = "AzureProfile.json";
diff --git a/src/Common/Commands.Common/Common/ManagementConstants.cs b/src/Common/Commands.Common/Common/ManagementConstants.cs
new file mode 100644
index 000000000000..0de6c33ad716
--- /dev/null
+++ b/src/Common/Commands.Common/Common/ManagementConstants.cs
@@ -0,0 +1,127 @@
+// ----------------------------------------------------------------------------------
+//
+// 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 System.Net.Http.Headers;
+using Microsoft.WindowsAzure.Commands.Common;
+
+namespace Microsoft.WindowsAzure.Commands.Utilities.Common
+{
+ public static class ApiConstants
+ {
+ public const string AuthorizationHeaderName = "Authorization";
+
+ public const string BasicAuthorization = "Basic";
+
+ public const string UserAgentHeaderName = "User-Agent";
+
+ public const string UserAgentHeaderValue = "AzurePowershell/v" + AzurePowerShell.AssemblyVersion;
+
+ public static ProductInfoHeaderValue UserAgentValue = new ProductInfoHeaderValue(
+ "AzurePowershell",
+ string.Format("v{0}", AzurePowerShell.AssemblyVersion));
+
+ public const string VSDebuggerCausalityDataHeaderName = "VSDebuggerCausalityData";
+
+ public const string OperationTrackingIdHeader = "x-ms-request-id";
+
+ public const string VersionHeaderContentLatest = "2013-08-01";
+
+ public const string VersionHeaderName = "x-ms-version";
+
+ }
+
+ public class SDKVersion
+ {
+ public const string Version180 = "1.8.0";
+
+ public const string Version200 = "2.0.0";
+
+ public const string Version220 = "2.2.0";
+
+ public const string Version230 = "2.3.0";
+
+ public const string Version240 = "2.4.0";
+
+ public const string Version250 = "2.5.0";
+ }
+
+ public enum DevEnv
+ {
+ Local,
+ Cloud
+ }
+
+ public enum RoleType
+ {
+ WebRole,
+ WorkerRole
+ }
+
+ public enum RuntimeType
+ {
+ IISNode,
+ Node,
+ PHP,
+ Cache,
+ Null
+ }
+
+ public static class EnvironmentName
+ {
+ public const string AzureCloud = "AzureCloud";
+
+ public const string AzureChinaCloud = "AzureChinaCloud";
+ }
+
+ public static class AzureEnvironmentConstants
+ {
+ public const string AzureServiceEndpoint = "https://management.core.windows.net/";
+
+ public const string ChinaServiceEndpoint = "https://management.core.chinacloudapi.cn/";
+
+ public const string AzureResourceManagerEndpoint = "https://management.azure.com/";
+
+ public const string GalleryEndpoint = "https://gallery.azure.com/";
+
+ public const string AzurePublishSettingsFileUrl = "http://go.microsoft.com/fwlink/?LinkID=301775";
+
+ public const string ChinaPublishSettingsFileUrl = "http://go.microsoft.com/fwlink/?LinkID=301776";
+
+ public const string AzureManagementPortalUrl = "http://go.microsoft.com/fwlink/?LinkId=254433";
+
+ public const string ChinaManagementPortalUrl = "http://go.microsoft.com/fwlink/?LinkId=301902";
+
+ public const string AzureStorageEndpointSuffix = "core.windows.net";
+
+ public const string ChinaStorageEndpointSuffix = "core.chinacloudapi.cn";
+
+ public const string AzureSqlDatabaseDnsSuffix = ".database.windows.net";
+
+ public const string ChinaSqlDatabaseDnsSuffix = ".database.chinacloudapi.cn";
+
+ public const string AzureActiveDirectoryEndpoint = "https://login.windows.net/";
+
+ public const string ChinaActiveDirectoryEndpoint = "https://login.chinacloudapi.cn/";
+
+ public const string AzureGraphEndpoint = "https://graph.windows.net/";
+
+ public const string AzureTrafficManagerDnsSuffix = "trafficmanager.net";
+
+ public const string ChinaTrafficManagerDnsSuffix = "trafficmanager.cn";
+
+ public const string AzureKeyVaultDnsSuffix = "vault.azure.net";
+
+ public const string AzureKeyVaultServiceEndpointResourceId = "https://vault.azure.net";
+ }
+}
\ No newline at end of file
diff --git a/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs b/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs
index 63f4218214bd..1af9a1b1ff14 100644
--- a/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs
+++ b/src/Common/Commands.Profile/Environment/AddAzureEnvironment.cs
@@ -61,6 +61,14 @@ public class AddAzureEnvironmentCommand : SubscriptionCmdletBase
HelpMessage = "The AD Graph Endpoint.")]
public string GraphEndpoint { get; set; }
+ [Parameter(Position = 10, Mandatory = false, ValueFromPipelineByPropertyName = true,
+ HelpMessage = "Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net")]
+ public string AzureKeyVaultDnsSuffix { get; set; }
+
+ [Parameter(Position = 11, Mandatory = false, ValueFromPipelineByPropertyName = true,
+ HelpMessage = "Resource identifier of Azure Key Vault data service that is the recipient of the requested token.")]
+ public string AzureKeyVaultServiceEndpointResourceId { get; set; }
+
public AddAzureEnvironmentCommand() : base(true) { }
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
@@ -76,7 +84,9 @@ public override void ExecuteCmdlet()
newEnvironment.Endpoints[AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId] = ActiveDirectoryServiceEndpointResourceId;
newEnvironment.Endpoints[AzureEnvironment.Endpoint.Gallery] = GalleryEndpoint;
newEnvironment.Endpoints[AzureEnvironment.Endpoint.Graph] = GraphEndpoint;
-
+ newEnvironment.Endpoints[AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix] = AzureKeyVaultDnsSuffix;
+ newEnvironment.Endpoints[AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId] = AzureKeyVaultServiceEndpointResourceId;
+
ProfileClient.AddOrSetEnvironment(newEnvironment);
List