5 Azure Services to improve your ASP.NET application

Manuel Reinfurt
4 min readFeb 11, 2021
Photo by Callum Shaw on Unsplash

Want to upgrade your .NET application to the next level? Here’s 5 services that fit perfectly and offer a lot of functionality out of the box.

Azure App Service

Let’s start by hosting your application. What’s the easiest and fastest way to host your .NET application on Azure? It’s App Service. With a few clicks directly from the Azure Dashboard you can connect Azure with your repository, create a CI/CD pipeline and have it running. CI/CD can be automatically configured — you can choose between GitHub Actions or Azure DevOps Pipelines. Needless to say, you can set up your own CI/CD in any way you want.

For debugging purposes and development, you can also use plugins like the Azure App Service plugin for Visual Studio Code so you can deploy with one click directly from VS Code.

Using App Service, your application will startup as soon as a request hits it — making it work like a serverless Azure function. With the free plan, your application can only run for a few hours each day, but there’s quite cheap plans available. You can also use the same App Service Plan (how much resources you get) for multiple application that you host — so if you get an expensive service plan, all of your hosted applications will benefit.

There’s really a lot of features out of the box you can use. Here’s a short list:

  • Scale up and down: You can do it in a few clicks and have multiple instances scaling up and down as you need it.
  • Authentication: You can enable Azure AD based authorization with one click only enabling authorized user to access your application.
  • Environments: You can use deployment slots to test your application in the same environment with the same settings before you actually publish it.
  • Monitoring: Simple monitoring is built-in with the option to expand it.

There’s a few drawbacks — one example: if you want to configure your own SSL domain, you need to upgrade to a much more expensive service plan. But if you just need the domain for your frontend, there’s another service…

Azure Storage

This is just a blob storage for all of your needs. Images, videos, files of any format? Yep, store it here. It’s similar to AWS S3. There’s also a free limit, so unless you have lots of files on there or lots of traffic, you can use it for free as well.

Using the .NET library you can easily upload and retrieve files from your .NET application.

Azure Storage can also be used to host your static website or frontend as well. This makes it quite a good companion to Azure App Service. Run your .NET backend application using App Service and host your frontend using Azure Storage. Plus, you can set up a custom SSL domain for free.

Azure SQL Database

Your backend is running, raw files are stored in Azure Storage. Of course, you’ll also need a database. Azure SQL Database is an easy database as a service. You can have a small instance running for under 5€ per month which can be sufficient for development and small projects. You can always scale up with a few clicks here as well, so you don’t have to worry about performance (well, maybe you’ll need to worry about the price).

You can get the connection string directly from the Azure Dashboard and start using it within seconds in your .NET Application. If you whitelist your development IP, you can use Azure Data Studio to connect to your database directly. You can view and edit any data.

Locally, you can use a MSSQL database within Docker for no cost and test it there as well. The only difference in your environments will be in the connection string.

Azure Monitor (Application Insights)

Azure Monitor is a collection of services to monitor your application and other services running on Azure. For your .NET application specifically, Application Insights is the tool to collect information, crash reports and so on.

App Service has a nice integration with application insights. You just need to add application insights to your .NET application and your application will be monitored. You can add custom events within your code and create alerts so you are notified in case something important happens.

Once your information arrives in Application Insights, you can also connect it to other services. For example, you could create a PowerBI dashboard based on the data.

Azure Key Vault

Azure App Service already enables you to store environment variables and connection strings. These are encrypted so you have a layer of security already.

However, it is best practice to actually store these secrets using Azure Key Vault. A few benefits of doing so:

  • Store secrets in a central place
  • Manage access rights in a central place
  • Can be used as a certificate store

If you just have one application running, connection strings may be all you need. If you have multiple applications running, multiple people working on them — consider using Azure Key Vault as it will give you more structure and possibilities to manage all of your secrets.

I hope you can improve your .NET application by leveraging the Azure service above. If you have any questions, feel free to reach out to me!

--

--

Manuel Reinfurt

Freelancer for Cloud (Native) Architecture & Development (mostly Azure/C#)