Migrating .NET app to Azure App Service (Part 1)

So now we have established what’s needed from the migration (Migrating .NET Application to Azure), to get started with migrating to Azure app service we need to determine if the application is suitable to migrate.

Azure app service is a Microsoft PaaS offering, which means you have less control over the environment than you would currently have in an on premise environment. Essentially you only manage the application and data, everything else is managed by Microsoft. So if you need to have control over more than that, then azure app service is not the option to choose. You might be used to having remote access to the machine where you would configure IIS and server settings etc. This changes with app service as there is no remote desktop access and settings (e.g default documents) are configured via the azure portal app service resource. While it might be a change from the usual unless there is a specific configuration required that cannot be achieved by this offering it shouldn’t discourage migration.

We can tell from the requirements that we do not require full control for our sample application, so this isn’t a blocker for us.

 

Reviewing the requirements we can assess if azure app service meets our needs

High availability Provided by default
Automatically scale Provided by default
Minimal maintenance overhead With App Service windows updates, patching and backups are managed by default
Low Cost Costs can be managed as scaling depends on application usage demands

So lets get started, first off we have two things we can do to establish if the application is suitable.

  1. Enter the public URL for the application into azure app service migration assistant , this will return a details report of the technologies used and determine if the app is suitable for migration to an app service.
  2. Once we have established that its suitable, then we need to review the application itself and establish is there anything we need to consider before migration. Below is a link to a very useful post listing many of these considerations.

Having reviewed the checklist in relation to our sample application, it’s apparent that without some changes to the application, we cannot migrate the application to app service. We can tell from the application analysis that as the application currently saves files locally, so development will be required before we can start the migration process.

File Persistence – Usually, websites might have a need for uploading files that need to be persisted. On Azure App Service, it is recommended to persist any files outside of the App Service into say something like a blob store. Modify the application to now use either the Azure Storage SDK or the REST APIs for saving and accessing files.

So now we have a choice:

  1. Make the necessary changes to the application, for example to store files in Azure storage instead of locally and then continue with the migration to App Service. The short demo video below walks through this option.

 

 

2. Review other options available, the next option we will review will be using Azure Scale Sets ( post available shortly !! )

 

App Service & Network Access

For this basic sample application we don’t connect to any data source, but the scenario would be where data is managed via a publicly available API, but just to touch on some alternate scenarios here, which i will go into further in later posts.

You might have an application that requires the ability to access a SQL server within your network. If the VNET resides in azure already then you can use VNET integration or additionally if the VNET is still on premise you also have the ability to use Hybrid Connections

  • https://docs.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet
  • https://azure.microsoft.com/en-au/resources/videos/azure-app-service-with-hybrid-connections-to-on-premises-resources/

There is also a scenario where you want to use app service but require isolated and secure network access or very high scale (e.g more than 20 instances), then app service might not meet the requirements and potentially Azure App Service Environment (ASE) might be a better fit. ASE is a premium service however and as such comes with a significant cost so its usage does need to be justified. Have a look at this article on Do I need to deploy an ASE?

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *