-
Notifications
You must be signed in to change notification settings - Fork 80
WebJob Sample
cdmdotnet edited this page Jul 25, 2017
·
9 revisions
Congratulations! You've created a project. You can launch and publish your app once you've configured it using the instructions below.
Use the same connection string for all files below.
- RestAPI - web.config
- Set the Azure Service Bus connection string for application settings "Cqrs.Azure.CommandBus.ConnectionString".
- Set the Azure Service Bus connection string for application settings "Cqrs.Azure.EventBus.ConnectionString".
- Set the SQL Server connection string for connection string named "Logs".
- Set the SQL Server connection string for connection string named "DataStore"
- Set the SQL Server connection string for connection string named "EventStore"
- MicroKernel - app.config
- Set the Azure Service Bus connection string for application settings "Cqrs.Azure.CommandBus.ConnectionString".
- Set the Azure Service Bus connection string for application settings "Cqrs.Azure.EventBus.ConnectionString".
- Set the SQL Server connection string for connection string named "Logs".
- Set the SQL Server connection string for connection string named "DataStore"
- Set the SQL Server connection string for connection string named "EventStore"
- Set the Storage Account connection string for connection string named "AzureWebJobsDashboard"
- Set the Storage Account connection string for connection string named "AzureWebJobsStorage"
- WcfAPI - web.config
- Set the Azure Service Bus connection string for application settings "Cqrs.Azure.CommandBus.ConnectionString".
- Set the Azure Service Bus connection string for application settings "Cqrs.Azure.EventBus.ConnectionString".
- Set the SQL Server connection string for connection string named "Logs".
- Set the SQL Server connection string for connection string named "DataStore"
- Set the SQL Server connection string for connection string named "EventStore"
- Execute the following SQL scripts:
- Run SQL scripts:
- \MicroServices\tools\ConversationSummary.sql
- \MicroServices\tools\Credentials.sql
- \MicroServices\tools\Messages.sql
- \MicroServices\tools\Users.sql
- Run CQRS SQL scripts:
- \MicroServices\tools\Create-Log-Table.sql
- \MicroServices\tools\EventStoreTable-SqlServer.sql
- Run SQL scripts:
- Compile all projects.
- Run the MicroKernel console app first and leave it running. In Azure this runs as a WebJob.
- By default the application setting "CreateTestData" in MicroKernel - app.config is set to true, which means each time the app is started all data will be flushed and re-populated.
- Start/visit the UI website.
- Create a new Azure SQL Database:
- Run SQL scripts:
- \MicroServices\tools\ConversationSummary.sql
- \MicroServices\tools\Credentials.sql
- \MicroServices\tools\Messages.sql
- \MicroServices\tools\Users.sql
- Run CQRS SQL scripts:
- \MicroServices\tools\Create-Log-Table.sql
- \MicroServices\tools\EventStoreTable-SqlServer.sql
- Run SQL scripts:
- Create an new instance of Azure Service Bus
- Create a Azure Storage Account
- Create Website/App Service
- Set WebSockets to On
- Set Always On to On
- Set ARR Affinity to Off
- Add Azure Service Bus connection strings in App settings:
- Cqrs.Azure.CommandBus.ConnectionString
- Cqrs.Azure.EventBus.ConnectionString
- Add Azure Storage Account connection strings for the Azure WebJob:
- AzureWebJobsDashboard
- AzureWebJobsStorage
- Add database connection strings:
- DataStore
- EventStore
- Logs
- DataStore
- 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
- /Chat
- Set WebSockets to On
- Update the follow files with the above app settings and connection strings so you can run you application locally:
- RestAPI\web.config
- WcfAPI\web.config
- WcfAPI.Tests\app.config
- MicroKernel\app.config
- Make sure you start the micro-kernel (it's a console application) first.
- 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.
- 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
- Chat.UI
- Chat.MicroKernel