Skip to content

C# 13 Azure Functions V4 solution utilizing an HTTP trigger to efficiently add multiple tickets to the back-end API, highlighting scalable service architecture.

Notifications You must be signed in to change notification settings

danljuarez/cSharp-Azure-Functions-AddTickets

Repository files navigation

Project C# Azure Functions V4

Author: Daniel Juarez

Project Overview

This project demonstrates a scalable Azure Functions V4 worker (.NET 9.0 Isolated) implementation, utilizing the Http trigger template to POST tickets to the RESTful Web API. Developed in Visual Studio 2022 Community Edition (v17.12.3), this project shows key features of Azure Functions, including secure authorization level to Function and integration with the external APIs.

Key Features:

  • Implements Azure Functions V4 following clean architecture principles.
  • Utilizes Dependency Injection using Microsoft.Extensions.DependencyInjection.
  • Employs Logging using Microsoft.Extensions.Logging.
  • Handles errors using exceptions types.
  • Includes OpenAPI extension (Swagger documentation) using Microsoft.Azure.WebJobs.Extensions.OpenApi.
  • Supports Unit testing using MS Unit Test and Moq.

Running the Project Locally

Note: Project Web API RESTfulNetCoreWebAPI-TicketList should be running locally before you run this Azure Function. To do so, follow these instructions.

Step 1: Run the Function API Locally

  1. Press F5 to start the project. When Functions runtime starts locally, a set of OpenAPI and Swagger endpoints are shown in the output, along with the function endpoint.

  2. Open the RenderSwaggerUI endpoint, which should look like: http://localhost:7086/api/swagger/ui. A page will be rendered, based on the OpenAPI definitions.

  3. Select POST > Try it out, enter in the JSON request body values indicated (red square), and select Execute.

Step 2: Verify the Response

  1. You'll get a response that looks like the following example:

  2. You can verify your tickets have been successfully added by looking into the running Web API RESTfulNetCoreWebAPI-TicketList Swagger UI and selecting GET /api/Tickets/getAll > and then Execute.

Deploying to Azure App Service (Function Apps)

Now that you have verified the Azure Function is running, you can begin the deployment process by following the guidelines below:

Additional Resources



Thank You.

About

C# 13 Azure Functions V4 solution utilizing an HTTP trigger to efficiently add multiple tickets to the back-end API, highlighting scalable service architecture.

Resources

Stars

Watchers

Forks

Languages