Forum Discussion

rdlhrvy's avatar
rdlhrvy
Helper I
2 years ago

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.

 

 

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?

 

 

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

     

     

     

    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.

     

     

     

     

    • rdlhrvy's avatar
      rdlhrvy
      Helper I

      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.

       

      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 

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

       

       

      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

      • SaiTejaTalasila's avatar
        SaiTejaTalasila
        Super User

        Hi rdlhrvy ,

         

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

         

        Thanks,

        Sai Teja 

  • 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

     

     

     

    • rdlhrvy's avatar
      rdlhrvy
      Helper I

      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.