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
rdlhrvy
Helper I
Helper I

Update datasource credential using API with Cloud connection

I am working on automatically update token when the token expires. I was able to update the credentials that is using gateway connection. I am doing now to update the credential that is using cloud connection but having an error for Unauthorized access with the gateway.

 

rdlhrvy_2-1723659847032.png

 

I was able to view gatewayID and DatasourceID with Cloud connection. Question is where are the gateways with cloud connection? How the permission managed with those gateway in cloud connections?

 

rdlhrvy_1-1723659778468.png

 

I never had any issues if using gateway connections as I can manage the gateway permissions under on-premise data gateway the only issue is with the cloud connections.

7 REPLIES 7
rsnodgrass
New Member

Hi @rdlhrvy ,

 

Have you managed to get this to work? I have the exact requirement and am strruggling to find out if it is possible to do.

 

thanks

Rob

 

 

 

No. haven't have any luck on this one. 😞 For now, I have to use OAuth until I find a solution to access the "virtual" gateway that the cloud connection created. Once I have a solution I would be able to replace credential automatically that is using Key as credential type.

v-xingshen-msft
Community Support
Community Support

Hi @rdlhrvy

As far as I know, gateways are just local data gateways and personal gateways, vnet gateways. Cloud connections are connections to the appropriate cloud data sources and are not strictly gateway types.

vxingshenmsft_0-1724814984080.png

 

 

vxingshenmsft_2-1723703903214.png

 

If you have any other questions, here's the file I found for you, hope it helps.

On-premises data gateway - Power BI | Microsoft Learn

 

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

What I am trying to do is that update the credential using API that is created with Shareable Cloud Connection. Databricks Access Token expires every 30 days so it makes a lot of sense to schedule a notebook job to update the access token without manually changing it in Power BI connection.

rdlhrvy_0-1723728985911.png

 

I have another connection as well that is created with On-premise and I can execute my notebook successfully with updating credential. 

 

The challenge I have right now is updating the credential that is created with Sharable Cloud Connection.

 

I can get the datasourceId and gatewayId as that is needed to update the credential 

rdlhrvy_1-1723729265532.png

When I try executing this API I am getting a response of PowerBINotAuthorized

 

rdlhrvy_2-1723729332899.pngrdlhrvy_3-1723729342644.png

 

Now my question is where is that gateway that is used with Cloud Connection? It shows there is a gateway but where is that and how to provide permission so that I can execute that API? That is only missing piece to successfuly execute the notebook. Just permission with the gateway.

 

Even with Personal Cloud Connection will have gateway returned if you call the API it will show datasourceId and gatewayId

Hi @rdlhrvy ,

 

Go to manageconnections and gateways in power bi service and check whether that connection is still available or not.

 

Thanks,

Sai Teja 

The shared cloud connection that was created is there. I can even use that connection to any dataset published that used the same connection. 

 

It is only updating the credential for that connection is the issue using API. I can update manually but not with API

Hi @rdlhrvy ,

 

You can check with your tenant admin once if he is unable to find it then you can open a ticket with MS support.

 

I think the rest API command which you are trying to use only works with  gateway connections and not for cloud connections.

 

Thanks,

Sai Teja 

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.