I have queueTrigger azure functions. I am receiving warning about function runtime version update. To update runtime version, I have followed some steps like I update value of "FUNCTIONS_EXTENSION_VERSION" key to "~4" and check "Function runtime settings" tab where Runtime version showing as custom(~4)
Also I update versions inside setting.json file of function application and update "extensionBundle" version values in host.json file
After updating those files, I update function by docker deployment. But it still showing me warning about runtime version update.
I had updated runtime version of another function app which has httpTrigger trigger functions.
As you can also there is some UI difference also between Function runtime settings tabs of both function applications (In 1st Runtime version is with custom string and in 2nd it without that string). In this queueTrigger function app its not updating runtime version as it still showing warning. Is it something which I doing wrong? How can I update it then? Can someone help me regarding this?
Deployed the Python Versioned 3.6 Azure Function Version 3 basic Http Trigger using VS Code:
This is my settings.json of the above project:
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.scmDoBuildDuringDeployment": true,
"azureFunctions.pythonVenv": ".venv",
"azureFunctions.projectLanguage": "Python",
"azureFunctions.projectRuntime": "~3",
"debug.internalConsoleOptions": "neverOpen"
}
According to MSFT Doc of Azure Functions Version & Python Compatibility, Python 3.6 Version is compatible to AFCT (Azure Functions Core Tools) Version 3 only.
Upgrade Process:
In Azure Portal Function app > Configuration > Function Runtime Settings > Runtime version set 3 to 4.
You have to upgrade the Python Version in Local Project along with code changes that are compatible to AFCT Version 4 and Python Versions (>3.7).
This MS Doc of Upgrading Python AF Local Project clearly explains what has to updated before upgrading to the AFCT Version 4.
Note: AF - Azure Function, AFCT - Azure Functions Core Tools
I fixed this issue by making change in Dockerfile. Previously I was pulling "mcr.microsoft.com/azure-functions/python:3.0-python3.8" docker image. I have changed this image to "mcr.microsoft.com/azure-functions/python:4-python3.8" which fix this issue.
Related
So, I've inherited an Azure Function App written in Node.js from a contractor who did a little work for us. This piece of code was developed outside our C# stack, so I'm having to go back and maintain it.
I'm trying to update the Azure Function Extensions runtime for the project in Visual Studio Code, however it seems to be ignoring the local.settings.json for my development environment, and no matter which flags I set, it continues to run the 2.x runtime.
And when it runs, I'm seeing the following errors:
However the documentation they're referencing has zero information about migrating from 2.x to 3.x other than that it 'will be seemless in most cases'.
And of course, the function app won't run:
The problem ended up being the version of the core tools running on my development VM.
As per the documentation here, the core tools version needs to be installed (x64 version for VS Code).
In spite of the fact that I setup this Dev VM yesterday, it still needed to have the core tools version updated to the latest. Once I updated it, it was able to spin up the function locally as expected.
I am required to write an Azure Function, with HTTP triggers. My problem is, when I choose Azure Functions template in Visual Studio 2017, it just creates an empty project with two files, host.json and local.setting.json, which makes me believe that I have version 2 of the Azure Functions installed.
When I try and compile this version of the Azure Functions I have installed, I get a message saying that I need .Net Frameworik 4.7.2 installed, and I cannot install this framework version on my Windows 10 version.
How can I downgrade or install the Azure Functions version 1?
My Environment:
Windows 10 (Build 10240)
Visual Studio 2017 Professional (version 15.5.4)
Any help?
I recommend you to update your Visual Studio 2017 to 15.8.1 if possible.
15.5.4 seems too old and doesn't work with latest Azure Functions and Web Jobs Tools.
Many templates support in latest Azure function extension.
While you are creating a new Azure Functions project in Visual Studio, you get asked which version (v1 or v2) you want. The structure of the project (the two files you mention) are the same for both versions.
The difference is that v1 is targeting full .NET Framework 4.6+, while v2 is targeting .NET Standard 2.x.
I've just tried with VS 15.8 and v1 project template is targeting 4.6.1 by default, so this version should be enough.
You can try to create function app from command line using func command. To install CLI I recommend use of chocolatey and simply type choco install azure-functions-core-tools.
After Updating VS 2017 version to 15.8.2 and web jobs tools to version 10. I am facing this issue.
the same solution is working in other workstations with the same visual studio version
It is a sample service bus trigger function and queue name and connection string properly
run func extensions install on terminal if getting error locally, it works for me
One thing that solved this issue for me recently was to update the extensions file to the newest "Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version.
You can find the newest versions here:
https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ServiceBus/
If possible please have a try to update the azure functions and webjob tools to latest version.
I test it with Azure function(v2) servicebus via default servicebus trigger template, it works correctly on my side. My VS version is 15.8.4
We have been using Azure Function runtime version as "beta" and Microsoft.Azure.WebJobs.Extensions.EventHubs - version 3.0.0-beta5 package to bind with Eventhubs.
Things broke down completely after azure portal started prompting for Upgrading to version 2 for Azure Functions. With or without changing the runtime to ~2 (or any specific 2.x.x.x version) it is failing.
Can someone make it clear on what needs to change if we want to target version 2? I tried to upgrade Microsoft.NET.Sdk.Functions to latest 1.0.19 and Microsoft.Azure.WebJobs.Extensions.EventHubs to latest 3.0.0-beta8. All I get is assembly loader errors!
Please help!
You can find the description of this breaking change and recommended steps in this issue.
When I try to set Azure Functions to stable versions 1.0.14 or 1.0.13 locally & in the Portal - I tend to receive a 500 error when trying to GET an endpoint. Through some debugging, I managed to correct this by changing the version to beta. No errors.
Has anyone else seen this issue? Is there any way around this without actually having to recreate the function using the desired version?
Thank you!
You probably mistake Azuer Function SDK version for Azure Function Runtime version.
try to set Azure Functions to stable versions 1.0.14 or 1.0.13 locally & in the Portal
1.0.14 or 1.0.13 you mentioned is SDK version(latest is 1.0.19 right now), which is used to build our function project. Of course we can't set SDK version on portal as build is done before we publish pre-compiled code to Azure. If we develop in browser, the build process and SDK version(the latest) is under the control of Azure.
I managed to correct this by changing the version to beta. No errors.
You may have created a v2 function locally, hence function depends on beta runtime. And you specify a wrong version of 1.x like 1.0.14, so 1.0.11959 is used. We can see 500 error is caused by mismatched runtime and you have corrected it. If you have planned to work with v2 function(.net standard), nothing malfunctions so far.
And some more info about function runtime version.
Function Runtime version
There are two major versions: 1.x for .Net Framework and 2.x for .Net Standard.
Syntax
Major version :~1 for 1.x , ~2 for 2.x. With this format, function app on Azure is automatically updated to new minor versions of the runtime when they become available.
Minor version 1.x:1.0.11959; 2.x: 2.0.11961-alpha, 2.0.12050-alpha. (All versions available right now). Function app on Azure is kept on that version until we explicitly change it.
Where to find
Runtime version in Function app settings.
FUNCTIONS_EXTENSION_VERSION in Application settings.
Configuration
Two scenarios we need to change runtime.
Major version change. ~1 to ~2 or reverse.
We may see prompt below if there are functions in the app.
Major version upgrades can introduce breaking changes to languages and bindings. When upgrading major versions of the runtime, consider creating a new function app and migrate your functions to this new app.
In an empty function app(delete existing functions or create new app), change runtime in Function app settings.
We can directly set FUNCTIONS_EXTENSION_VERSION in Application settings if published project depends on another runtime.
Minor version pinned to avoid breaking changes(probably the last time to use as 2.x is planned to be GA by this fall).
See breaking changes in 2.0.12050-alpha(beta), we can pin FUNCTIONS_EXTENSION_VERSION to 2.0.11961-alpha and follow steps to work with changes and move to beta.
Find more breaking changes to fix if our 2.x function runtime is pinned to some older version, which have all been removed on Azure.
Wrong version handler
If we specify a wrong version of 1.x like 1.0.14, Azure will leverage latest minor version instead. It is same with 2.x.
For local dev
Commonly speaking, local dev doesn't need runtime configuration because we choose Cli first(using tools like npm or VS does in background), we are clear about the major version at least.
Some local places to find function runtime version.
VS, New Function project v1 or v2.
VS/VSCode c# function, in functionappname.csproj, see <AzureFunctionsVersion>v2</AzureFunctionsVersion>.
VSCode, functionapp/.vscode/setting.json, see "azureFunctions.projectRuntime": "~2"
Function core tools(Cli), run func, we may see Function Runtime Version:2.0.12050.0
Start a function app in VS/VSCode/Cli, besides 4, we can also see Cli output Starting Host (HostId=xx, InstanceId=xx, Version=2.0.12050.0, ..)
Very useful information, thank you Jerry! I managed to solve my issue by recreating the Azure function without using .NET Standard. Azure lets you know that changing certain settings may lead to the function not working properly. After recreating with the proper runtime set in both portal and project, it worked.