Ethan's Blog


  • Home

  • Archives

  • Tags

  • Search

Virtual Machine Networking

Posted on 2022-04-20

Azure Virtual Machine depends on virtual networking, and during the creation process, we need to define the network settings.

Create VMs

When a VM is created, a Network Interface Card (NIC) is created in the process. An NIC is used as a sort of interconnection between the VM and the VNet. A NIC is assigned a private IP address by the network. As an NIC is associated with both the VM and the VNet, the IP address is used by the VM. Using this IP address, the VM can communicate over a private network with other VMs (or other Azure resources) on the same network.

Additionally, NICs and VMs can be assigned public IP addresses as well. A public address can be used to communicate with the VM over the internet, either to access services or to manage the VM.

View VM network settings

After an Azure VM is created, we can review the network settings in the VM pane. Networking information is displayed in several places, including in the VM’s network settings. Additionally, each Azure resource has a separate pane and exists as an individual resource, so we can view these settings in multiple places. However, the most complete picture of VM network settings can be found in the VM pane and the NIC pane.

Read more »

Azure Virtual Network

Posted on 2022-04-20

Azure Virtual Network represents your local network in the cloud. It enables other Azure resources to communicate over a secure private network without exposing endpoints over the internet.

Create a VNet

We deploy VNets to resource group under subscription in the Azure data center that we choose. Region and Subscription are important parameters; we will only be able to attach Azure resources to this VNet if they are in the same subscription and region as the Azure data center.

The address space option defines the number of IP addresses that will be available for our network. It uses the Classless Inter-Domain Routing (CIDR) format and the largest range we can choose is /8. In the portal, we need to create an initial subnet and define the subnet address range. The smallest subnet allowed is /29 and the largest is /8 (however, this cannot be larger than the VNet range). For reference, the range 10.0.0.0/8 will create an address range of 167772115 IP addresses (from 10.0.0.0 to 10.255.255.255) and 10.0.0.0/29 will create a range of 8 IP addresses (from 10.0.0.0 to 10.0.0.7).

Add a subnet

In addition to adding subnets while creating a VNet, we can add additional subnets to our network at any time. A single VNet can have multiple subnets defined. Subnets cannot overlap and must be in the range of the VNet address range. For each subnet, four IP addresses are saved for Azure management and cannot be used. Depending on the network settings, we can define the communication rules between subnets in the VNet.

Read more »

Bump Python SDK

Posted on 2022-04-11

Update corresponding versions

Update package name + package version:

  • setup.py;
  • requirements.py3.Linux.txt;
  • requirements.py3.Darwin.txt;
  • requirements.py3.Windows.txt;

Update resource type + api version:

  • _shared.py (latest);

Setup development environment

Install expected Python packages:

1
$ azdev setup -c -r ./azure-cli-extensions
Read more »

Generate CLI from Swagger

Posted on 2022-04-08

It’s always good to start with a command like that:

1
$ autorest --version=3.0.6370 --az --use=@autorest/az@latest ../azure-rest-api-specs/specification/dnsresolver/resource-manager/readme.md --azure-cli-extension-folder=./azure-cli-extensions

Make sure you have these specific versions installed:

AutoRest Core AutoRest CLI Node.js
3.0.6370 3.5.1 12.20

Errors you might encounter nowadays:

  • ERROR: Schema violation: Additional properties not allowed: x-ms-identifiers
    1. Append --pass-thru:schema-validator-swagger to the command;
  • AttributeError: module ‘mistune’ has no attribute ‘BlockGrammar’
    1. Active the venv within ~/.autorest/@autorest_python@5.4.0/node_modules/@autorest/python;
    2. Execute pip install mistune==0.8.4;
  • ImportError: cannot import name ‘_unicodefun’ from ‘click’
    1. Active the venv within ~/.autorest/@autorest_az@1.8.0/node_modules/@autorest/az;
    2. Execute pip install click==8.0.2;

One more thing, it’s a good practice to clean up AutoRest extensions by:

1
$ autorest --reset
Read more »

Contribute to Azure CLI

Posted on 2022-04-04

What is Azure CLI?

Azure CLI is a command-line tool to create and manage resources. You interact with Azure by running commands in a terminal or writing scripts to automate tasks. Azure CLI interacts with the Azure Resource Manager (ARM) service, which is the management layer to interact with resources in your account.

Prerequisites

Fork and clone the repositories you wish to develop for:

1
2
$ git clone https://github.com/necusjz/azure-cli.git
$ git clone https://github.com/necusjz/azure-cli-extensions.git

Add or change the upstream:

1
2
$ git remote add upstream https://github.com/Azure/azure-cli.git
$ git remote set-url upstream https://github.com/Azure/azure-cli.git

Install and setup azdev:

1
2
$ pip install azdev
$ azdev setup -c -r ./azure-cli-extensions

List what extensions are currently visible to your development environment:

1
2
$ azdev extension list -o table
$ azdev extension add {}

Publish extensions:

1
$ azdev extension publish {} --storage-account {} --storage-container {} --storage-account-key {}
1…101112…55
necusjz

necusjz

274 posts
16 tags
© 2016 - 2025 necusjz
Powered by Hexo
Theme - NexT.Mist