Windows 10에 Azure CLI 설치하고 VM 실행하기


  1. 다운로드하여 설치하기
    https://docs.microsoft.com/ko-kr/cli/azure/install-azure-cli-windows?tabs=azure-cli
  2. Azure Login
    az login
  3. 사용할 수 있는 구독 정보 보기
    az account list -o table
    az account list -o yaml
  4. 기본 구독 설정하기 (##옵션)
    az account set –subscription ‘my-subscription-name’
  5. 이용 가능한 Region 확인하기
    az account list-locations -o table
  6. 새롭게 Resource Group 생성하기
    az group list -o table
    az group create –location eastus –name testRG
  7. VNet 생성하기
    az network vnet list -o table
    az network vnet create -n testVNet -g testRG
  8. 사용가능한 VM 종류 확인하기
    az vm image list -o table
    az vm image list –offer CentOS –all -o table
    az vm image list –offer Ubuntu –all -o table
    az vm image list –offer Win2022Datacenter –all -o table
  9. 사용가능한 VM size 확인하기
    az vm list-sizes -l eastus -o table
  10. Linux VM 생성하기
    az vm list -o table
    az vm create -g testRG -n myubuntu –image UbuntuLTS -l eastus –vnet-name testVNet –admin-username adminuser –admin-password P@ssw0rd1234 –size Standard_DS2_v2 –no-wait
  11. 현재 실행중인 VM size 확인하기
    az vm show -g testRG -n myubuntu -o yaml
    az vm show -g testRG -n myubuntu –query hardwareProfile.vmSize

az vm create -g testRG -n mycentos –image CentOS -l eastus –vnet-name testVNet –admin-username adminuser –admin-password P@ssw0rd1234 –size Standard_DS2_v2 –no-wait

az vm create -g testRG -n mycentos2 –image CentOS -l eastus –generate-ssh-keys

  1. 실행중인 VM의 Public IP 확인하기
    az vm list-ip-addresses -g testRG -n myubuntu -o table
  2. VM에 접속하기
    ssh adminuser@20.127.7.236
  3. VM 멈추고 시작하기
    az vm list -o table
    az vm show -n myubuntu -g testRG -d

az vm stop -g testRG -n myubuntu
az vm start -g testRG -n myubuntu

  1. Resource Group 삭제하기
    az group delete -n testRG –no-wait

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s