We're extremely excited to announce you can now develop and publish Azure Functions built on top of the .NET Core 3 runtime. We announced a few weeks back our roadmap and timeline for functions built on this new version, and now is your chance to try it out during our official preview.
Azure Functions 3.0 is now in preview and is a highly backwards compatible release. There are a few known issues in the preview (called out in this blog), but the immediate benefit is you can write projects targeting
netcoreapp3.0. You should also be able to move existing ~2 apps to ~3 preview without issue, though remember it is in preview 😁.
⚠ While you can deploy these functions in any region, at this point of the preview only West US has some optimizations for cold start. Other regions will work but may have longer than usual cold start delays ⚠
npm install -g azure-functions-core-tools@preview
brew tap azure/functions brew install azure-functions-core-tools-v3-preview # If you already have func installed brew link --overwrite azure-functions-core-tools-v3-preview
You have a few options here. You could create a new project using our Visual Studio, Visual Studio Code, or CLI tools. For other tools, once you install the preview core tools you should be set. If attempting to target .NET Core 3 just be sure to update your .csproj file template with
netcoreapp3.0. If editing a .NET function outside of Visual Studio, be sure your
Microsoft.NET.Sdk.Functions version is at least
If you want to develop using .NET Core 3.0, you must use Visual Studio 2019 Preview 3 or 4 (previously you could use other versions, but as of Nov 11 it must be Preview 3 or 4). To use the 3.0 preview in Visual Studio, make the following changes:
- Set an environment variable for
1. This will enable Visual Studio to pull the pre-release templates and versions.
- Open Visual Studio and select to create a new Azure Functions project
- You should see an indicator at the bottom as it downloads the runtime and templates of "Making sure all templates are up to date." This could take a few minutes, but wait for it to finish.
- Once the templates are up to date, go back one screen and forward so template options are refreshed.
- Select the now available "Azure Functions v3 Preview" option from the template drop-down.
- Create your project.
- If you want to target .NET Core 3, edit the project properties and select .NET Core 3.0.
You should be set! You can now debug, test, and publish this function.
You can publish your function using the regular tools. Either before or after publishing your app, to have to run on Functions 3.0 preview you will need to update the version from
~3. To do this, open the Configuration section and update the
~3. Visual Studio will do this for you if you followed the steps above.
If you have an existing app and want to test it out with the new preview release, the following settings would need to be modified:
Locally once you start using the preview CLI your apps will debug and run in the 3.0 environment automatically. For apps in the cloud, you simply need to update the app version as shown in the above section.
If using Visual Studio, make sure you've already followed all of the steps in the "Creating with Visual Studio 2019" section to ensure you have the latest templates and project options available before attempting to upgrade.
To change a project between ~2 and ~3 locally, update the
.csproj file of the project and change:
Microsoft.NET.Sdk.Functionspackage version to at least
- Optionally, you can change to target
netcoreapp3.0if you want to target the latest .NET Core version
You should not change the
host.json version to
host.json schema version is different than the function runtime version.
The main limitation at this point in the preview is that proxies aren't yet supported in
~3. If your app requires the use of proxies, you will need to remain at
~2 at this time.
If targeting a Linux operating system, South East Asia is the only region with these new bits until later next week.
If you hit any issues, please file an issue on https://github.com/azure/azure-functions-host