Welcome!

Cloud Expo Authors: Pat Romanski, Yeshim Deniz, Roger Strukhoff, Elizabeth White, Liz McMillan

Blog Feed Post

Create a Windows Azure Network using PowerShell – 31 Days of Servers in the Cloud (Part 19 of 31)

Try Windows Azure FREE for 90 daysBack in Part 10 of our “31 Days of Servers in the Cloud” series, my good friend Bob Hunt wrote up an excellent step-by-step  for creating a virtual network in Windows Azure.

His article and guide was so good, in fact, that I am going to attempt to do the very same task – to create and configure a network in Windows Azure; but instead of using the Windows Azure portal, we’re going to do it entirely using PowerShell and some special Windows Azure Management Cmdlets.

“Are you out of your mind?”

Perhaps.  The goal, as it was in Bob’s article, is that in the end we have a network configured and ready to securely connect to (and extend our) existing on-premises network.  From Bob’s introduction:

Before we get started, it’s important to set the stage of what we’re trying to accomplish.  The Windows Azure Virtual Network you are about to create establishes a Site to Site (S2S) VPN between your company’s network and the Windows Azure Cloud Service using the steps outlined below, and requires that you have an already installed VPN device on your premise.  The list of currently supported VPN devices is located hereWindows Azure currently supports up to 5 S2S VPN tunnels, allowing you to have multiple Virtual Networks hosted in Windows Azure, such as a Test Network and a Production Network.

Contoso's Deployment

 

Set up PowerShell

To make this happen, of course, we’re going to have to have done a couple of things in advance:

  1. Get a Windows Azure account (start with the free 90-day trial),
  2. Get the Windows Azure PowerShell tools, and
  3. Follow some simple instructions to set up the secured connection for Windows Azure management.

Once you have this done, open up your Windows Azure PowerShell window, and open up notepad.

“Huh?  Notepad?”

Yes. 

 

The .netcfg File

For configuring networking in Windows Azure using PowerShell, there are only two Set-AzureVNet commands:

There are Get-AzureVNet…  commands that retrieve information (and objects), but for actually creating and configuring the networking, you’re going to be using an XML formatted document that has (by default) a .netcfg extension, and then using Set-AzureVNetConfig to upload that file.  And then we use New-AzureVNetGateway and Set-AzureVNetGateway to configure and connect the gateway. 

Again, in Bob’s article, we created a network.   So as a starting point for creating the network using PowerShell, I’m going to use Get-AzureVNetConfig to retrieve his configuration into a .netcfg file.

Get-AzureVNetConfig -ExportToFile C:\Users\kevrem\Desktop\MyAzureNetworks.netcfg

And the resulting file looks something like this:

-----

<?xml version="1.0" encoding="utf-8"?>
<NetworkConfiguration xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration">
  <VirtualNetworkConfiguration>
    <Dns>
      <DnsServers>
         <DnsServer name="YourDNS" IPAddress="10.1.0.4" />
      </DnsServers>
    </Dns>
    <LocalNetworkSites>
      <LocalNetworkSite name="YourCorpHQ">
        <AddressSpace>
          <AddressPrefix>10.0.0.0/24</AddressPrefix>
        </AddressSpace>
        <VPNGatewayAddress>XXX.XXX.XXX.XXX</VPNGatewayAddress>
      </LocalNetworkSite>
    </LocalNetworkSites>
    <VirtualNetworkSites>
      <VirtualNetworkSite name="YourVirtualNetwork" AffinityGroup="KevRemWestUS">
        <AddressSpace>
          <AddressPrefix>10.4.0.0/16</AddressPrefix>
        </AddressSpace>
        <Subnets>
          <Subnet name="FrontEndSubnet">
            <AddressPrefix>10.4.2.0/24</AddressPrefix>
          </Subnet>
          <Subnet name="BackEndSubnet">
            <AddressPrefix>10.4.3.0/24</AddressPrefix>
          </Subnet>
          <Subnet name="ADDNSSubnet">
            <AddressPrefix>10.4.4.0/24</AddressPrefix>
          </Subnet>
          <Subnet name="GatewaySubnet">
            <AddressPrefix>10.4.1.0/24</AddressPrefix>
          </Subnet>
        </Subnets>
        <DnsServersRef>
          <DnsServerRef name="YourDNS" />
        </DnsServersRef>
        <Gateway>
          <ConnectionsToLocalNetwork>
            <LocalNetworkSiteRef name="YourCorpHQ" />
          </ConnectionsToLocalNetwork>
        </Gateway>
      </VirtualNetworkSite>
    </VirtualNetworkSites>
  </VirtualNetworkConfiguration>
</NetworkConfiguration>

-----

Go ahead and copy/paste the above text into Notepad, and save it as a file named MyAzureNetworks.netcfg

Now please note the highlighted portions. Those are unique for your account.  You’ll need to put your own public VPN gateway address, and use your own pre-created affinity group

Also note the bold text.  These are the items that you customize.  Put your own names and desired addresses in there, such as your DNS Server name and address.  Remove or add <Subnet> </Subnet> sections, or <Subnets>. 

But once you have that information, you should be able to use this file with the Set-AzureVNetConfig PowerShell cmdlet to create the same network and subnets.  If you’ve saved the file (let’s say to the root of your C:\ drive), and you have the Windows Azure PowerShell window open and connected..

“How do I know it’s connected?”

Try this PowerShell command:

Get-AzureSubscription

This should return some details on your connected subscription.

Anyway, once that’s verified, and as a first test of creating a network using PowerShell, run this:

Set-AzureVNetConfig -ConfigurationPath C:\MyAzureNetworks.netcfg

This should return successful. 

Now open up the Windows Azure Portal, login, and click on the Networks tab.  Do you see something like this?:

image

“Yes, I do!”

Good job!  Click on the Local Networks, DNS Servers, and Affinity Groups tabs.  You should see the values assigned and items created that match what you configured.

Back in Virtual Networks… Clicking on the network name and opening up the network details should look something like this:

image

Do you see the problem?  We haven’t yet created and enabled the gateway.  We can do that with PowerShell, too.

 

Create the Gateway

To do this, we’ll use the New-AzureVNetGateway command, and specify the name we used for our Azure NetworkThe command for our example looks like this:

New-AzureVNetGateway –VNetName “YourVirtualNetwork”

Once you run that, if you refresh the Windows Azure Portal screen, you’ll see this:

image

The creation of the gateway may take as long as 15 minutes.  You can also check the status of this creation by using the Get-AzureVNetGateway cmdlet.

image

 

In fact, you can see from my result in PowerShell that my gateway creation has completed, and my gateway address assigned.  Now the Windows Azure Portal looks like this:

 

image

 

But we still have one more thing to accomplish.  We haven’t yet connected our Azure network to our corporate network.

 

Connect the Gateway

This is also very simple: Set-AzureVNetGateway is the cmdlet we’ll use. 

Set-AzureVNetGateway -Connect –LocalNetworkSiteName “YourCorpHQ” –VNetName “YourVirtualNetwork”

image

Which shows up on the Windows Azure Portal like this:

image

Of course, it’s not going to succeed in connecting until we actually have something to connect to on the corporate side.  As you’ll recall, there are specific VPN endpoint devices that are supported on the corporate side, and to configure them you can use the Windows Azure Portal to download the Configuration as well as the Shared Key.

“But.. can you do that with PowerShell, too?”

Absolutely.  Well, two out of three, anyway…

 

Get the Gateway IP Address and Shared Key

There are three things you’ll need to configure the VPN device on your corporate side:

  1. The Gateway IP Address
  2. The Shared Key, and
  3. A Device Configuration Script

You can use the Get-AzureVNetGateway cmdlet to find the Gateway IP Address:

Get-AzureVNetGateway -VNetName YourVirtualNetwork

image

To get the shared key, use the Get-AzureVNetGatewayKey cmdlet:

Get-AzureVNetGatewayKey -LocalNetworkSiteName YourCorpHQ -VNetName YourVirtualNetwork

image

For the getting a script that will automatically configure your device, you’re still want to use the Windows Azure Portal.  Down at the bottom of the page while looking at your network dashboard, you see the “Download” button:

image 

Click that, and then walk through the wizard to select your device type and version information.

DwnldVPNConfig

The result will be a script that can be used by your VPN / Network administrator to configure the device.  You can get the VPN configuration script from the Management Portal or from the About VPN Devices for Virtual Network section of the MSDN library.  For more information, see Establish a Site-to-Site VPN Connection and your VPN device documentation.

The remainder of this article is “borrowed” directly from the end of Bob Hunt’s excellent article:

The procedure assumes the following:

  • The VPN device has been configured at your company.

To configure the VPN device:

  1. Modify the VPN configuration script. You will configure the following:

    a. Security policies

    b. Incoming tunnel

    c. Outgoing tunnel

  2. Run the modified VPN configuration script to configure your VPN device.

  3. Test your connection by running one of the following commands:

Cisco ASA

Cisco ISR/ASR

Juniper SSG/ISG

Juniper SRX/J

Check main mode SAs

show crypto isakmp sa

show crypto isakmp sa

get ike cookie

show security ike security-association

Check quick mode SAs

show crypto ipsec sa

show crypto ipsec sa

get sa

show security ipsec security-association

Once the Virtual Network tests out, you’re ready to go.  Enjoy!

Thanks, Bob.  I think we will!

---

Try Windows Azure free for 90 days

Read the original blog entry...

More Stories By Kevin Remde

Kevin is an engaging and highly sought-after speaker and webcaster who has landed several times on Microsoft's top 10 webcast list, and has delivered many top-scoring TechNet events and webcasts. In his past outside of Microsoft, Kevin has held positions such as software engineer, information systems professional, and information systems manager. He loves sharing helpful new solutions and technologies with his IT professional peers.

A prolific blogger, Kevin shares his thoughts, ideas and tips on his “Full of I.T.” blog (http://aka.ms/FullOfIT). He also contributes to and moderates the TechNet Forum IT Manager discussion (http://aka.ms/ITManager), and presents live TechNet Events throughout the central U.S. (http://www.technetevents.com). When he's not busy learning or blogging about new technologies, Kevin enjoys digital photography and videography, and sings in a band. (Q: Midlife crisis? A: More cowbell!) He continues to challenge his TechNet Event audiences to sing Karaoke with him.

Cloud Expo Latest Stories
With the explosion of the cloud, more businesses are transitioning to a recurring revenue model to generate reliable sales, grow profits, and open new markets. This opportunity requires businesses to get to market quickly with the pricing and packaging options customers want. In addition, you will want to take advantage of the ensuing tidal wave of data to more effectively upsell, cross-sell and manage your customers. All of this is possible, but only with the right approach. At 15th Cloud Expo, Brendan O'Brien, Co-founder at Aria Systems and the inventor of cloud billing panelists, will lead a panel discussion on what it takes to launch and manage a successful recurring revenue business. The panelists will offer their insights about what each department will need to consider, from financial management to line of business and IT. The panelists will also offer examples from their success in recurring revenue with companies such as Audi, Constant Contact, Experian, Pitney-Bowes, Teleko...
Planning scalable environments isn't terribly difficult, but it does require a change of perspective. In his session at 15th Cloud Expo, Phil Jackson, Development Community Advocate for SoftLayer, will broaden your views to think on an Internet scale by dissecting a video publishing application built with The SoftLayer Platform, Message Queuing, Object Storage, and Drupal. By examining a scalable modular application build that can handle unpredictable traffic, attendees will able to grow your development arsenal and pick up a few strategies to apply to your own projects.
Come learn about what you need to consider when moving your data to the cloud. In her session at 15th Cloud Expo, Skyla Loomis, a Program Director of Cloudant Development at Cloudant, will discuss the security, performance, and operational implications of keeping your data on premise, moving it to the cloud, or taking a hybrid approach. She will use real customer examples to illustrate the tradeoffs, key decision points, and how to be successful with a cloud or hybrid cloud solution.
The cloud provides an easy onramp to building and deploying Big Data solutions. Transitioning from initial deployment to large-scale, highly performant operations may not be as easy. In his session at 15th Cloud Expo, Harold Hannon, Sr. Software Architect at SoftLayer, will discuss the benefits, weaknesses, and performance characteristics of public and bare metal cloud deployments that can help you make the right decisions.
Over the last few years the healthcare ecosystem has revolved around innovations in Electronic Health Record (HER) based systems. This evolution has helped us achieve much desired interoperability. Now the focus is shifting to other equally important aspects – scalability and performance. While applying cloud computing environments to the EHR systems, a special consideration needs to be given to the cloud enablement of Veterans Health Information Systems and Technology Architecture (VistA), i.e., the largest single medical system in the United States.
Cloud and Big Data present unique dilemmas: embracing the benefits of these new technologies while maintaining the security of your organization’s assets. When an outside party owns, controls and manages your infrastructure and computational resources, how can you be assured that sensitive data remains private and secure? How do you best protect data in mixed use cloud and big data infrastructure sets? Can you still satisfy the full range of reporting, compliance and regulatory requirements? In his session at 15th Cloud Expo, Derek Tumulak, Vice President of Product Management at Vormetric, will discuss how to address data security in cloud and Big Data environments so that your organization isn’t next week’s data breach headline.
Scott Jenson leads a project called The Physical Web within the Chrome team at Google. Project members are working to take the scalability and openness of the web and use it to talk to the exponentially exploding range of smart devices. Nearly every company today working on the IoT comes up with the same basic solution: use my server and you'll be fine. But if we really believe there will be trillions of these devices, that just can't scale. We need a system that is open a scalable and by using the URL as a basic building block, we open this up and get the same resilience that the web enjoys.
Is your organization struggling to deal with skyrocketing volumes of digital assets? The amount of data is growing exponentially and organizations are having a hard time managing this growth. In his session at 15th Cloud Expo, Amar Kapadia, Senior Director of Open Cloud Strategy at Seagate, will walk through the essential considerations when developing a cloud storage strategy. In this discussion, you will understand the challenges IT is facing, why companies need to move to cloud, and how the right cloud model can help your business economically overcome the data struggle.
If cloud computing benefits are so clear, why have so few enterprises migrated their mission-critical apps? The answer is often inertia and FUD. No one ever got fired for not moving to the cloud – not yet. In his session at 15th Cloud Expo, Michael Hoch, SVP, Cloud Advisory Service at Virtustream, will discuss the six key steps to justify and execute your MCA cloud migration.
The 16th International Cloud Expo announces that its Call for Papers is now open. 16th International Cloud Expo, to be held June 9–11, 2015, at the Javits Center in New York City brings together Cloud Computing, APM, APIs, Security, Big Data, Internet of Things, DevOps and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal today!
Most of today’s hardware manufacturers are building servers with at least one SATA Port, but not every systems engineer utilizes them. This is considered a loss in the game of maximizing potential storage space in a fixed unit. The SATADOM Series was created by Innodisk as a high-performance, small form factor boot drive with low power consumption to be plugged into the unused SATA port on your server board as an alternative to hard drive or USB boot-up. Built for 1U systems, this powerful device is smaller than a one dollar coin, and frees up otherwise dead space on your motherboard. To meet the requirements of tomorrow’s cloud hardware, Innodisk invested internal R&D resources to develop our SATA III series of products. The SATA III SATADOM boasts 500/180MBs R/W Speeds respectively, or double R/W Speed of SATA II products.
In today's application economy, enterprise organizations realize that it's their applications that are the heart and soul of their business. If their application users have a bad experience, their revenue and reputation are at stake. In his session at 15th Cloud Expo, Anand Akela, Senior Director of Product Marketing for Application Performance Management at CA Technologies, will discuss how a user-centric Application Performance Management solution can help inspire your users with every application transaction.
SYS-CON Events announced today that Gridstore™, the leader in software-defined storage (SDS) purpose-built for Windows Servers and Hyper-V, will exhibit at SYS-CON's 15th International Cloud Expo®, which will take place on November 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. Gridstore™ is the leader in software-defined storage purpose built for virtualization that is designed to accelerate applications in virtualized environments. Using its patented Server-Side Virtual Controller™ Technology (SVCT) to eliminate the I/O blender effect and accelerate applications Gridstore delivers vmOptimized™ Storage that self-optimizes to each application or VM across both virtual and physical environments. Leveraging a grid architecture, Gridstore delivers the first end-to-end storage QoS to ensure the most important App or VM performance is never compromised. The storage grid, that uses Gridstore’s performance optimized nodes or capacity optimized nodes, starts with as few a...
SYS-CON Events announced today that Cloudian, Inc., the leading provider of hybrid cloud storage solutions, has been named “Bronze Sponsor” of SYS-CON's 15th International Cloud Expo®, which will take place on November 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. Cloudian is a Foster City, Calif.-based software company specializing in cloud storage. Cloudian HyperStore® is an S3-compatible cloud object storage platform that enables service providers and enterprises to build reliable, affordable and scalable hybrid cloud storage solutions. Cloudian actively partners with leading cloud computing environments including Amazon Web Services, Citrix Cloud Platform, Apache CloudStack, OpenStack and the vast ecosystem of S3 compatible tools and applications. Cloudian's customers include Vodafone, Nextel, NTT, Nifty, and LunaCloud. The company has additional offices in China and Japan.
SYS-CON Events announced today that TechXtend (formerly Programmer’s Paradise), a leading value-added provider of server and storage virtualization, and r-evolution will exhibit at SYS-CON's 15th International Cloud Expo®, which will take place on November 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA. TechXtend (formerly Programmer’s Paradise) is a leading value-added provider of software, systems and solutions for corporations, government organizations, and academic institutions across the United States and Canada. TechXtend is the Exclusive Reseller in the United States for r-evolution