Skip to content

How to Publish to Azure

nairdo edited this page May 20, 2013 · 6 revisions

Here are the steps I took to get Rock running on Azure. This is not to say there is not another path, but only that this was the path I took after several other attempts.

Manual / Non-Source Control Setup

  1. Install a Windows Azure SDK
  2. Created website in Azure (website mode "free")
  3. Created SQL db in Azure
  4. Added "RockContext" to Azure website connection string.
  5. Allowed my IP to access Azure SQL via "firewall"
  6. Changed web.config connection string back to standard (not use configSource=)
    1. added Azure SQL connection string into web.config including "MultipleActiveResultSets=True;".
    2. verify providerName="System.Data.SqlClient" is still in connection string <add tag.
    3. Added <customErrors mode="Off"></customErrors>
    4. Changed key="AutoMigrateDatabase" to value="True"
  7. Added "MultipleActiveResultSets=True;" to Azure dashboard connection string as per StackOverflow.
  8. Ran update-database (locally with laptop configured to point to Azure SQL db via Rock connection string.)
  9. Download "the publish profile" from Azure
  10. Right click RockWeb, and choose "Publish Web Site"
    1. Import profile (one-time)
    2. Did not check "Execute Code First Migrations" option in setting (could not get it to work)
    3. Restart website in Azure

Second Attempt (Manual / Non-Source Control Setup)

  1. Install a Windows Azure SDK
  2. Azure -> Add new website "CUSTOM CREATE":
    1. Page 1 - Create Web Site
      1. URL: rockchms
      2. DATABASE: "Create a new SQL database"
      3. DB CONNECTION STRING NAME: "AzureConnection"
      4. Next.
    2. Page 2 - Specify database settings
      1. NAME: rockchmA8V3QtxcL (was default)
      2. SERVER: New SQL database server
      3. SERVER LOGIN NAME: RockUser
      4. SERVER LOGIN PASSWORD: ***************
      5. Complete.
  3. Azure, select website (to see dashboard)
    1. click "Download the publish profile"
    2. click CONFIGURE tab, add ";MultipleActiveResultSets=true" to connection string.
  4. VS, edit web.config
    1. add to <connectionStrings> section <add name="AzureConnection" ... with connection string from previous step.
    2. add <customErrors mode="Off"></customErrors>
    3. change key="AutoMigrateDatabase" value to "True"
  5. VS, Right click RockWeb, and choose "Publish Web Site"
    1. Import profile (one-time)
    2. Settings: check "Use this connection string at runtime..."
    3. Settings: check "Execute Code First Migrations"
    4. Publish
  6. Azure, restart website
Clone this wiki locally