Microsoft Azure is a cloud computing platform that offers a wide range of services including computing, analytics, storage, and networking. Users can pick and choose from these services to develop and scale new applications or run existing applications in the public cloud.
The Azure Portal is a web-based, unified console that provides an alternative to command-line tools.
Accessing the Portal:
Portal Organization:
Creating a New Resource:
The Azure CLI is a command-line tool for managing Azure resources.
Installation:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Login:
az login
Basic Command Structure:
az <command-group> <command> <options>
Example Commands:
az group list
az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --generate-ssh-keys
az storage account list
Azure PowerShell is a set of cmdlets for managing Azure resources directly from the PowerShell command line.
Installation:
Install-Module -Name Az -AllowClobber -Scope CurrentUser
Login:
Connect-AzAccount
Example Commands:
Get-AzResourceGroup
New-AzVM -ResourceGroupName "myResourceGroup" -Name "myVM" -Location "EastUS" -VirtualNetworkName "myVNet" -SubnetName "mySubnet" -SecurityGroupName "myNSG" -PublicIpAddressName "myPublicIp"
Get-AzStorageAccount
Azure Virtual Machines (VMs) are one of several types of on-demand, scalable computing resources that Azure offers.
Create a VM:
az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys
Connect to a VM:
ssh azureuser@<public-ip-address>
Stop a VM:
az vm stop --resource-group myResourceGroup --name myVM
Start a VM:
az vm start --resource-group myResourceGroup --name myVM
Delete a VM:
az vm delete --resource-group myResourceGroup --name myVM
Azure Storage is Microsoft's cloud storage solution for modern data storage scenarios.
Create a Storage Account:
az storage account create --name mystorageaccount --resource-group myResourceGroup --location eastus --sku Standard_LRS
Create a Container:
az storage container create --name mycontainer --account-name mystorageaccount
Upload a Blob:
az storage blob upload --account-name mystorageaccount --container-name mycontainer --name myblob --file ~/path/to/local/file
List Blobs:
az storage blob list --account-name mystorageaccount --container-name mycontainer --output table
Azure Active Directory (Azure AD) is Microsoft's cloud-based identity and access management service.
Create a New User:
az ad user create --display-name "John Doe" --password "Password123!" --user-principal-name john.doe@contoso.com
List Users:
az ad user list --output table
Create a Group:
az ad group create --display-name "Marketing Group" --mail-nickname "marketing"
Add User to Group:
az ad group member add --group "Marketing Group" --member-id <user-object-id>
Azure SQL Database is a fully managed platform as a service (PaaS) database engine.
Create a SQL Server:
az sql server create --name myserver --resource-group myResourceGroup --location eastus --admin-user myadmin --admin-password Password123!
Create a Database:
az sql db create --resource-group myResourceGroup --server myserver --name mydb --service-objective S0
List Databases:
az sql db list --resource-group myResourceGroup --server myserver
Delete a Database:
az sql db delete --resource-group myResourceGroup --server myserver --name mydb
Azure Functions is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure.
Create a Function App:
az functionapp create --resource-group myResourceGroup --consumption-plan-location eastus --runtime dotnet --functions-version 3 --name myfunctionapp --storage-account mystorageaccount
Deploy a Function:
az functionapp deployment source config-zip --resource-group myResourceGroup --name myfunctionapp --src path/to/function.zip
List Functions:
az functionapp function list --resource-group myResourceGroup --name myfunctionapp
Delete a Function App:
az functionapp delete --resource-group myResourceGroup --name myfunctionapp
ARM templates allow you to define and deploy Azure infrastructure declaratively.
Deploy an ARM Template:
az deployment group create --resource-group myResourceGroup --template-file template.json --parameters parameters.json
Export a Template:
az group export --name myResourceGroup > template.json
Validate a Template:
az deployment group validate --resource-group myResourceGroup --template-file template.json
Azure Virtual Network (VNet) is the fundamental building block for your private network in Azure.
Create a VNet:
az network vnet create --resource-group myResourceGroup --name myVNet --address-prefix 10.0.0.0/16 --subnet-name mySubnet --subnet-prefix 10.0.1.0/24
Create a Network Security Group:
az network nsg create --resource-group myResourceGroup --name myNSG
Add a Security Rule:
az network nsg rule create --resource-group myResourceGroup --nsg-name myNSG --name myNSGRule --protocol tcp --direction inbound --source-address-prefix '*' --source-port-range '*' --destination-address-prefix '*' --destination-port-range 80 --access allow --priority 200
Azure Monitor provides full stack monitoring, smart analytics, and intelligence over your applications and infrastructure.
Create a Log Analytics Workspace:
az monitor log-analytics workspace create --resource-group myResourceGroup --workspace-name myWorkspace
Enable VM Insights:
az vm insight enable --resource-group myResourceGroup --vm myVM
Create an Alert Rule:
az monitor metrics alert create --resource-group myResourceGroup --name myAlert --scopes /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM --condition "avg Percentage CPU > 90" --window-size 5m --evaluation-frequency 1m
2024 © All rights reserved - buraxta.com