<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Path to DevOps &amp; Cloud</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/nair/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/nair/feed.xml</link>
    <description>Learnings from the enterprise transformation journey</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:23:49 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Setting up windows containers offline</title>
      <link>https://docs.microsoft.com/archive/blogs/nair/setting-up-windows-containers-offline</link>
      <pubDate>Sun, 07 Jan 2018 15:50:25 GMT</pubDate>
      <dc:creator><![CDATA[Nandu M Nair]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nair/?p=46</guid>
      <description><![CDATA[*** Please note that this post is meant for dev environments and not for production scenarios...]]></description>
      <content:encoded><![CDATA[<span style="color: #ff0000"><em>*** Please note that this post is meant for dev environments and not for production scenarios ***</em></span>

Containers and Serverless are all the rage these days, but many enterprise developers do not have internet access on their development VMs. So how do we get started?

To setup windows containers on your machine, you would need few things:
<ol>
 	<li>The 'containers' feature to be enabled on your server</li>
 	<li>The Docker tooling – the Docker client and the Docker engine [Needs Internet access]</li>
 	<li>The container images themselves [Needs Internet access]</li>
</ol>
What we can do, in this case, is to use a machine that has internet access and download the required components. Great, but how does it work for container images?

Let's go step-by-step:

On a machine with internet access (I am going to assume a Windows server 2016 standard/datacenter or Windows 10 anniversary/creators update):
<ol>
 	<li>
<div>Open powershell and install the containers feature. Once completed, restart the machine</div>
<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">Install-WindowsFeature Containers
</span></li>
 	<li>Download the Docker community edition package from <a href="https://download.docker.com/win/static/stable/x86_64/">here</a> (pick whichever version you need. As an example - docker-17.09.0-ce.zip). Note that we are using the community edition here and not the enterprise edition of Docker.</li>
 	<li>Extract the contents to C:\ProgramFiles\docker and add that path to the environment variables</li>
 	<li>
<div>Register dockerd as a service and start it</div>
<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">dockerd.exe --register-service
</span>

<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">Start-Service docker
</span></li>
 	<li>
<div>Pull the images that you want to play with, let's say windowsservercore (ver 1709) and aspnetcore</div>
<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">docker pull microsoft/windowsservercore:1709
</span>

<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">docker pull microsoft/aspnetcore
</span></li>
 	<li>
<div>Once the download is complete, you can export the images in a tar format, which can then be copied to another machine. Note that the save operation takes time and is based on the size of the image.</div>
<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">docker save -o c:\windowsservercore1709.tar microsoft/windowsservercore:1709
</span></li>
</ol>
Now, on the server with no internet access:
<ol>
 	<li>
<div>Open powershell and install the containers feature. Once completed, restart the machine</div>
<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">Install-WindowsFeature Containers
</span></li>
 	<li>Get the docker package you downloaded from Step #2 and perform Steps #3 and #4</li>
 	<li>
<div>Get the exported images (from Step #6) locally and load them</div>
<span style="color: #0070c0;font-family: Consolas;font-size: 10pt">docker load -i c:\windowsservercore1709.tar
</span></li>
</ol>
We are now ready to play with containers. To setup an orchestrator, like miniKube follow the detailed instructions <a href="https://blogs.msdn.microsoft.com/wasimbloch/2017/01/23/setting-up-kubernetes-on-windows10-laptop-with-minikube/">here</a>.

Have fun!]]></content:encoded>
    </item>
    <item>
      <title>TFS automation - User Management</title>
      <link>https://docs.microsoft.com/archive/blogs/nair/tfsautomation</link>
      <pubDate>Wed, 05 Apr 2017 03:01:25 GMT</pubDate>
      <dc:creator><![CDATA[Nandu M Nair]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/nair/?p=1</guid>
      <description><![CDATA[This is part 1 of the TFS automation series, aimed at developers and administrators building systems...]]></description>
      <content:encoded><![CDATA[This is part 1 of the TFS automation series, aimed at developers and administrators building systems to automate various portions of the SDLC pipeline. Today we will talk about the automation of user management.
<h2>Overview</h2>
User access management is a critical piece of the TFS automation/administration function, especially at an enterprise scale. When migrating from one version of TFS to another or when merging one LoB instance to an enterprise instance, enterprises often have the need to take stock of the users provisioned and their access to collections and projects, in TFS. During this process, some customers would also need the ability to remove certain accounts (service accounts, expired accounts etc.) from a project/collection. This could be a time-consuming task depending on the number of users and team projects.

In addition, there has been some breaking and some behavioral changes in the API set between the TFS versions (2010 and 2015 as an example). As an example, IGroupSecurityService interface is deprecated as of TFS 2012 and it is recommended to use IidentityManagementService for all identity related operations. Similarly, while ICommonStructureService3 was in use for TFS 2010, it has been replaced with IcommonStructureService4 for TFS 2015 and above.

<span style="color: #008000">            // ICommonStructureService3 is being used for backward compatibility with TFS 2010.</span>
<span style="color: #008000">            // Replace with ICommonStructureService4, after migration to TFS15</span>
structureSvc = tpCollection.GetService&lt;<span style="color: #0000ff">ICommonStructureService3</span>&gt;();
<span style="color: #008000">            // IGroupSecurityService is deprecated as of TFS 2012 and needs to be removed, after migration to TFS15</span>
<span style="color: #008000">            // Use IIdentityManagementService for TFS15</span>
groupSecuritySvc = tpCollection.GetService&lt;<span style="color: #0000ff">IGroupSecurityService</span>&gt;();
<span style="color: #008000">            // use for TFS15</span>
idMgmtSvc = tpCollection.GetService&lt;<span style="color: #0000ff">IIdentityManagementService</span>&gt;();
<h2>API Usage</h2>
In order to perform user management operations, using the TFS object model, we need the below components:
<ul>
 	<li>Microsoft.TeamFoundation.Client
<ul>
 	<li>TfsTeamProjectCollection - create, open and authenticate the connection to TFS</li>
 	<li>ICommonStructureService - Used to fetch Team Project info based on name</li>
 	<li>IIdentityManagementService - to fetch user identity, verify group membership and add/remove users from a group</li>
 	<li>IGroupSecurityService - used for TFS versions lesser than 2012, to list/create/remove user groups</li>
</ul>
</li>
 	<li>Microsoft.TeamFoundation.Common
<ul>
 	<li>Supporting classes</li>
</ul>
</li>
</ul>
These assemblies can be found, typically, in the shared path – C:\Program Files\Common Files\microsoft shared\Team Foundation Server\&lt;version&gt;.
<h2>Sample Implementation</h2>
I created a sample in an effort to help customers automate this process. There are 2 components to the sample code:
<ul>
 	<li>The helper library (TFSPermissionHelpers)</li>
 	<li>A GUI to help administrators perform batch operations (TFSUserManagementUtil). This uses the helper library internally.</li>
</ul>
The full code sample for the helper library and the admin GUI is provided on <a href="https://github.com/nandkishorenair/TFSUtilities">GitHub</a>.

<img width="1024" height="333" class="alignnone size-large wp-image-36" alt="capture" src="https://msdnshared.blob.core.windows.net/media/2017/04/Capture1-1024x333.jpg" />

The provided GUI application can be used as-is by administrators to perform bulk operations. The helper library could also be plugged into the user provisioning workflow system, in use by the enterprise (as an example, where there are detailed processes/regulation associated with user access). The library can work with both csv and json formats, to accommodate service-level integration. Another use case would be for customers to use the library and create a self-service portal for users.

The first step is to create a csv/json file that captures the user data. One assumption made here is that addition of users is specific to groups and team projects. However, the removal of users is at a Team Project level (and not at an individual group level). This, of course, can be changed in code to achieve use-cases that need removal of users from specific groups only.
<p style="padding-left: 30px">csv format-
DomainName\TFSPowerUser,Contributors|Readers,DemoWeb|CloudDemo
DomainName\TFSDummyUser,Contributors|Readers,DemoWeb|CloudDemo</p>
<p style="padding-left: 30px">json format-
[ {
"UserName": "DomainName\\TFSPowerUser",
"GroupNames": [ "Contributors", "Readers" ],
"TeamProjectNames": [ "DemoWeb", "CloudDemo" ]
},
{
"UserName": "DomainName\\TFSDummyUser",
"GroupNames": [ "Contributors", "Readers" ],
"TeamProjectNames": [ "DemoWeb", "CloudDemo" ]
} ]</p>
More detailed <a href="https://github.com/nandkishorenair/TFSUtilities/blob/master/TFSUserManagementUtil/TFSUserManagementUtil/TFSUserManagementUtil.docx">documentation</a>, along with the <a href="https://github.com/nandkishorenair/TFSUtilities/tree/master/TFSUserManagementUtil">code</a> is available <a href="https://github.com/nandkishorenair/TFSUtilities">here</a>.]]></content:encoded>
    </item>
  </channel>
</rss>