How to setup license for Episerver hosted in Azure
This article describes how to setup and activate the license for Episerver running on a Microsoft Azure web app.
Episerver Cloud license
Episerver running in an Azure web app will require a cloud license. The cloud license works differently than an ordinary license as it is not bound to MAC or IP. Instead the site “calls home” upon activation to register the server. (The server concept in this case is synonymous with a web app instance). As before, the license limits the number of sites and servers (instances) that can be run under that license.
Setup and activation
Let’s assume you have Episerver running in two environments, test and production. The same license file (license.config) should be used and deployed to both environments.
To avoid license error it’s important that you enter the same URL in both the test and production environment. The URL is found in Admin mode > Config > Manage websites > Web sites. (See screen dump below).
Now it´s time to activate the license. Navigate to admin mode > Config > Manage websites > Cloud license. Activate the license in both test and production with the activate button. (See screen dump below). The servers (azure instances) are counted towards the total number, limited by the license.
You should not activate the other host names, only the one listed that is the same as the main URL.
Since the cloud license is a floating license, you can deactivate instances and activate others as you see fit, as long as you do not exceed the total number of instances allowed by your license. For an example, if you have 3 instances for your production environment, 2 for pre-production and one for test, you can deactivate all non-production instances and use 6 instances in production in case you need to handle an increased amount of traffic for a period.
Instance for production for instance: is that app service scale out? where I 'm able to configure to run more than one instance simultaneously? Or that is something else?
Yes, that's it exactly. If you set your web app to scale to 3 instances, you need to have 3 servers available in the license (in addition to any test and pre-prod instances you currently use.)
I have been using these kind of License for a while now and I have two problems with them that I am wondering if you know how to solve.
1: When using it on Azure and I scale out it adds servers ok, but when I scale down it does not remove servers so the next time I need to scale out (or use them on pre-prod) they are reported as new servers. So since it has an "Phone home" function, it should also be able to deactivate servers/instances automatily.
2: I am often updating my dev environment with database from production and when I am using these kind of licenses on development after an DB restore it says that I do not have an active license but when I go in to the web interface it says I have an active license for that domain so I need to deactivate and then activate it again manually and that is not good. All other stuff like updating the host-settings I do bu sql script but I have not found any way to do this by code or SQL. Are there any way to automate it since Backstaging should always be done by code to be efficient.
What's your take on Azure Web App deployment slots with auto swap, from license point of view?
I mean the process where the a new version of the app is first deployed to the Web app deployment slot, and then warmed up automatically by Azure. After the warm up is complete, a hot swap (auto swap feature) is done by Azure. We use this process to prevent cold starts on the new app version. The whole process takes less than a minute in Azure.
If we have one license for production, can we use these Azure web app deployment slots with auto swap feature, or are they prohibited by the license? How about technically? Does the deployment slot version of the app start, if the old production version (that is about to shutdown in a few seconds) is still running?
Sorry for embarrassingly slow response...
@henrik:
1) There was a bug in the admin mode UI that showed all servers (even old inactive servers) which led you to believe that those were counted towards the license. This bug was only affecting the UI. There have never been a situation were inactive instances are counted towards the total number of servers. (This bug was fixed many months ago).
2) Assuming you are switching to a dev license here, that is why it requires re-activation in the database (since the database is activated on the prod license). No good answer here on how to do this in a smoother way. Did you find an solution yet?
@tommi:
You could use the name instances interchangeably with servers since it is the same thing when it comes to these type of licenses. It is just a floating server license.
I have a question with this point
"To avoid license error it’s important that you enter the same URL in both the test and production environment"
How can the URLs be the same between test and prod? Is there an alternative where the URLs can be different and still we can use the same license config
"Enter the same URL" means entering the URL under General section. You still need to enter the spesific url under "Host names" for test and production respectivly.
Please aslo see the offical documentation on this topic here: http://world.episerver.com/documentation/developer-guides/CMS/Deployment/managing-cloud-licenses/
"Enter the same URL" is not a good solution since that URL is used in all kind of places so there is a very big risk that editors or users ends up on production instead of test when having the production URL there on the test environement.
This need to be fixed with a version that maps to the old licenses where you had the possibility to have a test and a prod if you had two servers license.
So you need to bring out a license that is:
Two sites on one Server (per site)
After E-mailing a bit with Episerver I got some further clarity. To avoid the issue where the editor end up on production instead of test it is important to set the test-url as Primary under Host Names. Then this seems to work correctly.
If you then need to get an absolute url I think you should use the following approach:
http://dodavinkeln.se/post/how-to-get-the-external-url-to-content
Which takes "Primary" into account. (Havn't tried it myself)
The dodavinkeln.se site no longer exists, but one can find the blog post here:
https://web.archive.org/web/20190906233420/http://dodavinkeln.se/post/how-to-get-the-external-url-to-content
The dodavinkeln.se site no longer exists, but one can find the blog post here:
https://web.archive.org/web/20190906233420/http://dodavinkeln.se/post/how-to-get-the-external-url-to-content