In this lab you will learn to:
- Azure SQL Database
- Create an instance of Azure SQL Database
- Load data in to the database
- Azure App Service
- Create an instance of Azure Web Apps
- Deploy an ASP.NET Core 2.2 app to Azure Web Apps
- Configure the web app to access the database
- Application Insights
- Create an instance of Application Insights
- Activate Application Insights in the web app
- Explore Application insights features
- Azure DevOps
- Configure continuous delivery
- In the Azure portal, create a new Azure SQL Database instance.
- Set up firewall rules to allow Azure resources and your IP
- Fork our app from https://github.com/brminnick/azure-for-developers-workshop.
- Clone the fork onto your machine.
- Run the script at
src/hotelsweb/database/sql/create-tables-data.sql
using one of the following:- Azure portal
- SQL Management Studio
- SQL Operations Studio
- Visual Studio or VS Code with SQL Server extension
- Open
src/hotelsweb.sln
in Visual Studio or VSCode. - Configure the application with the SQL Database connection string.
- Visual Studio - Right-click on the project, select Manage User Secrets. Enter this snippet:
{ "ConnectionStrings": { "LocalConnection": "<connection string>" } }
- Other editors (.NET CLI) - Open a terminal to the folder containing hotelsweb.csproj. Enter this command:
dotnet user-secrets set 'ConnectionStrings:LocalConnection' '<connection string>'
- Visual Studio - Right-click on the project, select Manage User Secrets. Enter this snippet:
- Run the application. Clicking on the Hotels link in the navigation bar should display a list of hotels.
- In the Azure portal, create a new Web App.
- Place it in the same resource group as the SQL Database
- Select Windows
- Do not turn on Application Insights for now
- Once the app is created, go to its Deployment options view and configure GitHub deployment from your fork. Wait for the app to be deployed.
- Open the web app's application settings. Add a new connection string:
- Name:
HotelsConnection
- Value: Your SQL Database connection string
- Name:
- Open the application in your browser. It should appear and the Hotels links should work.
- In the Azure portal, open the Application Insights view. Select Setup Application Insights and follow instructions to configure Application Insights.
- In the Azure portal, create a new DevOps project. Select "Bring your own code".
- Connect your GitHub account and select your fork.
- Follow the rest of the instructions.