API Part 2 – Creating An Azure Function

This is part 2 in our series on .NET APIs with C# – Functions. Find Part 1 here.

In this part we’ll talk about how you build an Azure Function. Functions are another way of interacting with an API. Here we’ll briefly discuss how you can get started with them.

  • Name your function, choose a location and click Next
  • Select your runtime and hosting. Generally speaking, choose the latest LTS (Long Term Support) option
  • Under authorization, choose Anonymous
  • Under Function, select Http trigger
  • Check Use Azurite (we’ll need this in a future post about durable functions)
  • Click next and hey presto! your solution is created.

You should now have a solution with a Function. Right click on the project and select AddNew Azure Function. Now click Add and you will see a list of triggers. For this discussion, select Http Trigger.

 

Note, this material is based on our book Programming APIs with C# and .NET from Packt.

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET will be released early in 2025. Liberty is a Senior SW Engineer for CNH and he was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Microsoft MVP.
This entry was posted in API, APIs, Essentials, Mini-Tutorial and tagged . Bookmark the permalink.