Commit a code change in Visual Studio to trigger Team Services Build to build and test a .NET Core web app and add it to a Docker image. The image is then pushed to Azure Container Registry, which triggers Team Services Build to deploy a container to a Li
- [Instructor] Now that we have our pipeline configured, let's try it out. First, let's trigger a new build and make sure the whole process works. Going to go up to Builds and Releases and click Builds. Click on our build definition and click Queue New Build. We want to use the latest commit of our master branch. So this is all set. Let's click okay. On the left, you can see our build tasks that we set up earlier and in the middle is the output of the build.
It does take some time for pulling down all the images required for the build and deployment process. Okay, now that our build succeeded, we should be able to head over to the releases section and see that our release was triggered. Here, we can see that the release is running. We can click this refresh button once in a while to see if it's finished. There, now that the release is finished, okay, let's see if our deployment worked. We're going to head back over to the Azure Portal. We go to our Resource Group, and click on our web app.
On the top right, we'll see our URL. Let's click on that. Sometimes it takes some time for the application to be ready. But once it's complete, you'll see your application load. Here we can see the application. It's showing the container ID of the container the application's running in, and it's showing that the OS is Linux. Finally, let's commit a code change and watch this whole pipeline happen automatically. I'm going to head back to Visual Studio. Here we can see our build notification at the bottom showing that our build completed successfully.
So let's make a change to the code, commit that change, and see it trigger a build and a release. Over on the right, we have our application. It's going to expand that. We're going to go into Views, and I'm going to edit the Index view. Here's the line that shows the machine name. I'm going to copy that line and duplicate it, and then I'm going to save it. Now that we've saved our changes, we need to commit those changes to source control.
I'm going to go over to Team Explorer, and I'm going to click Changes, and I'm going to enter a commit message, and then I'm going to commit the change. Now that the change is committed, we can sync our changes in Visual Studio Team Services, and this should kick off a build. Let's click Sync. Down here, we can see we have outgoing commits. Let's click push, and this should push our changes up to Visual Studio Team Services. Now we got the notification that it successfully pushed, so let's head over to Team Services and see if our build was triggered.
Let's go back to our Build section, and here, we can see there's a build in progress. If we click on the commit item here, we can see our build is in progress. It's currently building the application. Now, while the build is running, if you jump in in the middle like this, there's nothing to show until more output comes from the build process. So you'll see this Waiting for console output message. Shortly, we'll start to see some more information. Now that our build has completed, let's see if our release got triggered.
Here, we can see a release has been triggered, but it's not finished yet. Let's refresh this and see if we can see it finish. Ah, there it goes. Now we can see the release shows as green and completed, so we should be able to go over to our web application and see our change. Okay, here we see our changes. All we had to do was commit our changes to source control and push it to Team Services, and then our code was built, tested, added to a Docker image, and deployed on our Linux web app.
- Setting up your environment
- Adding Docker support to an application
- Debugging container-based apps in Visual Studio 2017
- The DevOps life cycle with Visual Studio and VS Team Services
- Configuring release and build
- Azure hosting options
- Using Kubernetes with Azure