It will reduce all our work load for build and deployment. We will see all the actions step by step.
Step 1 - Create a Web application in Visual Studio.
Please choose ASP.NET Web Application template.
We can choose MVC template.
Our application will be created shortly.
Step 2 - Publish the application to Azure
We can publish our application to Azure. You must install Azure SDK for this. If you do not have Azure SDK, please download it from this URL.
Right click the solution explorer and choose Publish.
It will open a new window and it will show 4 options. Please choose the first (App Service) option.
We are going to create a new Azure Web App. Select “Create New” option and click Publish button.
It will ask for your Azure credentials and please login with your Azure account.
Please choose a name for your Web App and choose the name for your Hosting plan. In hosting plan, you must choose the location and size of your Web App. There are various plans available.
Available Plans.
We have already selected the size and chosen the name for our service plan. Now we can name the Web app.
Please click the “Create” button now.
It will take some time to create a new Azure Web App and Service Plan and it will automatically publish to Azure.
Our Web App is ready now. This is a simple app.
Step 3 - Configure Continuous Delivery
We can now configure the Continuous Delivery. Please click “Configure” link
Please setup Azure DevOps or GitHub repository. Add our source files to source control. (Please click the link)
Please publish to Git Repo.
Please click “Publish Repository” button.
Repository will be created soon. Please click “Azure Pipelines”
Please choose the subscription and App Service name. Click OK button to start build process.
We will be notified with a message that Azure pipe lines started.
After some time, pipe lines will be finished.
Please open Azure DevOps to see our Project repository and Pipelines. (DevOps Link)
You can see that new project repository is created in Azure DevOps.
Please click on the Project Pipelines.
You can see that one manual build is created now.
Step 4 - Continuous Integration and Continuous Delivery (CI/CD)
We can check the Continuous Integration and Continuous Delivery now. We can modify two files in our application. I have modified the Index.cshtml file. Also modified _Layout.cshmtl file.
Please commit the changes.
We can push the changes to Azure DevOps.
We will be notified with the below message.
We can check the Azure DevOps and find that our new build came automatically now.
It will take some time to finish the build and it will be automatically deployed to Azure Web App Service. We can see the status. Please note that only the modified changes will be affected with this build and deployment.
Please refresh the Azure Web Application. You can notice that our new changes will be applied in the Web App now. (If you still see the old screen, please clear the browser Cache)
In this application we saw how to create a Web Application in Visual Studio and we published the App to Azure and we created an Azure DevOps repository for our Web App and enabled the Continuous Delivery. We modified two Razor View files in our web application and commit and push the code changes to Azure DevOps. CI/CD feature automatically created a Batch build and deployed the application to Azure. Microsoft has really simplified the job for DevOps engineers.