Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Error when deploy to Azure #36

Open
mgwilliam opened this issue Jan 24, 2021 · 9 comments
Open

Error when deploy to Azure #36

mgwilliam opened this issue Jan 24, 2021 · 9 comments

Comments

@mgwilliam
Copy link

mgwilliam commented Jan 24, 2021

I've followed the instructions in the README to deploy to Azure (UK South)

When I run this command:

az functionapp create --resource-group my-net5funcs-rg --consumption-plan-location uksouth --runtime dotnet --functions-version 3 --name my-net5funcs-app --storage-account mynet5funcsstorage

I get this warning:

--runtime-version is not supported for --runtime dotnet. Dotnet version is determined by --functions-version. Dotnet version will be 3.1 for this function app

Undeterred, I carried on and when I run this command:

func azure functionapp publish my-net5funcs-app

I get this error:

Your app has an unknown FUNCTIONS_WORKER_RUNTIME defined 'None'. Only dotnet, node, python, powershell, custom are supported.

My local settings is identical to the one in this repo - the runtime is set to dotnet-isolated

I have this version of Azure Functions Core Tools:

Core Tools Version:       3.0.3233 Commit hash: d1772f733802122a326fa696dd4c086292ec0171
Function Runtime Version: 3.0.15193.0

Has anyone been able to deploy to Azure?

@alexanderbikk
Copy link

alexanderbikk commented Feb 15, 2021

@mgwilliam Hi I got the same issue and the following response from console

"You can pass --force to update your Azure app with 'None' as a 'FUNCTIONS_WORKER_RUNTIME'"

So just add -- force

  func azure functionapp publish my-net5funcs-app --force

Should work

Here is my response
image

But then I got error like this. And my function is not working I got 503
image

@chris-oswald
Copy link

@alexanderbikk, the instructions are pretty clear the runtime needs to be set to "dotnet-isolated". Maybe I'm missing something obvious on why it would be set to None.

@alexanderbikk
Copy link

alexanderbikk commented Feb 15, 2021

@chris-oswald Actually you are right and the runtime should be dotnet-isoleated. But why during deployment I got the error that my local runtime is set to "None"? This is the issue I believe
image

So If I use --force it allows to publish but the function will not working obviously. My bad.

@chris-oswald
Copy link

@alexanderbikk , on the local dev side you need to run "func host start --verbose". I use visual studio and the debugger doesn't work from the IDE. The command above works for me - it's in the readme docs for more details.

@alexanderbikk
Copy link

alexanderbikk commented Feb 16, 2021

@chris-oswald I don't have a problem with local deployment. I have the same issue that @mgwilliam has when deploying the function to Azure. Please check my screenshot above.

Azure Functions Core Tools

Core Tools Version:       3.0.3284 Commit hash: 98bc25e668274edd175a1647fe5a9bc4ffb6887d
Function Runtime Version: 3.0.15371.0

@alexanderbikk
Copy link

alexanderbikk commented Feb 16, 2021

Finally, I found the issue. My local.settings.json file wasn't copied to publish directory(it was only in Debug and the function worked locally).

If you getting the same issue during deployment to Azure just make sure that you always copy the local.settigs.json in the publish directory

image

image

@chris-oswald
Copy link

@alexanderbikk sorry for not paying attention. Did you get your .Net 5 app running in Azure?

@alexanderbikk
Copy link

@alexanderbikk sorry for not paying attention. Did you get your .Net 5 app running in Azure?

Just read my previous post :) I did it, just make sure that your local.settigs.json is copied to publish directory and publish to Azure will be succeeded. This was my mistake and I believe @mgwilliam got the same issue.

@MetaFight
Copy link

I think local.settings.json is deliberately ignored during deployments. You should be using host.json for your deployment config instead.

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

No branches or pull requests

4 participants