Azure Functions C#

An Azure Function is a way to create a function that can run in the cloud and can handle/respond to different events that can happen in Azure. For example,  something was changed in a BLOB.

The developper doesn’t need to care about Virtual Machines or any infrastructure. You create the function, you deploy and you run it.

Azure Functions allows the developer to create serverless applications.

Azure Functions support triggers which is a way to start the execution of the code.

What can you do with Azure Functions?

  • building APIs and microservices
  • working with internet of things
  • task to run on a schedule (image/order processing, file maintenance)

Azure multi-region deployments

The customers demand the highest performance in availability and their expectation is that the application will run even if even a data center may be down.

We can deploy publish the application into a second region that can be even on another continent.

Azure Traffic Manager will route clients to the one of the region where we deployed. It can be configured:

  • to route the clients to the lowest latency region for that specific customer
  • use geographic routing, for example, a customer from Europe will use a data center from Europe.
  • add a standby region –  route clients to the standby region where it is something wrong with the primary region.

Geo-replication for our data – Azure SQL and Document DB replicate data around the world. For example, you can have a primary database in the first region and a secondary database in the second region. All the operations committed to the primary database will be replicated (asynchronously) to the second database.

Web application + App Service

When an Web application or an API needs to be published to Azure => App Service – Platform as a Service – no need to take care of the virtual machine or the OS. The deployments will be nearly instantaneous because all the infrastructure is already in the place so we can publish directly from the source code.

An App Service plan can be used to scale vertically to add/remove cores or to scale horizontally to add/remove instances. Or use auto-scale.

Use diagnostic tools, metrics tools, debugging tools (even a remote debug session and step through code running inside an App Service) instead of connecting remotely and inspect the environment.

Deployment slots associated with an app service (Staging, QA, Production).

Storage account (BLOB Storage) – store log and diagnostic files, user uploads, application static content (images, videos, script and CSS files) – this way the content will be pushed into Azure Content Delivery Network

Database – Azure SQL (relational model) or Document DB (storing documents) or both. The details (patches, logs)  are handled by Azure (database as a service).

To talk about – Azure Resource Group – encapsulates all these resources (App Service, App Service Plan, Storage Account, Azure SQL) – a logical container for resources – grouping all the application resources into a single group will make it easier to manage the Azure services.