From 97a4e443865bdaf98146281a7b09001b5f07aead Mon Sep 17 00:00:00 2001 From: "Joe Mayo (MSFT)" Date: Tue, 6 Oct 2020 19:29:01 -0700 Subject: [PATCH 1/2] Allow -Tenant parameter on Connect-PowerBIServiceAccount for all parametersets --- .../Profile/Commands.Profile/ConnectPowerBIServiceAccount.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Modules/Profile/Commands.Profile/ConnectPowerBIServiceAccount.cs b/src/Modules/Profile/Commands.Profile/ConnectPowerBIServiceAccount.cs index cf8521d7..436a9be9 100644 --- a/src/Modules/Profile/Commands.Profile/ConnectPowerBIServiceAccount.cs +++ b/src/Modules/Profile/Commands.Profile/ConnectPowerBIServiceAccount.cs @@ -55,8 +55,7 @@ public class ConnectPowerBIServiceAccount : PowerBICmdlet public SwitchParameter ServicePrincipal { get; set; } [Alias("TenantId")] - [Parameter(ParameterSetName = ServicePrincipalParameterSet, Mandatory = false)] - [Parameter(ParameterSetName = ServicePrincipalCertificateParameterSet, Mandatory = false)] + [Parameter(Mandatory = false)] public string Tenant { get; set; } [Parameter(Mandatory = false)] @@ -121,6 +120,7 @@ public override void ExecuteCmdlet() } environment = this.Settings.Environments[this.Environment]; } + if(!string.IsNullOrEmpty(this.Tenant)) { var tempEnvironment = (PowerBIEnvironment) environment; From bce69254b60b3c83a4ce01af7c2509bb44a331ed Mon Sep 17 00:00:00 2001 From: "Joe Mayo (MSFT)" Date: Tue, 6 Oct 2020 21:12:02 -0700 Subject: [PATCH 2/2] Doc updates. --- .../help/Connect-PowerBIServiceAccount.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Modules/Profile/Commands.Profile/help/Connect-PowerBIServiceAccount.md b/src/Modules/Profile/Commands.Profile/help/Connect-PowerBIServiceAccount.md index b22a9479..bbeab3e1 100644 --- a/src/Modules/Profile/Commands.Profile/help/Connect-PowerBIServiceAccount.md +++ b/src/Modules/Profile/Commands.Profile/help/Connect-PowerBIServiceAccount.md @@ -15,7 +15,7 @@ Log in to the Power BI service. ### User (Default) ``` Connect-PowerBIServiceAccount [-Environment ] [-CustomEnvironment ] - [-DiscoveryUrl ] [] + [-Tenant ] [-DiscoveryUrl ] [] ``` ### ServicePrincipal @@ -28,7 +28,7 @@ Connect-PowerBIServiceAccount [-Environment ] [-CustomEn ### UserAndCredential ``` Connect-PowerBIServiceAccount [-Environment ] [-CustomEnvironment ] - -Credential [-DiscoveryUrl ] [] + -Credential [-Tenant ] [-DiscoveryUrl ] [] ``` ### ServicePrincipalCertificate @@ -159,7 +159,7 @@ Cloud environment to connect against. Default is Public. Type: PowerBIEnvironmentType Parameter Sets: (All) Aliases: -Accepted values: Public, Germany, USGov, China, USGovHigh, USGovMil, OneBox, EDog, DXT +Accepted values: Public, Germany, USGov, China, USGovHigh, USGovMil, Custom, OneBox, EDog, DXT Required: False Position: Named @@ -188,7 +188,7 @@ Tenant name or tenant ID containing the service principal account. If not specif ```yaml Type: String -Parameter Sets: ServicePrincipal, ServicePrincipalCertificate +Parameter Sets: (All) Aliases: TenantId Required: False