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

Function app worker runtime check should be case-insensitive #4250

Open
Grimeh opened this issue Aug 28, 2024 · 0 comments
Open

Function app worker runtime check should be case-insensitive #4250

Grimeh opened this issue Aug 28, 2024 · 0 comments
Labels
Milestone

Comments

@Grimeh
Copy link

Grimeh commented Aug 28, 2024

The pre-deploy check for mismatching FUNCTIONS_WORKER_RUNTIME values between the remote and local config is case sensitive, blocking deploy even if the worker runtimes only differ by case.
Eg. The remote runtime "DOTNET-ISOLATED" for function app "FoobarApp" does not match your local runtime "dotnet-isolated"..

Our remote runtime was set to DOTNET-ISOLATED which blocked us from deploying from VS Code. Seeing as either value is valid, I believe the comparison (see below) should be case-insensitive.

if (localVersion !== FuncVersion.v1 && isKnownWorkerRuntime(azureWorkerRuntime) && isKnownWorkerRuntime(localWorkerRuntime) && azureWorkerRuntime !== localWorkerRuntime) {

Failing that, I suggest promptToUpdateDotnetRuntime be made case-aware. This would allow users to deploy and update the remote runtime to the lower-case dotnet-runtime.

export function promptToUpdateDotnetRuntime(azureRuntime: string | undefined, localRuntime: string | undefined): boolean {
return azureRuntime === 'dotnet' && localRuntime === 'dotnet-isolated' ||
azureRuntime === 'dotnet-isolated' && localRuntime === 'dotnet'
}

Sidenote: FUNCTIONS_WORKER_RUNTIME in local.settings.json seems to be ignored even when the file exists; tryGetFunctionsWorkerRuntimeForProject derives the value completely independently. Is this intentional?

@nturinski nturinski added the bug label Aug 28, 2024
@MicroFish91 MicroFish91 added this to the 1.14.0 milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants