Mar 14, 2019
In today’s blog I will briefly talk about some Azure services that can be very useful for building the next generation of cloud solutions. Choosing which service is best suited for your particular requirements can be a difficult decision specially because there are dozens of services in Azure that could be relevant for the scenario you are addressing.
Often a combination of different services is the best way to build a scalable, full-feature solution that minimizes cost and development time. Today we will focus on just 4 of those services and for each one we present the typical use case as a tip, followed by some additional insights.
Tip #1: With Azure Functions you pay only for the time your code runs and you can count on Azure to scale as needed. It’s the perfect solution for running small pieces of code in the cloud.
You can write just the code you need to solve the problem without worrying about the whole application and even the language you choose for the Azure function could be different from the language you are using to write the external app from where you intend to consume the function. For example, it could make a lot of sense to use Python to write a function that is implementing some complex Machine Learning algorithm and then integrate that function into a web application developed in C#. Python for Azure Functions is currently in preview. For more details see https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python
Azure Functions integrates very well with several built-in Azure services, like Azure Event Hubs, Azure Event Grid, Azure Service Bus, Azure Cosmos DB, among others. These services can trigger the execution of an Azure Function and they can provide input to the function and also consume the output of the function.
Tip #2: Use Logic Apps to automate business processes. It’s the perfect tool to build enterprise integration solutions.
- Apps helps you automate business processes as workflows. Every logic app workflow starts with a trigger, which fires when a specific event happens or when newly arrived data meets some specific criteria. The workflow can include conditional statements, switch statements, loops, branching, together with a multitude of different types of connectors that allows the logic app to communicate with a wide variety of external systems.
The following picture shows a small subset of the more than 200 connectors that are currently supported. It’s fair to say that the real power of logic apps rely on those connectors. You can integrate most of the more popular enterprise systems as part of your solution using logic app connectors.
Tip #3: Use Microservices to separate functionality into smaller services that are deployed independently.
When developing a complex application it is healthy to start by separating the functionality into smaller services. Then smaller teams, or maybe individual developers, can focus on a very specific piece of functionality that can be independently tested, versioned and deployed. Each individual microservice could be written in different programming languages and they will work together harmoniously because they adhere to well-defined interfaces and communication protocols.
This idea is certainly not new, but now we have a platform, the Azure Service Fabric, that can take care of a multitude of lower level implementation details that makes the use of microservices manageable. You can have several instances of the same microservice running simultaneously to cope with the scalability of your application (see the following picture). Those instances run on a cluster of servers in the cloud that is fully managed by Azure.
The beauty of the microservice approach is that we can rely on Azure for the extremely complex task of scaling up and down the number of instances of the microservices as required. We as developers can just focus on the functionality we need to implement and leave all the plumbing infrastructure to Azure. A complex application could have thousands of microservices running on a cluster of hundreds of servers all managed by Azure Service Fabric.
Tip #4: Containers are a lot faster to spin up and shut down than VMs. They are perfect for deployment of Microservices.
You can think of a container as a light weight VM. You can deploy different types of applications into a container and then run several containers in a VM. The applications running in the container will behave as if they had a dedicated operating system running on a dedicated hardware, but in reality all the containers are sharing the same operating system and the same hardware.
The advantage for the developers is that they can have all the necessary dependencies for the application available in the container and when they deploy the container the application is ready to run without any further set up. Containers can be uploaded to repositories and reused anywhere you need them.
Visual Studio 2017 provides out-of-the-box support for containers. Look at the following picture. When you start some new web application project you can simply opt in to deploy it into a Docker container. Once you finish the application you can publish it directly to Azure which provides you with several options to work with containers.
For an in-depth learning of the 4 Azure services we talked about in this blog and a lot more we recommend the course AZ-200 Microsoft Azure Developer Core Solutions .