Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 17, 2019 08:15 pm GMT

Develop Azure Functions using .NET Core 3.0

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.

Things to know

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 .

You can use this preview for any other languages as well (Python, PowerShell, Java, JavaScript, TypeScript), but the development surface would remain the same.

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

Getting started

Install the .NET Core 3.0 SDK

Install the preview core tools (optional for Visual Studio development)

Using npm:

npm install -g azure-functions-core-tools@preview

Create an Azure Functions project

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 1.0.30-beta2.

Creating with Visual Studio 2019

If you want to develop using .NET Core 3.0, you must use Visual Studio 2019. To use the 3.0 preview in Visual Studio, make the following changes:

  1. Set an environment variable for AzureFunctionsHiddenTagsVisible to 1. This will enable Visual Studio to pull the pre-release templates and versions.
  2. 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.
  3. Once the templates are up to date, go back one screen and forward so template options are refreshed.
  4. Select the now available "Azure Functions v3 Preview" option from the template drop-down.
  5. Create your project.
  6. 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.

Publish your Function App

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 ~2 to ~3. To do this, open the Configuration section and update the FUNCTIONS_EXTENSION_VERSION to ~3. Visual Studio will do this for you if you followed the steps above.

Functions version

Known Issues

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.


Original Link: https://dev.to/azure/develop-azure-functions-using-net-core-3-0-gcm

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To