Image of sample C# code

New Year -> New Blog -> From Office 365 to an Azure WordPress site

If the new year is meant to bring renewal in all things, then my blog will be first (or possibly third, considering I didn’t get to it until the 3rd of the month) on the list of renewed life and expectations.

I had been playing around with different aspects of Azure websites and ran across the Azure WordPress template.  Although I spun it up over a year ago, life (2nd child, moving residences and work responsibility) intervened and I was unable to get my blog kicked off as I had hoped. Enter 2015!

Although I have not been a prolific blogger by any stretch of the imagination, I had some posts within my SharePoint Office 365 website and didn’t want to just start over.  I came across a recent blog post by René Hézser where he posts about migrating a SharePoint blog to WordPress and provides an entire windows application and source code.  I had to try out the code and see if it could give me the shortcut I was hoping to find.

What I discovered was that his code uses the lists.asmx web service on the SharePoint side and was designed to use credentials for an on-premises SharePoint blog.  With a little bit of fiddling with the code using techniques found on Tomasz Rabiński’s blog, I was able to just swap out the authentication credentials and leave the rest of the code intact.

Steps Taken:

  1. Add reference to Microsoft.SharePoint.Client.RunTime
  2. Modify the Connect() method to use SharePoint online credentials

After this, I was able to just do the migration with the authentication working like a charm.  A nice beginning to a new year!

Leave a Reply