Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JMLyle
Frequent Visitor

Extracting the Username being used in a Gateway Data Source

I beleive there is a way to replace the credential being used by a Data Source on a gateway, but I haven't dug into doing that yet..

At the moment, I would just like to be able to ask a Data Source what Username it is using to authenticate to the actual database.

I prefer to do most things via PowerShell, but can grumpily use other methods if I need to.

 

Using Get-DataGatewayDatasource, I can get these properties, but Credentials is always NULL:

CredentialType
EncryptedConnection
PrivacyLevel
EncryptionAlgorithm
Credentials
UseCallerAADIdentity
UseEndUserOAuth2Credentials
UseCustomOAuthApp
SkipTestConnection
IsCredentialEncrypted

 

I can undersatnd if this is not possible to do, because it would seem like a potential information leak if it was possible, but I haven't been able to find anything confirming that it is not possible to ever see the username after it has been entered.




7 REPLIES 7
Wikkleyn_81
Resolver IV
Resolver IV

@JMLyle There is no way to get the credentials used to create the gateway connection. There is an idea raised for this and all votes help.

https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=465aea7f-b208-494b-8155-26faeaa21af7

Here is teh technote on teh encryption.
https://learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-data-sources#store-encrypted...

You can use the Power BI Rest API to update the credentials using PowerShell:

Gateways - Update Datasource

https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource

SaiTejaTalasila
Super User
Super User

Hi,

 

As far as I know:
You are not supposed to provide gateway access to everyone. You should provide access to the connections. Your password won't be exposed to anyone once the connection is created, and most data sources will lock your account on the database if you enter the wrong password more than three times.So,the rest API command will work only if they have access to that gateway connection.

Right, we typically provide gateway acces to no one, but add people as user of specific Data Sources that they need.

 

My struggle is that security would like to do a review of what a Data Source provides someone with access to. As a Gateway admin I can easily determine the connection details, but then the DBA would like to know what account is being used to access the database so that they can provide details about what data/tables/etc it is able to access.

RichieRichAzj
Frequent Visitor

A prompt would be handy though, perhaps the first or last character exposed. There can be so many systems/usernames in a large org and when a connection goes offline, it would be handy to have a hint at least which username was used. Alternatively, you can keep a list of usernames used for what connection, but that really defeats the purpose of security right?

 

GilbertQ
Super User
Super User

Hi @JMLyle 

 

Yeah I have not seen that exposed in different Microsoft products!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

GilbertQ
Super User
Super User

Hi @JMLyle 

 

As far as I am aware, that is bad is on because even knowing the username can often be a risk.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Yeah, agreed, it probably shouldn't be possible, but it sure would help me do a few things if it was possible.

 

I imagine that someone here either has been able to do it, or can point to a place where Microsoft says that you can't.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.