Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
s1
Helper I
Helper I

(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.

s1_0-1692836674537.png

 

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?

1 ACCEPTED SOLUTION

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.

View solution in original post

6 REPLIES 6
s1
Helper I
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"="customEvents

But thanks for the idea!

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.

Gotchya. Would that be done in the workbook settings for that dataflow? I cannot find how to remove it from there.

s1_1-1692921147057.png

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?)

Would that be done in the workbook settings for that dataflow?

no, in the dataflow editor

would you reccommend I stick with using RelativePath?

yes

Awesome, thank you.

I disconnected the credentials here for both (somehow it let me save and close), and now one of them refers to the full query as the connection name. (I couldn't get the other one to clear the cache, but I just needed one to not use the root for the credentials, so it works now!)

s1_0-1692984135263.png

 

lbendlin
Super User
Super User

Read about the RelativePath option in Web.Contents.

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.