Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Problem adding datasource to a gateway using profile connection AWS

Hi, 

I have a problem to connect a datasource to a datagateway, I am using this endpoint 

 

POST https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources

 

and I am passig this as body:

 

{
    "connectionDetails": {"extensionDataSourceKind": "AmazonAthena", "extensionDataSourcePath": "Simba Athena connection1"},
    "credentialDetails": {
        "privacyLevel": "None",
        "encryptionAlgorithm": "RSA-OAEP",
        "credentials": "<Credentials created by new CredentialDetails>",
        "credentialType": "Anonymous",
        "encryptedConnection": "Encrypted"
    },
    "dataSourceType": "Extension",
    "dataSourceName": "app-nonprod-ci-athena-sandbox",
}

 

the credentials were created following this: https://learn.microsoft.com/en-us/power-bi/developer/embedded/configure-credentials?tabs=sdk3 I have the username and password of the powerbi admin user.

 

I also tested the connection using the ODBC from microsoft (dsn=Simba Athena connection1) and I am getting a success response. The DSN is using a profile connection already set on the machine .aws/config. It is working fine.

 

The problem is when I want to consume that endpoint it is responding with this error:

 

Invoke-PowerBIRestMethod: C:\temp\script_datasource_connection.ps1:89
Line |
  89 |      Invoke-PowerBIRestMethod -Url ('gateways/'+$thisGatewayObjectId.T …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | One or more errors occurred. ({   "code": "DM_GWPipeline_Gateway_MashupDataAccessError",   "pbi.error": {
     | "code": "DM_GWPipeline_Gateway_MashupDataAccessError",     "parameters": {},     "details": [       {
     | "code": "DM_ErrorDetailNameCode_UnderlyingErrorCode",         "detail": {           "type": 1,
     | "value": "-2147467259"         }       },       {         "code":
     | "DM_ErrorDetailNameCode_UnderlyingErrorMessage",         "detail": {           "type": 1,           "value":
     | "ODBC: ERROR [HY000] No AWS profile found: dev\r\nERROR [HY000] No AWS profile found: dev"         }       },
     | {         "code": "DM_ErrorDetailNameCode_UnderlyingHResult",         "detail": {           "type": 1,
     | "value": "-2147467259"         }       },       {         "code":
     | "Microsoft.Data.Mashup.ValueError.DataSourceKind",         "detail": {           "type": 1,           "value":
     | "AmazonAthena"         }       },       {         "code": "Microsoft.Data.Mashup.ValueError.DataSourcePath",
     | "detail": {           "type": 1,           "value": "Simba Athena nonprod-ci-dev"         }       },       {
     | "code": "Microsoft.Data.Mashup.ValueError.OdbcErrors",         "detail": {           "type": 1,
     | "value": "#table({\"SQLState\", \"NativeError\", \"Message\"}, {})"         }       },       {         "code":
     | "Microsoft.Data.Mashup.ValueError.Reason",         "detail": {           "type": 1,           "value":
     | "DataSource.Error"         }       }     ],     "exceptionCulprit": 1   } })
Invoke-PowerBIRestMethod: C:\temp\script_datasource_connection.ps1:89
Line |
  89 |      Invoke-PowerBIRestMethod -Url ('gateways/'+$thisGatewayObjectId.T …
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Encountered errors when invoking the command: {   "code": "DM_GWPipeline_Gateway_MashupDataAccessError",
     | "pbi.error": {     "code": "DM_GWPipeline_Gateway_MashupDataAccessError",     "parameters": {},     "details": [
     | {         "code": "DM_ErrorDetailNameCode_UnderlyingErrorCode",         "detail": {           "type": 1,
     | "value": "-2147467259"         }       },       {         "code":
     | "DM_ErrorDetailNameCode_UnderlyingErrorMessage",         "detail": {           "type": 1,           "value":
     | "ODBC: ERROR [HY000] No AWS profile found: dev\r\nERROR [HY000] No AWS profile found: dev"         }       },
     | {         "code": "DM_ErrorDetailNameCode_UnderlyingHResult",         "detail": {           "type": 1,
     | "value": "-2147467259"         }       },       {         "code":
     | "Microsoft.Data.Mashup.ValueError.DataSourceKind",         "detail": {           "type": 1,           "value":
     | "AmazonAthena"         }       },       {         "code": "Microsoft.Data.Mashup.ValueError.DataSourcePath",
     | "detail": {           "type": 1,           "value": "Simba Athena nonprod-ci-dev"         }       },       {
     | "code": "Microsoft.Data.Mashup.ValueError.OdbcErrors",         "detail": {           "type": 1,
     | "value": "#table({\"SQLState\", \"NativeError\", \"Message\"}, {})"         }       },       {         "code":
     | "Microsoft.Data.Mashup.ValueError.Reason",         "detail": {           "type": 1,           "value":
     | "DataSource.Error"         }       }     ],     "exceptionCulprit": 1   } }

 

  

Seems like in somewhere the profile is not available when I want to consume the endpoint, please help me

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Did you install the Amazon Athena ODBC driver and set up the connection profile on the gateway computer? 

     

    In addition, if you try to add the same data source to the same gateway manually via the Power BI Service, will this succeed?

     

    Best Regards,
    Jing

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jing,

       

      thanks for your response, yes I do have the driver 2.x. That is why I can create the ODBCs.

       

      I tried manually too, but I am getting same error:

      Unable to create connection for the following reason: Unable to connect to the data source. Either the data source is inaccessible, a connection timeout occurred, or the data source credentials are invalid. Please verify the data source configuration and contact a data source administrator to troubleshoot this issue.\n\nDetails: ODBC: ERROR [HY000] No AWS profile found: qa ERROR [HY000] No AWS profile found: qa Please have this information handy if you choose to create a support ticket. Session Id: XXX RequestId: XXX Cluster URI: https://api.powerbi.com Status code: 400 Time: xxx
      Best,

      Javier