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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RikSN
Frequent Visitor

Auto refresh Afas connectors in PowerBI

Hi,

 

I am struggling with the connection between AFAS online and PowerBI online.

 

On my desktop PowerBI report I have connected several AFAS connectors to the PowerBI Desktop via a Web-source --> Advanced --> URL (HTTPS://[afas key].rest.afas.online/profitrestservices/connectors/[name connector]+ Authorization parameter (filled in the unique base 64 AFAS token). After connecting and setting a parameter for the token, I got following link in the query editor:

=Json.Document(Web.Contents("HTTPS://[afas key].rest.afas.online/profitrestservices/connectors/[name connector]", [headers=[Authorization={Parameter for the base 64 token}]])).

 

Now, I have 5 different connectors connected to my PowerBI desktop, and they all load and work when I refresh the report manually. After creating a whole dashboard I published it to the workspace for sharing.

 

The problem is that in the PowerBI web environment the report is not able to refresh. When I want to refresh an error comes up: "The credentials provided for the Web source are invalid. (Source at [afas link above])". I find this weird because it is able to load into the desktop version, so why not in the online version? The goal is to create automated refreshes.

 

I think it has something to do with the authorization parameter but I have no clue...

 

Thanks a lot for the help!

4 REPLIES 4
Anonymous
Not applicable

Hi RikSN,

 

Did you manage to solve the problem and if yes, how? Struggling with the same issue.

 

Thanks in advance,

Justin

v-shex-msft
Community Support
Community Support

Hi @RikSN,

Have you config power bi url on your data source side? If not, you can take a look at the following document to add them to whitelist to prevent if these request has been blocked:
Add Power BI URLs to your allow list 
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @RikSN,

It sounds like a common issue when you work with a web connector and anonymous authorization. I'd like to suggest you add operation parameters 'RelativePath' on your connector and split your URL to root path and 'relative path'.

let
    Source =
        Json.Document(
            Web.Contents(
                "HTTPS://[afas key].rest.afas.online",
                [
                    RelativePath = "/profitrestservices/connectors/[name connector]",
                    Headers = [
                        Authorization = "[Token]"
                    ]
                ]
            )
        )
in
    Source

Reference link:

Using The RelativePath And Query Options With Web.Contents() In Power Query And Power BI M Code 

'Dataset refresh : successfull via PBI-Desktop, but erroneous after publish to PBI-Service 
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Dear @v-shex-msft ,

 

Unfortunately the error remains... Is there another way?

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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