Thursday, April 14, 2011

Windows Azure Connect – Joining local machine to a different domain using Azure Connect

Windows Azure Connect has changed the definition of connectivity between the machines. The power of Azure lies in release of Azure Connect.
Here we are going to follow the steps which you can use for making a machine joined to the domain. Many readers will feel that, what is a big deal in that?
Ahhh here is the catch…!!! Joining a local machine of your network to the domain of other network. Yes!!!!  You read it correctly.
Let me put an interesting scenario in front of you so that understanding will be easier.
Consider that, I have a local machine say in domain myDomain1.com. Let’s say that, the domain controller of myDomain1.com is present in India. Also my local machine is also present in the same network in India and eventually in myDomain1.com.




Let’s say I have another myDomain2.com. The associated domain controller is present in Australia. And the network is different. Both networks and domain belong to two different companies. Hence no connectivity between them.
What we want to achieve? We want to connect local machine of myDomain1.com to myDomain2.com.
To change the domain, I will follow the conventional way first. I go to My Computer of my local machine – Right click – Properties. Click on “Change Settings” button against the computer name. Pop up named as “System Properties” appear. Click on button labeled as “Change”. “Pop up named as “Computer name/Domain changes” will appear. Under the panel “Member of” I see domain name as “myDomain1.com”. Instead of that I enter the new text as “myDomain2.com”. And BANG!!! We get an error stating “AD DC for the domain could not be contacted. Ensure that domain name is typed correctly”.


The error is obvious, it is not able to find myDomain2.com domain. I do another workaround. I first took the local machine out of myDomain1.com by making it join to work group say “MyWorkGroup”. Then after restarting again I try to join it to the myDomain2.com and same error displayed.
So now what we do? Here comes the Windows Azure Connect for rescue.
Login with your windows Azure subscription to Azure Portal. Click on link “Get Activation Token” on the ribbon. Pop up will appear with activation token. Copy it so notepad, we will use it for further use.

Login to local machine and Domain Controller of myDomain2.com and enable IPv6 on both machines. Azure connect establishes connectivity based on IPv6. Also open firewall settings on both machines and enable TCP 443 outbound port.
 Create a sample web role application using VS 2010. Go to properties of Web role application. Select “Virtual Network” tab on left hand side panel. Check the checkbox “Activate Windows Azure Connect” and paste your activation token in the textbox below.
Publish the web role to hosted service in Azure using VS 2010. Go to Azure portal and click on “Install Local Endpoint” button on the ribbon. A pop up will appear with connect agent installation link.

Copy and paste agent installation link in the browser of your local machine, domain controller of mydomain2.com and follow all the instruction to install connect agent on both machines. Windows Azure Connect Endpoint Software enables Windows Azure users to set up secure, IP-level network connectivity between their Windows Azure hosted services (web role in our case) and local (on-premises – local machine of myDomain1.com and DC of myDomain2.com) resources. After successful installation of Connect agent, both the machines will appear on Azure Portal under Activated Endpoints section.

Note - As here in this post we are not concerned about taking our web role Azure VM in domain; I will skip that part. If you want to take your azure roles in domain, I will explain the steps in next posts. Here just let’s concentrate on local machine domain joining.
To make your azure web role, local machine and DC (of myDomain2.com in our case) communicate with each other, you need to create Azure machine group on Azure Management Portal. We will use this machine group to manage connectivity between local machine of myDomain1.com (which is now in Work Group) and Domain Controller of myDomain2.com.
To create machine group, select the “Create Groups” button on the ribbon of management portal. In the pop up dialog name the group, select the local machines to add to it (in our case DC of myDomain2.com and local machine), and add the web role. Make sure that, you check the “Interconnected” checkbox. This enable the machines present in the group to communicate with each other via Connect.

Here we have completed setting up Azure Connect !!!
Login to local machine, in run window type “regedit”. This opens the registry editor of local machine. Create a new string value (REG_SZ) called DNSServers under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure Connect\Endpoint and set its value to FQDN (fully qualified domain name) of DC of mydomain2.com. In our case FQDN of DC will be DC.myDomain2.com.
Then open My Computer of local machine – Right click – Properties. Click on “Change Settings” button against the computer name. Pop up named as “System Properties” appear. Click on button labeled as “Change”. Pop up named as “Computer name/Domain changes” will appear. Enter domain name as myDomain2.com and click OK. If asked, enter domain administrator username and password of myDomain2.com. Restart the machine and YOU ARE DONE!!!
This joins the local machine to domain which is present in the other network. Hope you find this article useful.
Cheers..

Please give food to all my fishes swimming at the bottom. It's fun!! Try it!!
Thanks for reading!!
Happy coding.


No comments:

Post a Comment