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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mhgottsc
Helper I
Helper I

Credentials not working for Bing Maps Geocoding API

I am using the geocodeing api to get Lat and Lon data  showen below: 

let 
Location = (State as text, Suburb as text, Pcode as text, Address as text)=>

let
    Source = Xml.Tables(Web.Contents("http://dev.virtualearth.net/REST/v1/Locations?countryRegion=""US"""
    &"&adminDistrict=" & State
    &"&locality=" & Suburb
    &"&postalCode=" & Pcode
    &"&addressLine=" & Address
    &"&o=xml&key=Ak1LEVAlLWaUn....................................")),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Copyright", type text}, {"BrandLogoUri", type text}, {"StatusCode", Int64.Type}, {"StatusDescription", type text}, {"AuthenticationResultCode", type text}, {"TraceId", type text}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"ResourceSets"}),
    #"Expanded ResourceSets" = Table.ExpandTableColumn(#"Removed Other Columns", "ResourceSets", {"ResourceSet"}, {"ResourceSet"}),
    #"Expanded ResourceSet" = Table.ExpandTableColumn(#"Expanded ResourceSets", "ResourceSet", {"Resources"}, {"Resources"}),
    #"Expanded Resources" = Table.ExpandTableColumn(#"Expanded ResourceSet", "Resources", {"Location"}, {"Location"}),
    #"Expanded Location" = Table.ExpandTableColumn(#"Expanded Resources", "Location", {"Address", "Confidence", "GeocodePoint"}, {"Address", "Confidence", "GeocodePoint"}),
    #"Expanded Address" = Table.ExpandTableColumn(#"Expanded Location", "Address", {"FormattedAddress"}, {"FormattedAddress"}),
    #"Expanded GeocodePoint" = Table.ExpandTableColumn(#"Expanded Address", "GeocodePoint", {"Latitude", "Longitude", "UsageType"}, {"Latitude", "Longitude", "UsageType"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded GeocodePoint", each ([UsageType] = "Display"))
in
    #"Filtered Rows"

in 
Location

 

I then used this code to invoke a custom function that pulls in the info for state, suburb, Pcode and address. This works when I limit the data to around 10 rows as showen below:

mhgottsc_0-1665073139466.png

However when I remove the index filter to include more than ~ 10 rows I start to get a credential error message that I am not able to resolve (showen below):

mhgottsc_1-1665073230991.png

None of the credential options are working and am stuck on how to fix this. 

 

Thanks!

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @mhgottsc ,

 

If you revert to the original steps, are the errors still there?

Try removing the step to delete the index columns and the step to filter the rows to see if the error exists.

 

Best Regards,

Stephen Tao

 

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

 

I tried this and the issue still presitsts after I remove the index colomn step and the filtered rows step. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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