Posts

Create azure virtual machine with azure cloud shell

Image
    Azure virtual machine with Azure cloud shell To create azure virtual machine with azure cloud shell: az vm create --resource-group RG20 --name "VM1" --image Win2022AzureEditionCore --public-ip-sku Standard   --admin-username "m3652u" We specified the resource-group, the name of the image, the image version, if we need public-ip, (We can see in the output that a public ip has been assigned to this VM) the admin username to access the VM.) As you can see that the password must meet specific requirements. To see more details, about the vm , use "az vm show", below is an example: az vm  show  --name  "VM1" --resource-group "RG20" it is required to specify the resource-group. By executing the above command, you will see all details for the VM. (vm size, storage, network, image type...) To see if a VM is running or not, use the command below az vm get-instance-view --name "VM1" --resource-group "RG20" As you can see in...

Azure Virtual Network with Azure cloud shell

Image
How to create Azure Virtual Network with Azure Cloud Shell ?   Below is an example to start: az network vnet create --resource-group RG20 --name VNET1 --location eastus --address-prefixes 10.10.0.0/16 We specified the resource-group, the location, the name of the VNet and the adress-range. Below is the output The address prefixes is what is called Address space, it is the address range from which we can assign subnets prefixes once we create subnets inside this virtual network. To create a subnet in the VNet: az network vnet subnet create --address-prefixes 10.10.10.0/24 --name SUBNET1 --resource-group RG20 --vnet-name VNET1 The subnet is 10.10.10.0/24, the name of the subnet is SUBNET1. Below are outputs: If we try to create a subnet that is not in the address-range of the VNet, we will receive an error: below is an example: To list virtual networks with azure cloud shell: az network vnet list Update a virtual network with azure cloud shell, example add DNS-Servers to VNet, b...

Resource Groups with Azure cloud shell

Image
Resource Groups with Azure cloud shell. To create a resource group with azure cloud shell: You will need to specify the location (region) you need to specify the name of the resource group Both of these are required parameters. Other optional parameters you can specify. As an example, you can specify the subscription if you have more than one subscription. You can also specify tags if you want to tag a resource group. If you didn't specify a subscription, it will be in the default subscritpion .  Below is an example for creating resource-group. There will be output , see below az group create --name RG99 --location westus To list resource groups: az group list We will try to tag a resource group, but before tagging a resource group, we need to create a tag in azure cloud(the name of the tag we are creating is WHITE): az tag create --name WHITE To tag a resource group: az group update --tags WHITE --name RG99 To delete an azure resource group: (we did a list after deleting, and we ...

How to use Azure Cloud Shell

Image
 H ow to open Azure cloud shell ? In Azure portal click on the top right, the sign >_ (circled in in the screenshot below). This will open a window at the bottom section of the screen with the title Welcome to Azure Cloud Shell In the " Welcome to Azure Cloud Shell " , you can choose either Bash or Powershell.  After we clicked on Bash, we will be prompted to select which subscription we must use. In addition, we can either to use Azure Cloud Shell without storage account, but if we need to persist files between sessions, to mount a storage account. For our test, we did not select to create storage account. Finally, the Bash Azure Cloud shell will be displayed. You can try for example a simple command "hostname" (hostname will display the name of the host on which you are executing the Azure cloud shell commands. Below are screenshots