I have a local website running in IIS 10 and targeting an Azure SQL database. A copy of this website runs in Azure and looks into the same DB. Both websites work over HTTPS. I'm testing scheduled document publication, but it works only under certain conditions.
First I had this problem in the local website. Documents with Publish At configured didn't get published at all, with no errors in the logs. After some digging I figured out I didn't enable the umbracoUseSSL setting, so I turned it on. After that Umbraco started to complain that it cannot make request to itself due to the invalid certificate (a self-signed testing one). I fixed that by added this code to the application startup routine:
This did help, and locally Umbraco began to publish scheduled documents correctly.
In Azure, however, the same web app doesn't do that. The app is "Always Run" in Azure, so I believe its internal worker threads (if there are any) should keep running. I even tried to put the Azure website Umbraco url into the scheduledTasks@baseUrl parameter of the local instance, and it worked (!). The local website began to publish documents by making requests to the Azure instance (at least I believe so). Still the Azure instance alone doesn't publish anything, regardless of whether this setting is configured or not.
I don't think this setting makes any change in Azure, because according to the logs the Azure website detects its url correctly anyway. The certificate there is a real one, so shouldn't be a problem too...
This already turns into a little nightmare to me, please help! Umbraco version is 7.4.2.
Ok I think I've solved this. The cause of the problem lied in Umbraco's built-in load-balancing and the fact that I had both local and remote apps looking at the same DB.
Umbraco scheduled tasks run only on master servers (at least some built-in ones). When a server starts, it registers itself in Umbraco db (table called "umbracoServer"), where you can see which server is currently active (i.e. "alive"?) and which is a master. Turned out my local server became master and for whatever reasons wasn't giving that status to the Azure instance, even after being completely shut down (meaning website and pool stopped in local IIS).
After I had cleared the db table contents, Azure instance became master and began publishing attempts, but failed because of another problem - it had detected its URL as https://localhost/umbraco and so couldn't connect to itself from within Azure because of some socket access rights (saw it in the logs, don't quite remember the actual error). I had to manually specify umbracoApplicationUrl config setting and now it works.
Publish At not working in Azure
Hi,
I have a local website running in IIS 10 and targeting an Azure SQL database. A copy of this website runs in Azure and looks into the same DB. Both websites work over HTTPS. I'm testing scheduled document publication, but it works only under certain conditions.
First I had this problem in the local website. Documents with Publish At configured didn't get published at all, with no errors in the logs. After some digging I figured out I didn't enable the umbracoUseSSL setting, so I turned it on. After that Umbraco started to complain that it cannot make request to itself due to the invalid certificate (a self-signed testing one). I fixed that by added this code to the application startup routine:
This did help, and locally Umbraco began to publish scheduled documents correctly.
In Azure, however, the same web app doesn't do that. The app is "Always Run" in Azure, so I believe its internal worker threads (if there are any) should keep running. I even tried to put the Azure website Umbraco url into the scheduledTasks@baseUrl parameter of the local instance, and it worked (!). The local website began to publish documents by making requests to the Azure instance (at least I believe so). Still the Azure instance alone doesn't publish anything, regardless of whether this setting is configured or not. I don't think this setting makes any change in Azure, because according to the logs the Azure website detects its url correctly anyway. The certificate there is a real one, so shouldn't be a problem too...
This already turns into a little nightmare to me, please help! Umbraco version is 7.4.2.
Ok I think I've solved this. The cause of the problem lied in Umbraco's built-in load-balancing and the fact that I had both local and remote apps looking at the same DB.
Umbraco scheduled tasks run only on master servers (at least some built-in ones). When a server starts, it registers itself in Umbraco db (table called "umbracoServer"), where you can see which server is currently active (i.e. "alive"?) and which is a master. Turned out my local server became master and for whatever reasons wasn't giving that status to the Azure instance, even after being completely shut down (meaning website and pool stopped in local IIS).
After I had cleared the db table contents, Azure instance became master and began publishing attempts, but failed because of another problem - it had detected its URL as https://localhost/umbraco and so couldn't connect to itself from within Azure because of some socket access rights (saw it in the logs, don't quite remember the actual error). I had to manually specify umbracoApplicationUrl config setting and now it works.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.