Azure Deployment

This section covers how to deploy the project in Azure Cloud

To host this project we are suggesting going with azure cloud's AppServices.

If you plan to use other server options, ensure the server supports .NET 6 runtime.

https://portal.azure.com/

Setting up the Resource group

Step 1: Click on the Resource groups.

Step 2: Click “Create”

Step 3: Azure subscription

  • Select your Azure subscription.

  • Give a Resource group name.

  • Select your region and click “Review + Create”.

Step 4: Review the details and click on Create.

Step 5: Click Go to resource Group group.

Step 6: You can see that your resource groups are created successfully.

Setting up the SQL database.

Step 1: Click on the “SQL database”.

Step 2: Click “Create”.

Step 3: Fill the necessary details.

  • Select a resource group.

  • Give a database resource

  • Click on “Create new” in the server.

Step 4: Authentication.

  • Give a server name and select a location.

  • Use the Authentication method you preferred, and we are using SQL authentication.

  • Create a SQL server by adding the server name, username, and password.

Step 5: Go back to the SQL database create page and select configure database.

Step 6: Give a database name, server and click Review + Create.

Step 7: Review the details and click on Create.

Step 8: SQL database is created successfully and click Go to resource.

Step 9: Get the connection string by clicking on the option “show database connection strings”.

Step 10: Copy the connection string that will be displayed in the “ADO.NET” option and save it.

Adding connection strings and keys

Step 11: select ESSWebPortal -> appsettings.json -> appsettings.Development.json there change the DB connection string and keys

Change the password in the SQL connection.

Step 12: Change the DB connection string in the ESSWebApi Project also.

Running migration.

Step 1: Select Tools -> Nuget Package Manager -> Package Manager Console this will open the Package Manager console.

Step 2: Click on the default project dropdown and choose ESSDataAccess for running the migration command.

Step 3: Type this command to generate the migration script.

Step 4: Once it successfully generates the migration fine you can see this output and a folder in the ESSDataAccess project.

Step 5: Then run this command to run the migration script to create the database and its table.

Step 6: Once it successfully updates you can see this output and also the database will be created in MSSql Server.

Setting up the App services for the web portal.

Step 1: Click on the App services.

Step 2: Click on Create.

Step 3: Select a Resource Group.

Step 4: Select Runtime stack as .NET 6 (LTS).

Step 5: Pricing plans.

  • Choose your Windows plan pricing as you prefer by clicking Create New, but here we are using the free plan.

  • Click Review + Create.

Step 6: Review the details and Click on Create.

Step 7: App services for the web portal are created successfully and select go to resource.

Step 8: Click and Download publish profile.

Step 9: Right-click the ESSwebportal and select publish in Visual Studio.

Step 10: Select the import profile.

Step 11: Download publish profile.

  • Click Browse and select the download publish profile.

  • Click Next.

Step 12: Close the tab after the creation progress is done.

Step 13: Save the details.

  • Again, right-click the ESSwebportal and select publish.

  • Click Show all settings.

Step 14: Expand the File Publish options, select “Remove additional files at destination” and click save.

Step 15: Expand the database, select “use this connection string at runtime” and click save.

Step 16: After saving the details click publish.

Step 17: Publish succeeded.

Step 18: Once the project starts you can see the login page.

Step 19: Set up the web API App services the same as the web portal.

Last updated