The pupose of any DevOps team is provide value to the end user continuously so to achive that in this exercise we are going to build a CI pipeline (aka workflow) for the web application in this case a Web Api. The Web Api was developed in ASP .NET Core 6.0 and is a demo rest api that has a health probe in GET api/HealthProbe and Swagger enabled in GET /swagger. The Web Api connect to a database which database project (PartsUnlimited.Database) that is the same repo. However, for time constraints we recomend manually deploy the dacpac file to populate the database. You can use SQL Server Management Studio
DO NOT FORGET TO TAKE CARE OF THE Web API CONNECTION STRING ;)
A. Create a CI workflow in GitHub Actions to compile the app so it can be deployed in App Service that will be created using Terraform.
- In GitHub menu click 'Actions'.
- Click in 'New workflow'
- Search for 'Deploy a .NET Core app to an Azure Web App'.
- Choose the previous template by clicking the 'Configure' button.
- In the workflow change the enviroment variable 'DOTNET_VERSION: x' to 'DOTNET_VERSION: '6.0'
- Modify the enviroment variable 'AZURE_WEBAPP_NAME' to match the name of your App Service. E.G: partsunlimitedapi-team03
- Click the green button named 'Start commit'.
- Give the commit a name.
- Click the green button named 'Commit new file'.
- Customize the workflow so you can build and deploy the app.
- Go to Azure portal to download the publish profile of the App Service.
- Create an Actions Secret with the name "" and copy&paste the XML contained in the publish profile downloaded previously.
At the end your pipeline should look like this: