diff --git a/src/CLU/Commands.Common.Authentication/Models/AzureEnvironment.Methods.cs b/src/CLU/Commands.Common.Authentication/Models/AzureEnvironment.Methods.cs index 0f92cd1759b5..7f3fe2d3f250 100644 --- a/src/CLU/Commands.Common.Authentication/Models/AzureEnvironment.Methods.cs +++ b/src/CLU/Commands.Common.Authentication/Models/AzureEnvironment.Methods.cs @@ -372,7 +372,7 @@ public static class AzureEnvironmentConstants public const string USGovernmentSqlDatabaseDnsSuffix = ".database.usgovcloudapi.net"; - public const string AzureActiveDirectoryEndpoint = "https://login.windows.net/"; + public const string AzureActiveDirectoryEndpoint = "https://login.microsoftonline.com/"; public const string ChinaActiveDirectoryEndpoint = "https://login.chinacloudapi.cn/"; diff --git a/src/CLU/Commands.Common/Models/PSAzureContext.cs b/src/CLU/Commands.Common/Models/PSAzureContext.cs index 263b16740c66..f84aeb5878d0 100644 --- a/src/CLU/Commands.Common/Models/PSAzureContext.cs +++ b/src/CLU/Commands.Common/Models/PSAzureContext.cs @@ -86,5 +86,14 @@ public static implicit operator AzureContext(PSAzureContext context) public PSAzureTenant Tenant { get; set; } public byte[] TokenCache { get; set; } + + public override string ToString() + { + var account = Account != null ? Account.Id : string.Empty; + var subscription = Subscription != null ? Subscription.SubscriptionId : string.Empty; + var tenant = Tenant != null ? Tenant.TenantId : string.Empty; + var environment = Environment != null ? Environment.Name : EnvironmentName.AzureCloud; + return $"{{Account: {account}, Subscription: {subscription}, Tenant: {tenant}, Environment: {environment}}}"; + } } } diff --git a/src/CLU/Commands.Common/Models/PSAzureProfile.cs b/src/CLU/Commands.Common/Models/PSAzureProfile.cs index f689c4b88c91..285dd052dfda 100644 --- a/src/CLU/Commands.Common/Models/PSAzureProfile.cs +++ b/src/CLU/Commands.Common/Models/PSAzureProfile.cs @@ -64,6 +64,11 @@ public IDictionary Environments get { return _env; } } + public string EnvironmentNames + { + get { return _env == null? null : $"{string.Join(", ", _env.Keys.ToArray())}"; } + } + /// /// The current credentials and metadata for connecting with the current Azure cloud instance. /// diff --git a/src/CLU/Microsoft.Azure.Commands.Profile/Microsoft.Azure.Commands.Profile.format.ps1xml b/src/CLU/Microsoft.Azure.Commands.Profile/Microsoft.Azure.Commands.Profile.format.ps1xml index 8146c70da1f8..e745d0fcee98 100644 --- a/src/CLU/Microsoft.Azure.Commands.Profile/Microsoft.Azure.Commands.Profile.format.ps1xml +++ b/src/CLU/Microsoft.Azure.Commands.Profile/Microsoft.Azure.Commands.Profile.format.ps1xml @@ -1,10 +1,10 @@ - - Microsoft.Azure.Commands.Profile.Models.PSAzureProfile + + Microsoft.Azure.Commands.Models.PSAzureProfile - Microsoft.Azure.Commands.Profile.Models.PSAzureProfile + Microsoft.Azure.Commands.Models.PSAzureProfile @@ -12,36 +12,41 @@ - Context - + + + EnvironmentNames + + - + --> - Microsoft.Azure.Commands.Profile.Models.PSAzureContext + Microsoft.Azure.Commands.Models.PSAzureContext - Microsoft.Azure.Commands.Profile.Models.PSAzureContext + Microsoft.Azure.Commands.Models.PSAzureContext + Environment + Account - Tenant + Tenant - Subscription + Subscription @@ -49,9 +54,9 @@ - Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + Microsoft.Azure.Commands.Models.PSAzureSubscription - Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + Microsoft.Azure.Commands.Models.PSAzureSubscription @@ -75,9 +80,9 @@ - Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + Microsoft.Azure.Commands.Models.PSAzureTenant - Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + Microsoft.Azure.Commands.Models.PSAzureTenant @@ -94,5 +99,58 @@ + + Microsoft.Azure.Commands.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Models.PSAzureEnvironment + + + + + + + Name + + + + ActiveDirectoryAuthority + + + + ResourceManagerUrl + + + + GraphUrl + + + + GalleryUrl + + + + AdTenant + + + + ActiveDirectoryServiceEndpointResourceId + + + + AzureKeyVaultServiceEndpointResourceId + + + + AzureKeyVaultDnsSuffix + + + + EnableAdfsAuthentication + + + + + + diff --git a/src/CLU/Microsoft.CLU/Helpers/FormatReader.cs b/src/CLU/Microsoft.CLU/Helpers/FormatReader.cs index 6c7d59e99030..efe91f469753 100644 --- a/src/CLU/Microsoft.CLU/Helpers/FormatReader.cs +++ b/src/CLU/Microsoft.CLU/Helpers/FormatReader.cs @@ -136,13 +136,13 @@ private static void GetTableColumnItems(TableDescriptor table, XElement tableCon } } - private static void GetListItems(ListDescriptor list, XElement tableControl) + private static void GetListItems(ListDescriptor list, XElement listControl) { - var tableHeaders = GetChildrenMatching(tableControl, "ListEntries").FirstOrDefault(); + var listEntries = GetChildrenMatching(listControl, "ListEntries").FirstOrDefault(); - if (tableHeaders != null) + if (listEntries != null) { - foreach (var entry in GetChildrenMatching(tableHeaders, "ListEntry")) + foreach (var entry in GetChildrenMatching(listEntries, "ListEntry")) { foreach (var items in GetChildrenMatching(entry, "ListItems")) { @@ -152,6 +152,7 @@ private static void GetListItems(ListDescriptor list, XElement tableControl) var label = GetChildrenMatching(item, "Label").FirstOrDefault(); var propertyName = GetChildrenMatching(item, "PropertyName").FirstOrDefault(); + var property = GetChildrenMatching(item, "Property").FirstOrDefault(); if (label != null && !string.IsNullOrEmpty(label.Value)) { @@ -160,6 +161,16 @@ private static void GetListItems(ListDescriptor list, XElement tableControl) if (propertyName != null && !string.IsNullOrEmpty(propertyName.Value)) { column.ItemName = propertyName.Value; + if (string.IsNullOrEmpty(column.Header)) + { + column.Header = propertyName.Value; + } + } + + if (property != null && !string.IsNullOrEmpty(property.Value) && + string.IsNullOrEmpty(column.ItemName)) + { + column.ItemName = property.Value; } if (!string.IsNullOrEmpty(column.ItemName) && !string.IsNullOrEmpty(column.Header))