Skip to content

WebJob Sample

cdmdotnet edited this page Jul 24, 2017 · 9 revisions

Your Azure micro-service application

Congratulations! You've created a project. You can launch and publish your app once you've configured it using the instructions below.

CONFIGURE YOUR APP

  1. Create a new Azure SQL Database:
    1. Run SQL scripts:
      1. \MicroServices\tools\ConversationSummary.sql
      2. \MicroServices\tools\Credentials.sql
      3. \MicroServices\tools\Messages.sql
      4. \MicroServices\tools\Users.sql
    2. Run CQRS SQL scripts:
      1. \MicroServices\tools\Create-Log-Table.sql
      2. \MicroServices\tools\EventStoreTable-SqlServer.sql
  2. Create an new instance of Azure Service Bus
  3. Create a Azure Storage Account
  4. Create Website/App Service
    1. Set WebSockets to On
    2. Set Always On to On
    3. Set ARR Affinity to Off
    4. Add Azure Service Bus connection strings in App settings:
      1. Cqrs.Azure.CommandBus.ConnectionString
      2. Cqrs.Azure.EventBus.ConnectionString
    5. Add Azure Storage Account connection strings for the Azure WebJob:
      1. AzureWebJobsDashboard
      2. AzureWebJobsStorage
    6. Add database connection strings:
      1. DataStore
      2. EventStore
      3. Logs
    7. Add virtual folders: If you get the following error while publishing to Azure "Web deployment task failed. (Creating a new application is not supported by this server environment.)" Confirm the below virtual applications are correctly setup first.

/Chat Directory: "site\wwwroot" Application turned Off /Chat/UI Directory: "site\UI" Application turned On /Chat/RestAPI Directory: "site\RestAPI" Application turned On /Chat/WcfAPI Directory: "site\WcfAPI" Application turned On

  1. Update the follow files with the above app settings and connection strings so you can run you application locally:
    1. RestAPI\web.config
    2. WcfAPI\web.config
    3. WcfAPI.Tests\app.config
    4. MicroKernel\app.config
  2. Make sure you start the micro-kernel (it's a console application) first.
    1. The app setting CreateTestData control if the database gets cleared/flushed of all data and populated with fresh data each time it starts. Change this to false if you want to.

DEPLOY

  • Open the WebDeploy.pubxml WebDeploy publishing profiles in each project and replace any reference to cqrs-chat with the name of your Azure App Service created in step 4 of Configure you app.
  • Publish the following project to Azure using the provided WebDeploy publishing profiles:
    • Chat.RestAPI
    • Chat.WcfAPI
    • MyWebApp.UI
    • Chat.MicroKernel

Clone this wiki locally