How to fix the error 'Keep alive failed' in Umbraco Cloud
We had an Umbraco cloud site which was seeing lots of errors in the logs.
We needed to stop these errors occurring. This involved creating a config transform.
In Umbraco Cloud when you want to create a Config Transform, you create a config file at the same location as the original file but you name it differently.
So with this example, we needed to change the umbracoSettings.config file, so we created one called umbracoSettings.live.xdt.config
If it was for development it would be named umbracoSettings.development.xdt.config and if it was staging.... you guessed it umbracoSettings.staging.xdt.config
I got some help from Sebastiaan Janssen on Discord to get the correct transform rule. This is what the transform file looked like:
<?xml version="1.0"?> <settings xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <keepAlive keepAlivePingUrl="https://your-website.euwest01.umbraco.io/api/keepalive/ping" xdt:Transform="SetAttributes(keepAlivePingUrl)"/> </settings>
You can also just turn off the keep alive ping if you wish, especially if you are pinging the website yourself with external tools such as Uptime Robot or Pingdom etc.
Here is the config transform for that:
<?xml version="1.0"?> <settings xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <keepAlive disableKeepAliveTask="true" xdt:Transform="SetAttributes(disableKeepAliveTask)"/> </settings>
You can't just add this file via kudu, you need to commit it to source control and deploy it out as any other file. That way MSBuild can process the config transform.
We hope you find this useful. Seb also provided a link to a great tool for testing your config transforms.
Moriyama is an Umbraco Cloud Powerhouse. If you would like us to support your website in Umbraco Cloud or elsewhere then please get in touch with us via our Contact Form.