Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected JSON token when add custom value in local.settings.json #892

Open
2 of 3 tasks
jrigsby opened this issue Apr 9, 2024 · 0 comments
Open
2 of 3 tasks

Unexpected JSON token when add custom value in local.settings.json #892

jrigsby opened this issue Apr 9, 2024 · 0 comments

Comments

@jrigsby
Copy link

jrigsby commented Apr 9, 2024

Prerequisites

  • Plugin is in the latest version
  • Issue was not reported yet
  • Stack trace (if provided) contains mobi.hsz.idea.gitignore package name

Description

I created an Azure Function test project. When I run it with AzureWebJobsStorage it works fine debugging locally. I can get it to connect both to a dev storage or an azure hosted storage while debugging locally. I want to get it to work with managed identity, in the end telling it the tenant I want and that requires editing local.settings.json.

If I add ANY custom value in local.settings.json I get a pink window with the following message and a separate tool tip that says Build succeeded.

Error running 'Company.FunctionApp2' Unexpected JSON token at offset 174: Encountered an unknown key 'Test' at path: $.Values.FUNCTIONS_WORKER_RUNTIME Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys. JSON input: { "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", "Test": "value" } }

Builds fine. Build window shows

Build with surface heuristics started at 18:05:03
Use build tool: C:\Program Files\dotnet\sdk\8.0.202\MSBuild.dll
CONSOLE: MSBuild version 17.9.6+a4ecab324 for .NET
CONSOLE: Build started 4/9/2024 6:05:03 PM.
CONSOLE: Project "C:\Users\johnr.JR-XPS89\AppData\Local\Temp\Vexewaf.proj" on node 1 (default targets).
CONSOLE: ControllerTarget:
CONSOLE: Run controller from C:\Program Files\JetBrains\Rider\r2r\2024.1.0EAP\E35B93A9AF785A1CC8FDBE07A62B342\JetBrains.Platform.MsBuildTask.v17.dll
Build completed in 00:00:00.402

I don't know if this is a plugin issue or Rider itself.

Steps to Reproduce

  1. You can recreate by creating a new azure function project using the Rider template. All defaults selections. Then edit local.settings.json to look as follows:

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"Test": "value"
}
}

Choose to debug and that error shows. Obviously there is no function defined in a new project. Mine has one but to get you in a situation where you should be able to recreate I did this.

This is fine

{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
}
}

this is not
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"Test": "value"
}
}

shows message

Error running 'Company.FunctionApp2' Unexpected JSON token at offset 174: Encountered an unknown key 'Test' at path: $.Values.FUNCTIONS_WORKER_RUNTIME Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys. JSON input: { "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", "Test": "value" } }

Expected behavior:

Run without showing this error and also allow putting values in local.settings.json so that azure features can be enabled.

Actual behavior:

Errors if I have any custom property in local.settings.json

Reproduces how often:

Every time

Versions

Plugin:

4.0.0-preview.3

IDE:

JetBrains Rider 2024.1 RC 1
Build #RD-241.14494.225, built on March 26, 2024
Runtime version: 17.0.10+8-b1207.12 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

.NET Core v8.0.1 x64 (Server GC)

OS:

OS Name Microsoft Windows 10 Pro
Version 10.0.19045 Build 19045

Additional Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant