Creating an API using Azure Functions

Cheranga Hatangala
Cheranga
Published in
2 min readApr 9, 2019

In this series of articles I will explain how to implement an API using Azure functions. This was inspired mainly from Mark Heath, Jason Roberts and from Jeff Holan’s and a few other excellent developer articles about Azure functions and, thought of implementing one by my self and writing about it!

Azure Functions

We will consider handling customers in a fictitious bank called “Funky Bank”. The API will allow to create, update, delete and view customers in the bank.

TLDR — Source code is available in GitHub

I didn’t want this to be yet another CRUD based API , but how to use a serverless technology and also to address some practical real world experiences which we all developers need to handle. Some of them would be,

  • Follow proper design practices and guidelines! (this is a given!!)
  • At least in my case most of the companies which I have worked were using SQL server. So I am using an SQL database in here.
  • Need to handle how database migrations are handled when the project progresses. I would like this to be a part of the solution itself and want it to be source controlled.
  • Creating tests (unit or integration or ideally both).
  • Storing sensitive information such as connection strings in a secure manner.
  • Proper CI/CD pipelines to minimize manual intervention.

This article series will cover each and every mentioned above to the best of my knowledge and I am more than happy to get your feedback.

I’ll be using these technologies and tools mentioned below when implementing the solution,

  • Using .NET Core 2.1 and VS 2017
  • Using Azure functions and it will be deployed as an Azure function app service in the portal.
  • Azure DevOps for CI/CD.
  • SQL Server for database.
  • Dapper as ORM in the data access implementation.
  • DbUp to be used when performing database migrations.
  • Azure Key Vault (AKV) to store sensitive data such as connection strings.
  • The source code will be available in GitHub.

The articles of this series are as follows,

Alright, let’s get started. Please read the next article where we set up all the Azure resources which we need in the portal.

Thanks!

--

--