Hosting Agility Websites on Azure App Service

Follow

We are happy to announce that we officially support hosting your Agility Website on Azure App Service. Azure App Service is Paas (Platform-as-a-Service) offering from Azure and allows you to quickly build, manage, and scale web apps. Internally, we've switched to App Service and it has tremendously increased our ability to manage our environments.

Why use App Services vs Traditional VMs?

Whether you are hosting yourself, or through Agility, App Services are a perfect fit for Agility websites. Think of App Services as IIS in the cloud. This means that security, load balancing, OS maintenance, and more are handled by Microsoft. Being a true cloud solution (just like Agility), it is fully managed. They are constantly making updates, patches, and enhancements to the service without you having to worry or lift a finger.

Traditional VMs require the entire server OS to be maintained, which can be a headache (think BSOD and conflicting windows updates). App Service OS's are completely abstracted away and are updates are tested and deployed by the Microsoft Azure engineering team. Another drawback for VMs, is that for them to work with Agility websites they must be fully stateful (to retain the synced content files). Each VM needs to be kept in sync to ensure they have the same application code deployed as well as the same content files. For scaling, this also means that adding additional servers is a manual process where either VHDs are copied or a provisioning script is run. App Service solves this problem by using shared disks so that your application code and agility content files are always the same no matter how many instances you have.

App Service:

  • Fully managed platform
  • Advanced deployment pipelines
  • Fix issues in production faster by live debugging
  • Find issues in production before deploying to production (using pre-production slots)
  • Easily manage offline jobs
  • Flexible and easy scaling
  • More secure
  • Built-in DDoS layer
  • Sync less - using a single syncing web server
  • Does not support some legacy systems (i.e. Windows Services or other desktop applications)

Virtual Machines:

  • Custom deployment process
  • Self-managed platform
  • Supports legacy systems (Windows Services and desktop applications)
  • The filesystem must be kept in sync between servers in a web farm
  • Scaling is manual

Ready to use App Service? 

Requirements

  1. An Azure App Service provided by Agility or your own Azure Subscription (external hosting)
  2. Updated Agility.Web (> 5.0.1512.1). You can use NuGet to get the latest release using: Install-Package Agility.Web
  3. Update any app-specific filesystem references to use “D:\Home\{custom path}” – this is the directory you can write/read from
  4. Update specific Agility.Web filesystem paths in the web.config:
    1. Set the contentCacheFilePath=”D:\Home\AgilityContent\” in the agility.web section settings
    2. Set the logFilePath=”D:\Home\AgilityLogs\{website}.log” in the agility.web section trace settings

General Setup 

  1. Provision the App Service Plan/ App Service Environment in Azure
  2. Determine an appropriate performance tier and amount of instances - any amount of instances are supported
  3. Provision the App Service for the required web app
  4. Set any specific application settings within the Azure App Service
  5. Generally, it is a good idea to disable Server Affinity if your application is stateless
  6. Deploy your web app - see Requirements
  7. Add your App Service URL to Agility as a syncing web server
  8. Ensure the app service has synced
  9. Repeat steps 3-8 for any additional environments such as UAT

How to Deploy to App Service?

You can deploy to Azure App Service by importing a publish profile provided into your Visual Studio project and deploy right from Visual Studio using Web Deploy. If you really want to take advantage, you can implement your own Continuous Integration/Deployment.

 

How to Add a Syncing Web Server?

You only need to add a single syncing web server regardless of how many instances are running. A sample Syncing Web Server may look like http://{app-service-name}.azurewebsites.net. When content is syncing, a sync request will be sent directly to the load balanced address and the instance that receives this request will handle the sync and update a filesytem that ALL instances share. No need for any robo-copy or other proprietary solutions. This is all handled natively!

You can add Syncing Web Servers by navigating in AgilityCMS to Settings > Site Configuration > Syncing Web Servers.

How to: Add a Syncing Web Server

 

How to check the Web Logs?

You can check your site Web Logs just like you normally do. Since the storage account is shared amongst all instances, your log now contains all logs from all of your instances!

 

1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.