- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Connect-PowerBIServiceAccount gets stuck without any error
Hey there, I have a powershell script that setups a DataGateway where I need to connect with `Connect-DataGatewayServiceAccount`. Later on, I have to run `Connect-PowerBIServiceAccount` to create a DataSource which always gets stuck. There is no any error. I suspect that the reason is using two Connect commands within the same session. Because if I first execute Connect-PowerBIServiceAccount then it works. Do you have any thoughts on this? I appreciate for the help. Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @buraktas
Thanks for reaching out to the Microsoft fabric community forum.
Based on my testing, your findings are indeed accurate. After successfully executing Connect-DataGatewayServiceAccount, followed by Connect-PowerBIServiceAccount, there is no occurrence of public cloud user authentication. The conflict may arise due to the use of two different connection commands within the same PowerShell session, which might share certain session states or resources, leading to the conflict.
Below are my test screenshots:
From my testing, the most effective solution currently is to split your code into two parts and execute them in separate session windows. Here are my test results:
For further details, please refer to:
Connect-PowerBIServiceAccount (MicrosoftPowerBIMgmt.Profile) | Microsoft Learn
Connect-DataGatewayServiceAccount (DataGateway.Profile) | Microsoft Learn
Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used separate sessions by running one as a background job which did the trick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey @v-linyulu-msft , thanks a lot for confirming it from your side as well. It is glad to see that my assumption wasn't wrong. I will try to separate my script into two parts as suggested, and test it that way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @buraktas
Thanks for reaching out to the Microsoft fabric community forum.
Based on my testing, your findings are indeed accurate. After successfully executing Connect-DataGatewayServiceAccount, followed by Connect-PowerBIServiceAccount, there is no occurrence of public cloud user authentication. The conflict may arise due to the use of two different connection commands within the same PowerShell session, which might share certain session states or resources, leading to the conflict.
Below are my test screenshots:
From my testing, the most effective solution currently is to split your code into two parts and execute them in separate session windows. Here are my test results:
For further details, please refer to:
Connect-PowerBIServiceAccount (MicrosoftPowerBIMgmt.Profile) | Microsoft Learn
Connect-DataGatewayServiceAccount (DataGateway.Profile) | Microsoft Learn
Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-01-2024 04:38 AM | |||
10-29-2024 10:47 PM | |||
08-27-2024 03:07 PM | |||
09-20-2024 05:11 AM | |||
01-01-2025 03:18 AM |