92
@nadia_brill ·

Refresh works on my desktop but the service says credentials not specified Power Query

Report pulls from a SharePoint folder of monthly CSVs plus a SQL view. Desktop refresh is instant. Scheduled refresh fails with a credentials error, and on the dataset settings page there is a third data source listed that I do not recognise — no server name, just a URL fragment. Gateway is installed and the SQL source shows green. Where is the third source coming from?

6 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @pinned_versions · 7mo ago · 2 replies

    That is a dynamic data source. Somewhere you have a step that builds a path or URL from a parameter, a column value, or a date, and the service cannot work out what it is going to call before it calls it, so it refuses to attach credentials.

    The fix is to keep the base address literal and push the variable part into an option record: Web.Contents("https://host/api", [RelativePath = "reports/" & period]) instead of Web.Contents("https://host/api/reports/" & period). Same for SharePoint — hardcode the site root and navigate to the folder in later steps rather than concatenating the folder into the initial call.

    71
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @nadia_brill · 7mo ago

      Found it — a helper query that appends the year to the SharePoint site URL so it picks the right archive folder. Rewrote it with RelativePath and the phantom source disappeared.

      26
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @idempotent_ian · 7mo ago

    Separately, every source in that list needs credentials filled in, not just the ones you care about. If one is unconfigured the whole refresh fails and the message points at whichever it hit first, which is rarely the actual culprit.

    40
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @iron_camber · 7mo ago · 2 replies

    The reason it works locally is that Desktop runs as you, with your Windows token and your browser session already signed in. Nothing about a clean local refresh tells you the dataset will refresh unattended. I do one manual refresh in the service before I trust a schedule, every time.

    25
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
    • @pinned_versions · 7mo ago

      And do it right after publishing rather than at 6am the next day when the schedule fires and nobody is watching.

      11
      Share
      Reply

      Answering anonymously — a moderator will review it first.

      Report
  • @csv_apologist · 7mo ago

    If those CSVs are a monthly drop that several reports use, consider landing them once in a dataflow and pointing the reports at that. Credentials get configured in one place and you stop paying the file-parsing cost in every dataset.

    18
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report