Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2031 from ogail/env

Fixes for Add-AzureEnvironment
  • Loading branch information...
commit 870af453c855a55a6c0ea6f4c3091b3146284b78 2 parents 765872a + 43d3d1b
@ogail ogail authored
View
4 WindowsAzurePowershell/src/Commands.Test/Common/ProfileStorageTests.cs
@@ -142,8 +142,8 @@ public void SavingWritesProfileDataToStore()
Name = sourceEnv.Name,
PublishSettingsFileUrl = sourceEnv.PublishSettingsFileUrl,
ServiceEndpoint = sourceEnv.ServiceEndpoint,
- AdTenantUrl = sourceEnv.AdTenantUrl,
- CommonTenantId = sourceEnv.CommonTenantId,
+ ActiveDirectoryEndpoint = sourceEnv.AdTenantUrl,
+ ActiveDirectoryCommonTenantId = sourceEnv.CommonTenantId,
StorageEndpointSuffix = sourceEnv.StorageEndpointSuffix
});
View
4 WindowsAzurePowershell/src/Commands.Utilities/Common/Authentication/AdalConfiguration.cs
@@ -76,8 +76,8 @@ public AdalConfiguration()
public AdalConfiguration(WindowsAzureEnvironment environment)
: this()
{
- AdEndpoint = environment.AdTenantUrl;
- AdDomain = environment.CommonTenantId;
+ AdEndpoint = environment.ActiveDirectoryEndpoint;
+ AdDomain = environment.ActiveDirectoryCommonTenantId;
}
public AdalConfiguration(WindowsAzureSubscription subscription)
View
8 WindowsAzurePowershell/src/Commands.Utilities/Common/ProfileData.cs
@@ -66,8 +66,8 @@ public AzureEnvironmentData(WindowsAzureEnvironment inMemoryEnvironment)
ServiceEndpoint = inMemoryEnvironment.ServiceEndpoint;
ManagementPortalUrl = inMemoryEnvironment.ManagementPortalUrl;
StorageEndpointSuffix = inMemoryEnvironment.StorageEndpointSuffix;
- AdTenantUrl = inMemoryEnvironment.AdTenantUrl;
- CommonTenantId = inMemoryEnvironment.CommonTenantId;
+ AdTenantUrl = inMemoryEnvironment.ActiveDirectoryEndpoint;
+ CommonTenantId = inMemoryEnvironment.ActiveDirectoryCommonTenantId;
}
/// <summary>
@@ -82,8 +82,8 @@ public WindowsAzureEnvironment ToAzureEnvironment()
ServiceEndpoint = this.ServiceEndpoint,
ManagementPortalUrl = this.ManagementPortalUrl,
StorageEndpointSuffix = this.StorageEndpointSuffix,
- AdTenantUrl = this.AdTenantUrl,
- CommonTenantId = this.CommonTenantId
+ ActiveDirectoryEndpoint = this.AdTenantUrl,
+ ActiveDirectoryCommonTenantId = this.CommonTenantId
};
}
View
12 WindowsAzurePowershell/src/Commands.Utilities/Common/WindowsAzureEnvironment.cs
@@ -47,14 +47,14 @@ public class WindowsAzureEnvironment
/// Url for the Active Directory tenant for this environment
/// </summary>
/// <remarks>If null, this environment does not support AD authentication</remarks>
- public string AdTenantUrl { get; set; }
+ public string ActiveDirectoryEndpoint { get; set; }
/// <summary>
/// Name for the common tenant used as the first step
/// in the AD authentication process for this environment.
/// </summary>
/// <remarks>If null, this environment does not support AD authentication</remarks>
- public string CommonTenantId { get; set; }
+ public string ActiveDirectoryCommonTenantId { get; set; }
private string storageEndpointSuffix;
@@ -169,7 +169,7 @@ private string AddRealm(string baseUrl, string realm)
public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProvider)
{
- if (AdTenantUrl == null)
+ if (ActiveDirectoryEndpoint == null)
{
throw new Exception(string.Format(Resources.EnvironmentDoesNotSupportActiveDirectory, Name));
}
@@ -185,7 +185,7 @@ public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProv
{
var azureSubscription = new WindowsAzureSubscription
{
- ActiveDirectoryEndpoint = AdTenantUrl,
+ ActiveDirectoryEndpoint = ActiveDirectoryEndpoint,
ActiveDirectoryTenantId = subscription.ActiveDirectoryTenantId,
ActiveDirectoryUserId = mainToken.UserId,
SubscriptionId = subscription.SubscriptionId,
@@ -227,8 +227,8 @@ public IEnumerable<WindowsAzureSubscription> AddAccount(ITokenProvider tokenProv
ServiceEndpoint = WindowsAzureEnvironmentConstants.AzureServiceEndpoint,
ManagementPortalUrl = WindowsAzureEnvironmentConstants.AzureManagementPortalUrl,
// TODO: Get real endpoint for prod
- AdTenantUrl = "https://login.windows.net/",
- CommonTenantId = "common",
+ ActiveDirectoryEndpoint = "https://login.windows.net/",
+ ActiveDirectoryCommonTenantId = "common",
StorageEndpointSuffix = WindowsAzureEnvironmentConstants.AzureStorageEndpointSuffix
}
},
View
14 WindowsAzurePowershell/src/Commands.Utilities/Microsoft.WindowsAzure.Commands.dll-Help.xml
@@ -607,6 +607,13 @@
</maml:description>
<command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
</command:parameter>
+ <command:parameter required = "false" variableLength = "false" globbing = "false" pipelineInput = "true (ByPropertyName)" position = "named" >
+ <maml:name>ActiveDirectoryEndpoint</maml:name>
+ <maml:description>
+ <maml:para>The URI for the Active Directory service for this environment</maml:para>
+ </maml:description>
+ <command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
+ </command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
@@ -645,6 +652,13 @@
</maml:description>
<command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
</command:parameter>
+ <command:parameter required = "false" variableLength = "false" globbing = "false" pipelineInput = "true (ByPropertyName)" position = "named" >
+ <maml:name>ActiveDirectoryEndpoint</maml:name>
+ <maml:description>
+ <maml:para>The URI for the Active Directory service for this environment</maml:para>
+ </maml:description>
+ <command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
+ </command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
View
5 WindowsAzurePowershell/src/Commands/Environment/AddAzureEnvironment.cs
@@ -41,7 +41,7 @@ public class AddAzureEnvironmentCommand : CmdletBase
public string StorageEndpoint { get; set; }
[Parameter(Position = 5, Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The URI for the Active Directory service for this environment")]
- public string AdTenantUrl { get; set; }
+ public string ActiveDirectoryEndpoint { get; set; }
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
public override void ExecuteCmdlet()
@@ -53,7 +53,8 @@ public override void ExecuteCmdlet()
ServiceEndpoint = ServiceEndpoint,
ManagementPortalUrl = ManagementPortalUrl,
StorageEndpointSuffix = StorageEndpoint,
- AdTenantUrl = AdTenantUrl
+ ActiveDirectoryEndpoint = ActiveDirectoryEndpoint,
+ ActiveDirectoryCommonTenantId = "Common"
};
WindowsAzureProfile.Instance.AddEnvironment(newEnvironment);
View
2  WindowsAzurePowershell/src/Commands/Environment/SetAzureEnvironment.cs
@@ -53,7 +53,7 @@ public override void ExecuteCmdlet()
env.ServiceEndpoint = Value(ServiceEndpoint, env.ServiceEndpoint);
env.ManagementPortalUrl = Value(ManagementPortalUrl, env.ManagementPortalUrl);
env.StorageEndpointSuffix = Value(StorageEndpoint, env.StorageEndpointSuffix);
- env.AdTenantUrl = Value(AdEndpointUrl, env.AdTenantUrl);
+ env.ActiveDirectoryEndpoint = Value(AdEndpointUrl, env.ActiveDirectoryEndpoint);
WindowsAzureProfile.Instance.UpdateEnvironment(env);
Please sign in to comment.
Something went wrong with that request. Please try again.