Access Team City from Windows VM deployed in Azure through Public IP

There might be a situation where you are planning to have your DevOps Continuous Integration and Deployment processes to be implemented from a VM having Windows OS you have provisioned in Azure. This post mainly emphasize on how you can access your Team City from one of the VM commissioned in Azure through Public IP. Since I am not dealing with how to setup the Team City, hence I will skip the setup process and rather focus on the access over public IP. Please go through the step-by-step instructions.

Step 1: Add Inbound rules to the server firewall for allowing communications

Login to the VM and then access the Windows Firewall . Create a new Inbound rule.


Select Protocol and Ports and specify port 80 where the rule applies. The port 80 is the port that has been configured for your localhost when you had setup Team City which goes like http://localhost/login.html. You can assign any other port that you had configured with.



Select Allow Connection from the Action pane


Rest continue with the default option for the Profile and then provide a name for this Rule you have created and finish to add the new rule.

Step 2: Configure the Azure VM from the Azure Portal

Login to the portal and select the VM that you have created and select the IP address.


Provide a DNS name and assign to Static IP


Select the Network Security Group <VM_Name>.nsg assigned for the VM in order to allow traffic for port 80. Select the Inbound Security Rules and Add a rule.


While adding the rule, add the name of the rule, ensure that you have selected HTTP for Service and Action is Allow.


Once the rule is added, Redeploy the VM.


That’s it. Now you can provide the Team City URL http://<dns-name>/login.html and you will be able to view the Team City Login page through Internet.

Global Azure Boot Camp 2017, Austin TX

Here are some of the boot camp session and training videos from Global Azure Boot Camp 2017 that was held in Austin, Texas.  Thanks to my friend Shawn Weisfeld @Technical Evangelist at Microsoft who had helped me to organize this boot camp at Microsoft campus along with an awesome setup of streaming and recording this videos at Shawn is the founder of

Also my sincere thanks and gratitude to our local sponsors and contributor Clear Measure, Austin .NET User Group and my organization Sogeti USA LLC for helping me organize this event with eminent speakers, foods and beverages along with Microsoft global organizers.

Mostly I am thankful to the following eminent speakers and contributors for this boot camp

2017 Austin Global Azure Boot Camp Welcome Note



Azure Foundation



Making the Case for the ServiceBus



Making Teams Fly with Continuous Delivery to Azure



Introduction to Azure Security Center



Building Powerful intelligence using Cognitive Services



Big Data in Azure



2017 Austin Global Azure Bootcamp Closing Note



Enjoy the videos and happy Azure Learning

Build and Deploy Web Application and Web API as Azure Web App through VSO Continuous Integration

I thought to write this post which might help my fellow developers to know how to create a CI build for any web application or web API through Team Services of VSO. Just like in one of the post I have explained how we can create a NuGet package using CI build, this post might give more insight about building and deploying an web application directly to Azure using CI build. Let’s get through the steps involved.

Step 1: Install and configure Azure PowerShell

This step is highly important if you don’t have Azure PowerShell installed. The cmdlets of Azure PowerShell can be used to create/configure cloud apps/services, VM, virtual networks, etc. Download an install Azure PowerShell from this link.

Once installed open Windows PowerShell in administrative mode and run the following Azure PowerShell cmdlets to get details of your Azure subscription and resources available. Main that you need is your Subscription Name and Subscription Id.

Command to get Azure Account Information: Login-AzureRmAccount


Command to get Azure Resources available: Get-AzureRmResource

Command to get the Subscription Name and Id: Get-AzureRmSubscription

Command to get the Azure Publish Settings File: Get-AzurePublishSettingsFile

This command is important to get profile settings for publishing your web app in Azure. This will download the publish settings file along with the credentials in your local box.


Step 2: Create New Service Endpoint in Team Services dashboard

This step will help us to register or add our Azure subscription to TFS. This is done only once and at collection level using the Service tab. Just select New Service Endpoint and select Azure Classic.


In Add New Azure Classic Connection choose Subscription Id and Subscription Name that you got from Azure Command Get-AzureRmSubscription. The Connection Name can be based on your preferred one. You can even open the downloaded Publish Settings file to get the Subscription Id and Subscription Name. Also from the file, copy the content of Management Certificate and paste it in place holder as shown below while creating the new Connection.


Now this service endpoint is ready to be used while publishing the azure web app.

Step 3: Configure the Build and Deployment properties of Team Project

Create the build definition file for the team project for which you want to instantiate the CI build at every check in process to source control. For that select Azure WebApp from the Deployment tab of Build Definition window.


As usual in Build definition created, update your Mapping information to point to source control repository of your solution in Repository Tab. Update your CI filter in Trigger tab to point to source control repository of your solution.

Next lets select the Build tab and select Azure Deployment. In details section, you need to select the new service endpoint created and select the Web App Name.


That’s all we need. Now you can queue the build to see how it works.

Build and Publish NuGet Package in Azure

Most of the time we would like to have our common library used by many applications. Integrating the library as a part of all the solutions is not ideal when the requirement is to have the common implementation used in various projects. NuGet helps us to create a separate package that can be used globally which serves the purpose of implementing the common functionality across all major solutions. Thinking on those lines, today I would like to share the idea of how we can achieve of building and publishing a library as a NuGet package using VSTS in Azure.

In one of my post I have already discussed about how we can create a NuGet repository in Azure. Lets have a look into a step-by-step process of how we can create a NuGet feed in Azure and publish the NuGet package for the library so that it is available in the feed.

Step 1: Create a NuGet Feed

VSO can be used to host a private NuGet feed and in order to do that first you need to install Package Management to VSO. It provides an extension that enables continuous delivery mechanism by hosting packages which will be available for consumption and usage by team, builds and releases. Once installed you can see a Package link against each Team project in your Team Services dashboard. If you already have the Package link, then don’t bother to install it again.

Once you have installed the Package Manager in VSO, you can then create a Feed using New feed which includes a Feed name and description for the feed.

Once done your feed is ready to upload packages.  You can also add the required permissions for those who you would like to authorize to upload packages into the feed.

Step 2: Create NuGet Packages of your Library

Once you are good with the feed, it is time for you to generate NuGet package for your library and publish it in your private hosted feed. In order to do that, add a NuGet project in your solution which contains the Library project.

Typically the structure would look like this which will also include the nuspec file for the library that you would like to create the package for.

Open the nuspec file and update the id, version, title, etc. along with project Uri of your NuGet repository. That Uri is not mandatory but it is better to keep it. Add the release path of the DLL and PDB file of the class library project whose package we want to create.

You can create more than one nuspec file which can be specific and related to multiple class library projects in your solution that can generate multiple NuGet packages to be hosted in NuGet repository. However it depends on your requirement.

Open the NuGet.config file and add the api key and package source for the NuGet package explorer. Again its not mandatory to do that as we are trying to automate the NuGet package development using VSO team service but for future reference purpose you can keep it.

That’s all you need to do. One more thing that you might have to do is open the NuGet project file in notepad or notepad++ and verify the settings of AfterBuild are same as below.

Step 3: Prepare your Build definition in Visual Studio Team Services

Select the team project in VSO which contains the library project and solution. Select the Build section and add a new Build definition for your library.

Select the build definition template Visual Studio.

While creating the Build definition, you would be prompted to select Continuous Integration (CI) build which means whenever you check in the code to source control, immediately this build will be triggered. It is a best option to do that when you have a requirement to create and deploy the NuGet package as soon as you check in your code to source control.

Once the Build definition is created for the team project, you will see the sequential order of how the build will happen through VSO. The steps involved are:

  1. Restore the NuGet version
  2. Build the Solution
  3. Test the Assemblies and execute the Test projects
  4. Publish the files and index the source code
  5. Copy the published files to artifacts staging directory
  6. Publish the artifacts and drop it to the server.

What we need to include is another step to to publish the NuGet package to the private hosted NuGet feed as soon as the solution build is complete which means in between Step 2 and 3.

In order to do that we need to add a build step of publishing the NuGet package to the feed. Select Add Tasks and add NuGet Publisher from all the listed tasks available.

Once added, drag the NuGet Publisher just after the Build Solution step so that once the project is successfully build, it will publish the generated NuGet.

Once done, lets review the following definitions Build, Repository, Variables and Triggers.

Build Definition Tab

Select Feed Type as Internal Feed and add the Internal Feed Url that we have created in our Step 1 in our NuGet publisher build step.

Repository Tab

Verify the mapping information of the server path to the source location of the project of Team explorer is correct. This can be validated in Repository tab of Build definition.

Variables Tab

Add a variable which will represent the API key to access the NuGet feed and authorize the user to upload the package. This is important as we don’t want any unauthorized user to upload anything to the private feed.

Trigger Build

Verify that CI build include the repository path of the solution from where the NuGet packages are going to get created.

That’s all and we are done. Its is time to validate and trigger a build to check if everything is working as per expectations.

Click on Queue build…. and verify how things are going.

Hope that this will help my fellow developers to Create and publish NuGet packages in Azure.