Introducing Ghost 2.x on Azure App Service

Introducing Ghost 2.x on Azure App Service

Back in October 2017, we decided to make the support for Ghost in Azure better. And it turns out many folks have been using our Ghost-Azure repository to host their blogs in Microsoft Azure. Ghost 2.0 has been released and we already have adapted it to be easily deployed Azure Web App Service.

What's new?

Find out about the awesome features coming out of the box:

Why our adaptation is being helpful?

  1. App Service on Windows offers a free plan.
  2. People already have existing App Service Plans which they want to use for hosting Ghost. In this way, they are reaching a better app density for the price they pay anyway.
  3. It's so easy to get started.

What progress did we make on our side?

Ghost 2.0 is a true one-click deployment now

Previously we forced users to execute the last steps manually but now 100% of that happens automatically - from Resource group deployment to database migrations!
Either click the blue "Deploy to Azure" button or sync your existing Azure App Service deployments via Deployment options/Deployment Center.

It's time to make a commitment

We are going to have all new releases of Ghost pushed to our repository from now on. I'm not going to write this if I haven't already implemented the Function app to do the hard work for us.

How to upgrade from v1.x to v2.x?

  1. Propagate the latest changes down to your fork. If you don't have one, just proceed to Step 2.
  2. Make sure WEBSITE_NODE_DEFAULT_VERSION=8.11.1 in your App Settings.
  3. Go to Deployment options of your Web App and hit Sync.
  4. Wait a while...
  5. Then check the logs for any errors:

App Service > Deployment Options > Deployment Details > Activity Logs

What went wrong while I was upgrading?

After I consulted the logs I found out that something was wrong with the database migrations. There was a huge block of SQL code that was failing. So I decided to download the SQLite file and check what's happening with the migrations.
I used an open source tool called DB Browser for SQLite to open that file. Opened the migrations table and saw it was stuck on the first migration coming from v1.25 - 1-update-koenig-beta-html.js. The next one needed to be 2-demo-post.js. It tries to add a demo post to your blog. I was not entirely sure why it failed but decided to skip it as I didn't really need that demo post on my blog. I inserted that record manually:
Then I uploaded the database file and initiated the deployment once again. And it worked! :)

Thanks to the Ghost team and all contributors!