microsoft / microsoft/vscode-powerquery-sdk
Unable to set credentials for non-[DataSource.Kind] Web.Contents -> leads to multiple errors
@mattmasson is already working on this.
Since Nov 3, 2022.
- Dominant language
- TypeScript
- Stars
- 92
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
Preflight Checklist
- I have installed the latest version of Power Query SDK.
- I have checked existing resources, including the common issues and the release notes.
- I have searched for similar issues.
Power Query SDK
0.1.5
Regression From
Legacy SDK
Platform
Windows
Architecture
x64
OS Version
No response
VSCode version
No response
PQSdkTool Path
No response
Bug Description
When the legacy SDK is asked to evaluate an extension method not marked with [DataSource.Kind] that contains a call to Web.Contents, the legacy SDK prompts the user to set credentials based on the URL being accessed. Once set, the Web.Contents call successfully completes.
When the new SDK is used in an identical situation, going through the "set credentials" process in VSCode does not prompt for the credentials needed for Web.Contents, but instead dies with an error. Additionally, attempting to evaluate the PQ test script raises an M error complaining about the needed credentials being missing.
Steps to Reproduce
- Create the following connector
[Version = "1.0.0"]
section ConnectorPlayGround;
shared ConnectorPlayGround.WebCallHelper = () =>
Web.Contents("http://bengribaudo.com");
[DataSource.Kind="ConnectorPlayGround"]
shared ConnectorPlayGround.Other = () => 1;
ConnectorPlayGround = [
Authentication = [
Anonymous = []
]
];
- Create the following test code file
let
Result = ConnectorPlayGround.WebCallHelper()
in
Result
Actual Experience
In the new SDK:
- "Set credentials" exits with an error
[Info] [Task found] c:\Users\ben\.vscode\extensions\powerquery.vscode-powerquery-sdk-0.1.5\.nuget\Microsoft.PowerQuery.SdkTools.2.110.2\tools\PQTest.exe set-credential
--extension "c:\Users\ben\Desktop\TestConnector\ConnectorPlayGround\bin\AnyCPU\Debug\ConnectorPlayGround.mez"
--queryFile "c:\Users\ben\Desktop\TestConnector\ConnectorPlayGround\ConnectorPlayGround.query.pq"
--prettyPrint "-ak" Anonymous
[Error] [Task exited abnormally] pqtest set-credential pid(2228) exit(4294967295) stderr: Error: Expected 1 data source in expression, but 0 were found.
- run-test reports an error complaining about missing credentials
[Info] [Task found] c:\Users\ben\.vscode\extensions\powerquery.vscode-powerquery-sdk-0.1.5\.nuget\Microsoft.PowerQuery.SdkTools.2.110.2\tools\PQTest.exe run-test
--extension "c:\Users\ben\Desktop\TestConnector\ConnectorPlayGround\bin\AnyCPU\Debug\ConnectorPlayGround.mez"
--queryFile "c:\Users\ben\Desktop\TestConnector\ConnectorPlayGround\ConnectorPlayGround.query.pq"
--prettyPrint
[Info] RunTestBattery result [
{
"ActivityId": "50799fa2-3597-4433-a8fa-e49dde2f3cf2",
"DataSourceAnalysis": [],
"Details": "Credentials are required to connect to the Web source. (Source at http://bengribaudo.com/.)",
"EndTime": "2022-09-28T17:16:13.7799393+00:00",
"Method": "PQTest.RunTest",
"Name": "ConnectorPlayGround.query.pq",
"StartTime": "2022-09-28T17:16:12.732765+00:00",
"Output": null,
"RowCount": 0,
"Status": "Failed",
"TraceFileLocation": null,
"Type": "PQTest.Expression"
}
]
Expected Experience
No response
Additional Context
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.