Creating A Virtual Network in Azure Using Azure CLI
Creating A Virtual Network in Azure Using Azure CLI
In this lab, you will have the opportunity to create a VNet using Azure CLI. Through
the Azure CLI, we can create resources within Azure that can help automate and
improve consistency for many administrative tasks that you would otherwise
complete manually through the Azure Portal.
After completing this lab, you'll be familiar with how to create a VNet, and modify
subnet configuration, using Azure CLI.
Objectives
Successfully complete this lab by achieving the following learning objectives:
Create a Virtual Network
Do the following to create a virtual network with the Azure CLI:
1. On the main page, select the Azure Cloud Shell button, >_, at the top of the
page.
2. Choose the Bash environment.
3. Select Show advanced settings.
4. Set it up as follows:
o Subscription: Use the lab provided subscription
o Cloud Shell region: Put the same region as your lab's provided storage
account.
o Resource group: Use existing. It will then pre-populate.
o Storage account: Select Use existing
o File share: Select Create new
5. Select Create storage.
6. Once in the shell, enter the following to create the Virtual Network
<TAB> is the Tab key to automatically populate the resource group name.
3. Once in the shell, enter the following to create a subnet for the Virtual
Network you created earlier:
<TAB> is the Tab key to automatically populate the resource group name.
Credentials
How do I connect?
Azure portal Account
Username
cloud_user_p_3d84ebb8…
Password
S88eAAcl#xs7nTfg3Jj7
How do I connect?
Additional Resources
You have recently been hired by The Pupper Camp (TPC), a dog services company
that has offices across the world.
The Pupper Camp runs a series of projects throughout the year, where a range of
Azure-hosted infrastructure is required each time.
Your IT manager has asked you to test whether Azure CLI can be used to create a
Virtual Network (VNet) with a single subnet, as she would like for this to be
automated for projects throughout the year.
Learning Objectives
0 of 2 completed
Create a Virtual Network
Do the following to create a virtual network with the Azure CLI:
1. On the main page, select the Azure Cloud Shell button, >_, at the top of
the page.
2. Choose the Bash environment.
3. Select Show advanced settings.
4. Set it up as follows:
o Subscription: Use the lab provided subscription
o Cloud Shell region: Put the same region as your lab's provided
storage account.
o Resource group: Use existing. It will then pre-populate.
o Storage account: Select Use existing
o File share: Select Create new
5. Select Create storage.
6. Once in the shell, enter the following to create the Virtual Network
<TAB> is the Tab key to automatically populate the resource group name.
3. Once in the shell, enter the following to create a subnet for the Virtual
Network you created earlier:
<TAB> is the Tab key to automatically populate the resource group name.
Before We Begin
To get started, we need to log into the Azure Portal using the provided credentials.
1. On the main page, select the Azure Cloud Shell button, >_, at the top of the page.
2. Choose the Bash environment.
3. Select Show advanced settings.
4. Set it up as follows:
o Subscription: Use the lab provided subscription
o Cloud Shell region: Put the same region as your lab's provided storage
account.
o Resource group: Use existing. It will then pre-populate.
o Storage account: Select Use existing
o File share: Select Create new
5. Select Create storage.
6. Once in the shell, enter the following to create the Virtual Network:
Note: <TAB> is pressing the Tab key to populate the resource group name
automatically.
1. In the shell, enter the following to create a subnet for the Virtual Network we
created earlier:
Note: <TAB> is the Tab key to populate the resource group name automatically.
1. Back in the Azure portal, on the All Resources page, select Refresh.
2. Select the virtual network we created.
3. Under the Settings section, select Subnets and check that our subnet exists.
Conclusion
Congratulations! You've completed the lab.