Guozhen AIGlobal AI field notes and model intelligence

English translation

Create a network security group

Published:

Category: Azure Cloud

Read time: 3 min

Reads: 0

Lesson #11Views are counted together with the original Chinese articleImages are preserved from the source page

AI Article Decision Snapshot

Turn the lesson into workflow, model, budget, and security checks before choosing tools.

Use this quick snapshot before leaving the article. It keeps the next search tied to practical AI software, model/API, cost, privacy, and implementation questions.

Workflow fit

Identify the real job behind the article: coding, research, document review, support, analytics, content, or internal automation.

Model or tool decision

Decide whether the next step is a software shortlist, an AI tool comparison, an API platform choice, or a model benchmark.

Budget and usage signal

Estimate seats, API calls, prompt volume, retries, review time, and fallback work before assuming the workflow is cheap.

Security and privacy review

Check whether source code, customer data, private documents, prompts, logs, or embeddings will enter the AI workflow.

In the previous tutorial, we thoroughly discussed how to create and configure virtual machines (VMs) in Microsoft Azure. In this tutorial, we’ll focus on setting up the virtual network and subnets associated with those VMs. A virtual network is a critical component of the Azure cloud—it enables logical isolation and interconnection of VMs and other resources.

What Is a Virtual Network?

A virtual network is a foundational Azure concept: it functions as a logical network where you can define IP address ranges, subnets, routing rules, and network security policies. It ensures your Azure resources communicate securely and efficiently. When creating a virtual network, consider the following key aspects:

  1. IP Address Range: Define the CIDR (Classless Inter-Domain Routing) block for the entire virtual network.
  2. Subnets: Partition the virtual network into multiple subnets to simplify management and resource allocation.
  3. Network Security Groups (NSGs): Control inbound and outbound traffic to and from subnets.

Creating a Virtual Network

Step 1: Sign in to the Azure Portal

First, sign in to the Azure portal. Ensure you have sufficient permissions to create virtual networks.

Step 2: Create a New Virtual Network

  1. In the left navigation pane of the Azure portal, select Create a resource.

  2. Search for and select Virtual Network.

  3. Click Create, then provide the following information:

    • Name: Enter a name for your virtual network—for example, MyVNet.
    • Address space: Specify an IP address range—for example, 10.0.0.0/16.
    • Subnet: Define a default subnet here—for example:
      • Name: MySubnet
      • Address range: 10.0.0.0/24
  • Select your desired Region, then complete the creation process.

  • Code Example

    Besides using the Azure portal’s graphical interface, you can also create a virtual network via the Azure CLI. Here's an example command:

    az network vnet create \
      --name MyVNet \
      --resource-group MyResourceGroup \
      --address-prefix 10.0.0.0/16 \
      --subnet-name MySubnet \
      --subnet-prefix 10.0.0.0/24
    

    This command creates a new virtual network and subnet within the specified resource group.

    Creating Subnets

    To add additional subnets to an existing virtual network, follow these steps:

    1. In the Azure portal, locate and select your previously created virtual network (MyVNet).

    2. In the left menu of the virtual network blade, select Subnets.

    3. Click + Add subnet, then fill in the following details:

      • Name: For example, MySecondSubnet
      • Address range: For example, 10.0.1.0/24
    4. Click OK to save.

    Code Example

    Using the Azure CLI, you can add a new subnet with the following command:

    az network vnet subnet create \
      --name MySecondSubnet \
      --resource-group MyResourceGroup \
      --vnet-name MyVNet \
      --address-prefix 10.0.1.0/24
    

    Network Security Groups (NSGs)

    To protect your virtual network, use Network Security Groups (NSGs) to restrict inbound and outbound traffic. NSGs can be associated with either subnets or individual VM network interfaces.

    Creating and Configuring an NSG

    1. In the Azure portal, select Create a resource.
    2. Search for Network Security Group, then create one.
    3. Provide basic information such as name and resource group.
    4. After creation, select the NSG and add inbound and outbound rules—specifying priority, port(s), and protocol.

    Code Example

    Below is an example of how to create an NSG and add a rule using the Azure CLI:

    # Create a network security group
    az network nsg create \
      --resource-group MyResourceGroup \
      --name MyNSG
    
    # Add an inbound rule
    az network nsg rule create \
      --resource-group MyResourceGroup \
      --nsg-name MyNSG \
      --name AllowSSH \
      --protocol tcp \
      --priority 100 \
      --destination-port-range 22 \
      --access allow
    

    Summary

    In this tutorial, we covered how to create and configure virtual networks and subnets in Azure—and explored the fundamentals of Network Security Groups (NSGs). By following these steps, you can ensure secure and efficient communication among your VMs while maintaining flexible, business-driven network management.

    In the next tutorial, we’ll explore how to use load balancers and scale sets to manage traffic across multiple VMs—ensuring high availability and dynamic scalability. Stay tuned!

    Apply This Lesson

    Turn this article into AI software, model, API, and security decisions.

    English Article FAQ

    Use this article as evidence before choosing AI tools

    How should I use this AI Tutorials article?

    Use it as the implementation or learning layer, then connect the idea to AI software buyer guides, tool comparisons, benchmarks, API choices, and security checks before making a production decision.

    Is this English article different from the Chinese original?

    The English edition is localized for global AI readers while preserving the original diagrams, screenshots, prompts, code examples, and source context from the Chinese article.

    What should I read after Create a network security group?

    Continue with AI Software Buyer Guides, AI Tools Workbench, Best AI Coding Agents, AI Model Benchmarks, OpenAI vs Anthropic API, or LLM Security Tools depending on the decision you need to make.

    Can this article alone choose an AI product or model?

    No. Treat the article as evidence and context, then validate fit with pricing, privacy requirements, integration effort, benchmark results, workflow tests, and fallback planning.

    Continue

    Keep reading from here

    Browse English site

    Reader Messages

    Reader messages

    Questions, corrections, extra sources, or hands-on results can be left here. No login is required.

    Max 800 characters

    To reduce spam, each message is checked for length, link count, and posting frequency.

    0/800

    Messages

    0 messages
    Loading messages...