【Azure】Azure 命令行接口 (CLI)
Azure CLI
Auth
- azure login
az login # open brewser to login
az login -u <username> -p <password> # usename and password login
az login --tenant <tenant> # use different tenant login
- switch tenant
az account list --output table # list accounts as table
az account set --subscription "Wilson" # switch others subscriptions
VM
- vm list
List details of Virtual Machines
az vm list --output table # list virtual machines as table
az vm list --output table -d # list virtual machines details as table
az vm list -g ResourceGroup --output table # list virtual machines of ResourceGroup as table
- vm create
Create an Azure Virtual Machine
az vm create -n vm_name -g resource_group --image UbuntuLTS # Create a default Ubuntu VM
az vm create -n vm_name -g resource_group --image my_image # Create a VM from a custom managed image
az vm create -n vm_name -g resource_group --image centos --count 3 # Create multiple VMs(vm_name1, vm_name2, vm_name3)
- az vm restart
Restart a VM.
az vm restart -n vm_name -g resource_group # Restart a VM
az vm restart --ids $(az vm list -g resource_group --query "[].id" -o tsv) # Restart all VMs in a resource group
- az vm update
Update the properties of a VM.
az vm update -n vm_name -g resource_group --set tags.tagName=tag_name # Add or update a tag
az vm update -n vm_name -g resource_group --remove tags.tagName # Remove a tag
- az vm resize
Update a VM's size.
az vm resize -n vm_name -g resource_group --size Standard_DS3_v2 # Resize a VM
az vm resize --size Standard_DS3_v2 --ids $(az vm list -g resource_group --query "[].id" -o tsv) # Resize all VMs in a resource group
- az vm start
Start a stopped VM
az vm start -n vm_name -g resource_group # Start a stopped VM.
az vm start --ids $(az vm list -g resource_group --query "[].id" -o tsv) # Start all VMs in a resource group
- az vm stop
Power off (stop) a running VM.
az vm stop -n vm_name -g resource_group # Power off (stop) a running VM
az vm stop -n vm_name -g resource_group --skip-shutdown # Power off a running VM without shutting down.
az vm stop --ids $(az vm list -g resource_group --query "[].id" -o tsv) # Power off VMs in a resource group
- az vm delete
Delete a VM.
az vm delete -n vm_name -g resource_group --yes # Delete a VM without a prompt for confirmation
az vm delete --ids $(az vm list -g resource_group --query "[].id" -o tsv) # Delete all VMs in a resource group
az webapp
- az webapp browse
Open a web app in a browser.
az webapp browse -n app_name -g resource_group # Open a web app in a browser
- az webapp create
Create a web app.
az webapp create -n app_name -g resource_group -p plan # Create a web app with the default configuration.
az webapp create -n app_name -g resource_group -p plan --runtime "java|11|Java SE|8" # Create a web app with a java|11|Java SE|8 runtime using '|' delimiter
az webapp create -n app_name -g resource_group -p plan -i image_name -s username -w password # Create a web app with an image from a private DockerHub registry.
az webapp create -n app_name -g resource_group -p plan -i myregistry.azurecr.io/docker-image:tag # Create a web app with an image from a private Azure Container Registry.
- az webapp list
List web apps.
az webapp list --query "[?state=='Running']" # List all running web apps.
az webapp list --query "[].{hostName: defaultHostName, state: state}" # List default host name and state for all web apps.
- az webapp show
Get the details of a web app.
az webapp show -n app_name -g resource_group # Get the details of a web app. (autogenerated)
az webapp show -n app_name -g resource_group --output table # List the details of table format
- az webapp ssh
SSH into a web app. (Only Linux App Service Plans supported)
az webapp ssh -n app_name -g resource_group # ssh into a web app
- az webapp start
Start a web app.
az webapp start -n app_name -g resource_group # Start a web app. (autogenerated)
- az webapp stop
Stop a web app.
az webapp stop -n app_name -g resource_group # Stop a web app. (autogenerated)
- az webapp update
Update a web app.
az webapp update -n app_name -g resource_group --set tags.tagName=tagValue # Update the tags of a web app.
az webapp update --https-only true -n app_name -g resource_group # Update a web app. (autogenerated)
- az webapp delete
Delete a web app.
az webapp delete -n app_name -g resource_group # Delete a web app. (autogenerated)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
2020-04-21 【Vue】基础(虚拟DOM & 响应式原理)