Power query to consume azure ad authenticated web api

Recently I developed an asp .net web api restful service.  It is secured by azure ad using owin middleware to handle the authentication.  When accessed through a web app I developed, everything works as expected.  When I try to consume the
service through power query, I can't get the required authentication going.  I have tried giving the token I've acquired using the 'key' field, and tried to use an organizational account, but it does not work as power query cannot tell where it should
try to authenticate.  I know I'm missing something, possibly the way I'm constructing the query, some missing parameters, etc. 

Greetings, Omar!
The requirement will most probably be a no-go scenario. But, please check if you can use the Web API as mentioned in the below blog.
https://cwebbbi.wordpress.com/2014/03/26/working-with-web-services-in-power-query/
Else, you can try basic authentication (which again I don’t
think is going to work and we are just giving a try). Basic Authentication is nothing but passing the User Name and Password. The Power Query will Pass the User Name and Password that we enter to the Web Service.
If the above doesn’t
work, then there is no other way in Power Query atleast for the moment to achieve this.
Thank you,
Arvind

Similar Messages

  • Power Query to consume Azure ML Web Service

    I've been struggling with creating a Power Query to consume an Azure ML web service and believe it's probably time for help from the community.  
    The Azure ML web service needs the following:
    OData Endpoint Address
    API Key
    JSON formatted body
    JSON formatted response
    Chris Webb's post (http://cwebbbi.wordpress.com/2014/04/19/web-services-and-post-requests-in-power-query/) gets most of the way there, but I'm missing something.
    My sample Azure ML Web Service API:  https://ussouthcentral.services.azureml.net/workspaces/ca45b0a19ee14a95aecde329dcb6c2b9/services/71d0c6db78214e63b63e335e07f1dd7d/score/help
    Any thoughts or examples that could be provided would be appreciated.
    Anthony Martin | www.pragmaticworks.com

    Hi Curt, and how do I pass input parameters to a ML web service? I need to pass some parameters to an experiment I created and I´m trying to use the code below...
    How do I need to change the code below to pass along 6 input parameters? Many thanks, Daniel
    let
    Source = Json.Document(Web.Contents("https://ussouthcentral.services.azureml.net/odata/workspaces/3a1d1f26c7de4ab2984b017cfed66a07/services/28fecca0a77d484bbe76e2e266ee9100/score",
    [Headers=
    [#"Authorization"= "Bearer h8EMTuSgrg3nWj6KGLw0qFKhpy1xYPOcdpjnFnOzuVOxQZWcSMP4H1O19JhsN0UwKoT2kcL7sNZsVA70F2I68w==",
    #"Content-Type"= "application/json"]]
    in
        Source

  • Power Query - How to format options for Web.Content()?

    I am trying to access a web api which can return data in either JSON or XML. When connecting with Power Query I get a "400, Bad request" error though and I suspect it could be due to Power Query not explicitly providing accepted Content-Types
    in the request. Anyone know how to add options to the Web.Content() request?
    http://office.microsoft.com/en-001/excel-help/web-contents-HA104112310.aspx
    Thanks!

    I believe the default reponse content-type is JSON. It doesn't serve Power Query with anything but an error response though and with the help of Network Monitor I caught a bit more details (in Swedish).
    Request:
    Http: Request, GET /platsannons/matchning, Query:lanid=1
    Command: GET
    + URI: /platsannons/matchning?lanid=1
    ProtocolVersion: HTTP/1.1
    Accept: */*
    UserAgent: Mozilla/5.0 (compatible; Microsoft.Data.Mashup; http://go.microsoft.com/fwlink/?LinkID=304225)
    Host: api.arbetsformedlingen.se
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive
    HeaderEnd: CRLF
    Response:
    HTTPPayloadLine: {"Error":{"statuskod":400,"titel":"Bad Request","beskrivning":"Felaktig headerparameter: [Accept-Language]"}}
    And the API can be found at:
    http://api.arbetsformedlingen.se/
    Would be great to be able to define custom headers to the request through options for cases like these. Thanks for the reply!
    Best regards,
    Daniel

  • Issue consuming Odata feed with Power Query (not in Power BI)

    I am trying to consume an OData feed from an SSRS report using Power Query ( latest release on Excel
     2010 x32). The Report server is in my company intranet.
    In the SSRS report, I can generate an Atom service file. When I use this file in PowerPivot, I can successfully import the report data and refresh it on demand. But I
    would like to do the same thing in Power Query using the "From OData feed" feature.
    1. I have tried supplying the URI to the service file
    = OData.Feed("file:///C:/Users/Bdarbonneau/Documents/temp/Manuf_cycle_time_mapping_table.atomsvc")
    I get this error : 
    DataFormat.Error: The supplied URL must be a valid 'http:' or 'https:' URL.
    2. I tried supplying the URL that the service file contains, but without success. 
    = OData.Feed("http://myssrsserver:8080/ReportServer?%2FMANUFACTURING%2FArchive%2FManuf_cycle_time_mapping_table&rs%3ACommand=Render&rs%3AFormat=ATOM&rc%3AItemPath=Tablix1")
    I get this error:
    DataFormat.Error: OData: The given URL neither points to an OData service or a feed
    Am I missing something, or is what I am trying to do not supported ? 
    Regards,
    Bertrand

    My Current workaround for pulling data from SSRS until the dev team have worked out the odata issue is to pull the report in as a csv file:
    Csv.Document(Web.Contents("http://Servername/ReportServer?/SummaryReport&rs:Command=Render&rs:Format=Csv")),
    I also tried pulling an excel file from SSRS with no success.
    Tried:
    Excel.Workbook(URL)
    Excel.Workbook(Web.Contents(URL))
    Excel.Workbook(File.Contents(URL))
    Excel.Workbook(File.Contents(Web.Contents(URL)))
    if anyone has had luck pulling in an excel file from SSRS i would like to know how.
    Is there a rough release date for the odata functionality?

  • Two Excel Web Query (IQY) features I am missing when using Power Query

    1. header labels
    In Excel Web Queries, I could specify the heading label
    2. format expressions
    In Excel Web Queries, I could specify a format string.
    I'm not too concerned about #1, but #2 is a real issue. Perhaps is just a lack of feature understanding on my part, but I don't see in the Query Editor any way to change the format for a column.  I can change the format in the worksheet but that change
    is lost when I refresh the data. Can formatting be done via "M"?  If so, then a feature request would be to add formatting to UI.
    Reading the docs, I see Number.ToText()
    http://office.microsoft.com/en-us/excel-help/number-totext-HA104110114.aspx
    But I don't get how I can use this in a Table.TransformColumns

    Ah, I did not understand "format" as "number format". As you've noticed, there's no notion of number format in Power Query itself, so you can only format the number by transforming it into another value. Number.ToText has a variety of options for transforming
    a number into a string. The following will format the "Column" column to have four places after the decimal point.
    = Table.TransformColumns(Data,{{"Column", each Number.ToText(_, "f4")}})
    Be aware, though, that this will cause the cell value in Excel to have a type of Text instead of Number.

  • Power Query connection to Web Page refreshable?

    Hi all,
    I know you can add PQ connections to the Data Management Gateway and have them be refreshable in the cloud. I noticed they recently began supporting SharePoint List connections. For my particular case, I am pulling in data from our SharePoint, but I
    cannot pull it into PQ with the SharePoint List feature; the table I need does not show up. Maybe it is not set up as a list? Anyway, when I use the website feature in PQ, I can type the address and get the info I need from SP. However, the connection
    string doesn't appear to work in Data Management Gateway. Is it not yet supported? I'd imagine that refreshing from a website would be one of the easier methods.
    What exactly is a SharePoint list, then? When I use out root URL for SP, it pulls back some tables, but not nearly as many as I'd imagine.
    Thanks for the input!
    Mark

    Mike,
    Isn't this just a list module in SharePoint?
    SharePoint Lists are supported as a data source in Power Query:
    http://office.microsoft.com/en-001/excel-help/introduction-to-microsoft-power-query-for-excel-HA104003940.aspx
    Info on Scheduled Data Refresh:
    http://office.microsoft.com/en-001/office365-sharepoint-online-enterprise-help/schedule-data-refresh-for-workbooks-in-power-bi-for-office-365-HA104180761.aspx#_Toc388608196
    Thanks! 
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Excel 2013 - power query - sample HDFS web server to work with

    Hi,
    I wanted to understand HDFS source in Power Query. In that case, can someone please help me to get a sample Hadoop server containing HDFS files os that I can connect to and work with. Some sample servers I
    found were restrictred or stopped.
    Thanks,
    Paddy

    Hi Paddy,
    Perhaps one of these three virtual labs might help:
    https://vlabs.holsystems.com/vlabs/technet?eng=VLabs&auth=none&src=vlabs&altadd=true&labid=11629
    https://vlabs.holsystems.com/vlabs/technet?eng=VLabs&auth=none&src=vlabs&altadd=true&labid=12692
    https://vlabs.holsystems.com/vlabs/technet?eng=VLabs&auth=none&src=microsoft.holsystems.com&altadd=true&labid=11207
    If not, I'd recommend asking this question in the Power Query forum here:
    http://social.technet.microsoft.com/Forums/en-us/home?forum=powerquery&filter=alltypes&sort=lastpostdesc
    This forum is meant for suggestions and feedback for the forums themselves, not product support.
    Good luck.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • How to use power query with sitecatalyst

    Hello,
    I need to use power query to import a table from sitecatalyst. Doing some tests I found that If remove the session from the url that has the report parameters, the app will redirect me to the login page, after entering the company, username and password
    it will load the report page with the data according to my filters.
    When I add the report url on the From Web option, excel does not allow me to add credentials. If I add the login+redirect url it allows me to add user/password but does not load the tables that appear on a regular browser.
    Is it possible to consume sitecatalyst without using Report Builder? If not, how you access the security info after you added the url.
    Thanks.

    To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
    digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
    Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective.

  • Connecting Power Query to SharePoint Foundation 2010

    I'm looking to set up PowerQuery in Excel 2013 to link into the various lists on our SharePoint 2010 Foundation server.
    I have established the connection URL.
    The SharePoint Foundation 2010 server is on the same LAN I'm connected to, so I've opted for Windows Authentication.
    These two aspects of the setup appear to be fine: However at the point when Power Query links to the SharePoint server the following error is being returned.
    DataSource.Error: OData: The feed's metadata document appears to be invalid.
    Any ideas?

    Hi,
    We have forum for Power Query discussion and feedback. I will move your post to that forum:
    https://social.technet.microsoft.com/Forums/en-us/home
    The reason why I move your post is to get you the most qualified pool of respondents, and other partners who read the forums
    regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding.

  • POWER QUERY Get External Data From File From Folder (Excel 2013)

    Hi,
    Beginner's question :
    What could be the use of the query on a folder : we just get a list of files with their path. What can we do with that?
    Thanks

    Hi,
    Do you want to combine data from multiple Excel Files in the same folder path into one table? If I understand correct, we can add a custom column to import the data.
    After we getting a list of files with their path, the Query Editor window will activate to show you a table containing a record for each file in the chosen directory. These will provide our function with the needed FilePath and FileName parameters. 
    Function sample: File name([Folder path],[Field name]
    For more detailed steps, please see the article:
    http://datapigtechnologies.com/blog/index.php/using-power-query-to-combine-data-from-multiple-excel-files-into-one-table/
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Using Power Query to import image files for Power View

    I am trying to use Power Query to import image data from a SQL Azure database for use in Power View.  I've selected both the source image table and the ?images table in the workbook query.  The files seem to load as binary data in the Power
    Query editor but when loaded to the data model with Power Pivot, the field becomes "text" type rather than binary.  Does anyone know the procedure to use  PowerQuery to load image files into PowerPivot?

    Hi,
    We currently do not support loading binary data from Power Query into the Power Pivot data model. This is something we'd like to address soon. For now, you will need to use the Power Pivot import capabilities if you want to achieve this.
    Sorry about the inconvenience - we will try to enable this feature over the coming months.
    Faisal Mohamood | Program Manager | Data Platform Group - Microsoft

  • POST http(s) request with xml content in Power Query

    I have a POST http request which works good in HttpRequester (Firefox plugin). I know that it is possible to call POST request in Power Query but cannot find working solution. Here is the original request:
    POST https://svcs.ebay.com/FeedbackService
    X-EBAY-SOA-OPERATION-NAME: createDSRSummaryByPeriod
    X-EBAY-SOA-SERVICE-VERSION: 1.0.0
    X-EBAY-SOA-SERVICE-NAME: FeedbackService
    X-EBAY-SOA-APP-NAME: ***
    X-EBAY-SOA-SITEID: 0
    X-EBAY-SOA-SECURITY-TOKEN: ***
    Content-Type: text/xml
    <?xml version="1.0" encoding="UTF-8"?>
    <createDSRSummaryByPeriodRequest xmlns="http://www.ebay.com/marketplace/services">
    <dateRange>
    <dateFrom>2013-12-01T00:00:00.000Z</dateFrom>
    <dateTo>2013-12-31T23:59:59.999Z</dateTo>
    </dateRange>
    <dateRangeEventType>ListingDate</dateRangeEventType>
    </createDSRSummaryByPeriodRequest>
    Power Query WebContent() function is capable to handle headers and xml content, however, there is no any documentation about its syntax.
    In Power Query I use this request:
    = Xml.Tables(Web.Contents(“https://svcs.ebay.com/FeedbackService”,
    [Headers =[" X-EBAY-SOA-OPERATION-NAME"= "createDSRSummaryByPeriod",
    "X-EBAY-SOA-SERVICE-VERSION="1.0.0",
    "X-EBAY-SOA-SERVICE-NAME"="FeedbackService",
    "X-EBAY-SOA-APP-NAME"="***","X-EBAY-SOA-SITEID"="0",
    "X-EBAY-SOA-SECURITY-TOKEN"="***"],
    Content=["<?xml version="1.0" encoding="UTF-8"?>
    <createDSRSummaryByPeriodRequest xmlns="http://www.ebay.com/marketplace/services">
    <dateRange>
    <dateFrom>2013-12-01T00:00:00.000Z</dateFrom>
    <dateTo>2013-12-31T23:59:59.999Z</dateTo>
    </dateRange>
    <dateRangeEventType>ListingDate</dateRangeEventType>
    </createDSRSummaryByPeriodRequest>"]]))
    However, it returns "Expression.SyntaxError: Invalid identifier." Maybe anyone has at least examples of analogous working syntax?

    Task is solved. First of all I updated PowerQuery since previous version does not support Headers option for Web.Contents function. Here is a correct syntax:
    =Xml.Document(Web.Contents("https://api.ebay.com/ws/api.dll",[Headers=[#"X-EBAY-API-COMPATIBILITY-LEVEL"= "871",#"X-EBAY-API-SITEID"="0",#"X-EBAY-API-CALL-NAME"="GetMyeBaySelling",#"CONTENT-TYPE"="text/xml"], Content=Text.ToBinary("<?xml version="&Character.FromNumber(34)&"1.0"&Character.FromNumber(34)&" encoding="&Character.FromNumber(34)&"utf-8"&Character.FromNumber(34)&"?>
    <GetMyeBaySellingRequest xmlns="&Character.FromNumber(34)&"urn:ebay:apis:eBLBaseComponents"&Character.FromNumber(34)&">
    <RequesterCredentials><eBayAuthToken>***</eBayAuthToken></RequesterCredentials><SoldList><DurationInDays>60</DurationInDays><Pagination><EntriesPerPage>100</EntriesPerPage><PageNumber>1</PageNumber></Pagination></SoldList></GetMyeBaySellingRequest>")]))

  • Moving Power Query from Excel to SSAS

    We are using Excel 2013 Power Query and PowerPivot to build data models that will be moved to SSAS Tabular. Are there any gotchas that will not import? I have seen in testing that we have to be careful about importing files. Excel likes drive letters and
    SQL Server prefers the UNC path. We aren't likely to have many/any files in the production state, but I'm wondering if there are other gotchas like this, especially with Power Query.

    Any ideas for Mike?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Power Query for Google Sheets

    Does anyone know of any plans to create an add-on for Power Query in Google Sheets?   I have played with the IMPORTHTML function but it doesn't provide the same data manipulation tools the PQ does.   I haven't had any luck finding anything in Google
    searches.
    Thanks

    Here's a way you can do this without a built-in connector:
    Make your Google Docs workbook visible to anyone that has the link (or public).
    Go File > Download as > Microsoft Excel.
    Get the link that was used in the browser's download manager.
    Go in PQ > From Web.
    Paste the link.
    Click "OK"
    The workbook will be download as an Excel workbook and opened in PQ.

  • Microstrategy in Power query

    Hi, Is it possible to extract data from microstrategy using power query? 
    I have tried to use microstrategy web service url in "from web" in power query but getting error as "DataSource.Error: Unable to connect to the remote server".

    Does MicroStrategy expose any endpoints using json or OData? Does the server you're trying to access require you to log in first?
    Ehren

Maybe you are looking for