Rearchitecting multiple app copies with different hostnames

Steve Wardell 21 Reputation points
2021-05-26T19:53:50.633+00:00

I'm trying to figure out how to migrate an existing ASP.Net application. The application is currently architected on VMs with separate IIS websites per hostname to a single IP. While each IIS site has the same application, it has:

  • Application variables specific to that site - Maybe App Configuration - but can I get a different app configuration used depending on which hostname the request comes from?
  • Session variables - Assume use Azure Cache for Redis | Microsoft Azure ?
  • Database schema - Less a concern I think - config for which schema coming from app variable solution above?
  • Few custom image files - could be from app variables with unique name on static content host perhaps?

Depending on the hostname, it would fit into one of 3 groups and have different content:

  • Active hostname - get the site
  • Previously active hostname - get a certain static site
  • Other - other than say www - give a different static page (This third category is not a requirement to handle)

Also, does the App Gateway wildcard (Preview) need to be used for this? Just trying to flesh out some possibilities and approaches.

Steve

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
251 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
824 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,106 Reputation points Microsoft Employee
    2021-06-01T18:19:29.543+00:00

    Hi @Steve Wardell ,

    I think an App Gateway would be the way to go for your scenario. There's a tutorial that walks you through not only using VMs but also App Services. The AppGw would be you single IP address that can route traffic to the specific site based on URL matching to certain pool. Since your site is already hosted on IIS, then you can crate VHDs of your on-prem machines and upload them to Azure. This will work great for customized software or elaborate processes that beyond the scope of app service functionality. If your ASP.NET sites are relatively straight forward, then you can easily deploy your code to an app service and assign them to a pool.

    With regards to using Azure Cache for Redis, I would have a look at this doc, to see how best to implement across your solution. You can also utilize feature flags that match pool name (or some other value) to retrieve different values to result in different behaviors.

    If you have any further questions, please feel free comment down below.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.