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
ronenbitman
Frequent Visitor

Custom Connector - anonymous Authentication issue

hi,

I have a sharepoint excel file with a list of tickers, and i have Web.Contents() that parses these. all was great till i got to the depolying on the Web BI portal and scheduling a refresh, where the FW gave the regular issues
one of the articales i browsed suggested resolving this by creating a custom connector so i followed the guidelines

1. installed the SDK on my VS2017,

2. type the PQ code 

 

// This file contains your Data Connector logic
section SecGovFillings;

[DataSource.Kind="SecGovFillings", Publish="SecGovFillings.Publish"]
//shared SecGovFillings.GetSecID = (SecID as text) as text => 
shared SecGovFillings.GetSecID = () as text => 
    let
        //Source = Web.Page(Web.Contents("https://sec.report/",[RelativePath="ticker/"&SecID])),
        //Source = Web.Page(Web.Contents("https://sec.report/ticker/"&SecID)),
        Source = Web.Page(Web.Contents("https://sec.report/Ticker/NKLA")),
        #"Filtered Rows" = Table.SelectRows(Source, each ([Caption] = "Document")),
        Data = #"Filtered Rows"{0}[Data],
        Children1 = Data{0}[Children],
        #"Filtered Rows1" = Table.SelectRows(Children1, each ([Name] = "BODY")),
        Children2 = #"Filtered Rows1"{0}[Children],
        #"Filtered Rows2" = Table.SelectRows(Children2, each ([Name] = "DIV")),
        Children3 = #"Filtered Rows2"{0}[Children],
        Children4 = Children3{0}[Children],
        #"Filtered Rows3" = Table.SelectRows(Children4, each ([Name] = "H2")),
        Children5 = #"Filtered Rows3"{0}[Children],
        Text = Children5{0}[Text],
        #"Split Text" = Text.Split(Text, " "),
        #"Kept Last Items" = List.Last(#"Split Text")
    in
        #"Kept Last Items";

// Data Source Kind description
SecGovFillings = [
    Authentication = [
        // Key = [],
        // UsernamePassword = [],
        // Windows = [],
        Implicit = []
    ],
    Label = Extension.LoadString("DataSourceLabel")
];

// Data Source UI publishing description
SecGovFillings.Publish = [
    Beta = true,
    Category = "Other",
    ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
    LearnMoreUrl = "https://powerbi.microsoft.com/",
    SourceImage = SecGovFillings.Icons,
    SourceTypeImage = SecGovFillings.Icons
];

SecGovFillings.Icons = [
    Icon16 = { Extension.Contents("SecGovFillings16.png"), Extension.Contents("SecGovFillings20.png"), Extension.Contents("SecGovFillings24.png"), Extension.Contents("SecGovFillings32.png") },
    Icon32 = { Extension.Contents("SecGovFillings32.png"), Extension.Contents("SecGovFillings40.png"), Extension.Contents("SecGovFillings48.png"), Extension.Contents("SecGovFillings64.png") }
];

 

3. ran the code and although & set the authentication as anonymous

 

// Use this file to write queries to test your data connector
let
    //result = SecGovFillings.GetSecID("GOEV")
    result = SecGovFillings.GetSecID()
in
    result

 

4. ran the code again but was still reciving an error as authentication was not succeeding.

 

then i went and tried to deploy and check maybe its an issue with VS

1. i copied the file to the Custom connector folder

2. open Power BI Desktop

3. added a new data connector

 

= SecGovFillings.GetSecID()

 

the athentication window showed up, selected anonymous and it kept showing up as if it wasn't correct

 

the website i am trying to reach is opening regularly on browser https://sec.report/Ticker/frx

 

next, i tried creating a regular PQ

1. i added the code,

 

let
        Source = Web.Page(Web.Contents("https://sec.report/Ticker/NKLA")),
        #"Filtered Rows" = Table.SelectRows(Source, each ([Caption] = "Document")),
        Data = #"Filtered Rows"{0}[Data],
        Children1 = Data{0}[Children],
        #"Filtered Rows1" = Table.SelectRows(Children1, each ([Name] = "BODY")),
        Children2 = #"Filtered Rows1"{0}[Children],
        #"Filtered Rows2" = Table.SelectRows(Children2, each ([Name] = "DIV")),
        Children3 = #"Filtered Rows2"{0}[Children],
        Children4 = Children3{0}[Children],
        #"Filtered Rows3" = Table.SelectRows(Children4, each ([Name] = "H2")),
        Children5 = #"Filtered Rows3"{0}[Children],
        Text = Children5{0}[Text],
        #"Split Text" = Text.Split(Text, " "),
        #"Kept Last Items" = List.Last(#"Split Text")
    in
        #"Kept Last Items"

 

2. got the athentication window, selected anonymous

it worked on the regular PQ!

so it didn't work on VS, my custom data connector didn't work but PQ on desktop BI worked with the same PQ code (attached)

 

btw my custom data connector started working after the PQ code worked

 

how can i resolve this?

 

1 ACCEPTED SOLUTION

Hi Lionel,

Seems i had an issue with the authentication Microsoft, and a restrart to the computer resolved it.

so now all is good and working as expected

thanks

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @ronenbitman ,

 

Your custom connector project can't run in VS but it can run in Power BI Desktop?

Please provide screenshot of the relevant error message.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lionel,

Seems i had an issue with the authentication Microsoft, and a restrart to the computer resolved it.

so now all is good and working as expected

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.

Top Kudoed Authors