Azure App Service: Custom Domain for Virtual Application

Mike-E-angelo 506 Reputation points
2022-03-16T20:15:48.857+00:00

I have the following App Services, each with their own custom domain:

domain.com
content.domain.com
commerce.domain.com
events.domain.com
support.domain.com

Each of these are on their own Azure App Service and everything works well. The problem I am encountering is during deployments and I am having to use the swap slot feature. Each swap takes 90 seconds, and I have two swaps that occur during a particular deployment that is taking a lot of time:

1 to take offline
1 to restore with new content

This is taking over 20 minutes as I also have worker processes that also need deployment/swapping.

In light of this, the idea that I have been thinking of is putting all the App Services listed above on one App Service and make use of Virtual Applications instead. That way, I would only have 1 swap in place of 5.

I have tried doing so, but it does not appear that Virtual Applications allow you to bind to custom domains. In using IIS back in the day, I would usually create a virtual application and bind a domain name to it, but that does not seem possible with App Service. Or at least, not that I can find, so I am posting here to see if there's something obvious I am overlooking.

Is this possible? Can I have my domains above on one App Service and map to their respective Virtual Applications? If so, how?

Thank you for any assistance you can provide.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,807 questions
{count} votes

Accepted answer
  1. Ryan Hill 28,286 Reputation points Microsoft Employee
    2022-03-30T19:27:04.14+00:00

    Apologies for the delayed response @Mike-E-angelo . As you've discovered, virtual applications can't be bound to a custom domain. Reason being is because the domain is bound to the worker instance that your app service is running on.

    Over 90 seconds taken for the swap is definitely something to look into. The operation is pretty straightforward;

    • apply applicable settings
    • warm-up the slot with HTTP requests
    • switch routing after 200

    Some things that could impact startup is the usage local cache or a lengthy application startup. The use of local cache will initialize an additional restart after the local cache on the staging slot but as long as you're following best practices that should be fine.

    So, a couple of follow up questions:

    • If you swap from within the portal, does it take longer than 90 seconds?
    • Did you customize WEBSITE_SWAP_WARMUP_PING_PATH or WEBSITE_SWAP_WARMUP_PING_STATUSES

    To troubleshoot, check your logs at D:\home\LogFiles\eventlog.xml for any timeouts or routes that may not be returning success codes. If you are using local cache, do you get the same result if you swap without local cache? If not, you may need to rethink your cache strategy.


0 additional answers

Sort by: Most helpful

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.