Forum Discussion
(API token auth) Credential issue when using two different environments
I have two separate dataflows in the same workspace:
- One for processing information from our developer environment for automation testing
- One for processing information from a separate environment for reporting
Each of the Queries in their dataflows starts with the below code, but #### represents the different environments
let AnalyticsQuery =
let Source = Json.Document(Web.Contents("https://api.applicationinsights.io/v1/apps/####/query",
[Query=[#"query"="customEvents
When I setup credentials, the connection auto-defines as https://api.applicationinsights.io, and cannot seem to be changed. For each one, I put in my API token in the username under Basic (shown as $$$$). This works for authorization.
I setup both dataflows, and each one works. However, when scheduling refreshes overnight (7 minutes queries, an hour apart), one will always fail. I suspect that both dataflows are referencing the same connection, so they are only getting the last Token value that I entered?
Data source credentials are missing or invalid. Please update the credentials for Web in dataflows settings page and try again.
Not sure if I am doing something wrong, or I shouldn't be trying to do things this way?
you need to actively delete the global data source settings for the previous definition. That is cached and will continue to be used unless you remove it.
6 Replies
- lbendlin
Super User
Read about the RelativePath option in Web.Contents.
- s1
Helper I
Hi lbendlin,
I actually first was using RelativePath, and making flows without it to see if it would change the connection name (it did not). Though maybe there is something in it that I am doing wrong.
let AnalyticsQuery = let Source = Json.Document(Web.Contents("https://api.applicationinsights.io", [RelativePath="v1/apps/####/query", Query=[#"query"="customEventsBut thanks for the idea!
- lbendlin
Super User
you need to actively delete the global data source settings for the previous definition. That is cached and will continue to be used unless you remove it.
- s1
Helper I
Gotchya. Would that be done in the workbook settings for that dataflow? I cannot find how to remove it from there.
There are 2 credentials here, but the first one is for an unrelated datasource using OAuth.
I guess the next attempt for that would be delete and re-create the dataflows?
(also, when doing all this, would you reccommend I stick with using RelativePath?)