DEV Community

Cover image for Azure Functions - Creating a new function
Flavio Campelo
Flavio Campelo

Posted on

Azure Functions - Creating a new function

📮 Contact 🇧🇷 🇺🇸 🇫🇷

Twitter
LinkedIn


Creating a Function App

Once you're connected on Azure Portal, you can create a new Function App.

I recommend to user Consumption plan for your new function because it's included on Microsoft's limited free services.

Using Visual Studio Code

Installing extensions on Visual Studio Code

It's recommended to install Azure Tools on your VS Code that will connect with your Azure account to make easy to interact with Azure Cloud Services

Image 1

INFO
You could install Azure Functions Core Tools

Creating a local function

So you can click on create a new function and choose some information for your new function.

Image 4

For our test we've choosen the following values:

  • Language C#
  • .NET runtime .NET 6
  • Template HTTP trigger
  • Name you can choose the name that you want
  • Namespace you can choose the namespace that you want
  • Aythorization level Anonymous
  • How do you like to open your project Add to workspace

Using Visual Studio

Creating a local function

Click on File > New > Project

Image 2

And search for Azure Functions

Image 3

Fill out all required information for your new function. For our example we'll use HTTP trigger and Anonymous authorization.

INFO
You can find more information about function triggers here and information about Authorization here.

Running the function

Now you are able to run your new function. You can hit F5 for that and you'll see some message like that

Image 5

You can open your browser and navigate to this endpoint

http://localhost:7071/api/Function1?name=Flavio
Enter fullscreen mode Exit fullscreen mode

Image 6

Source

Typos or suggestions?

If you've found a typo, a sentence that could be improved or anything else that should be updated on this blog post, you can access it through a git repository and make a pull request. If you feel comfortable with github, instead of posting a comment, please go directly to https://github.com/campelo/documentation and open a new pull request with your changes.

Top comments (0)