codecutout / terraform-provider-powerbi

Terraform Power BI Provider
MIT License
14 stars 16 forks source link

Provide data source credentials #38

Open alxy opened 3 years ago

alxy commented 3 years ago

Hi,

is it possible to also provide credentials for datasources for PowerBI datasets? I can see that there is an option to add a datasource block in the documentation, I couldn't find a way to pass credentials to authenticate against this datasource.

Currently, what we are doing is using some custom PowerShell script to do the authorization using the following REST endpoint.

Example request body:

{
  "credentialDetails": {
    "credentialType": "Basic",
    "credentials": "{\"credentialData\":[{\"name\":\"username\", \"value\":\"john\"},{\"name\":\"password\", \"value\":\"*****\"}]}",
    "encryptedConnection": "Encrypted",
    "encryptionAlgorithm": "None",
    "privacyLevel": "None",
    "useEndUserOAuth2Credentials": "False"
  }
}

Would it be possible to add this to the provider so it can be natively handled by Terraform?

alex-davies commented 3 years ago

Currently updating data sources are done entirely with https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources

The API you linked appears to be for configuring a gateway. There is currently no support for gateways, but that is only because i do not have any experience with using a powerbi gateway. I would gladly accept any PRs to add gateway support