DEV Community

Cover image for CLI command for creating Azure Resources
Abass Hamzat
Abass Hamzat

Posted on

1

CLI command for creating Azure Resources

  • Created VM , System assigned Identity using CLI
  1. Creating ResourceGR
  2. Create VM with system assigned ID az vm create \ --resource-group userRG \ --name userVM \ --image ubuntuLTS \ --generate-ssh-key \ --assign-identity \ --admin-username user \ --admin-password pass1234@ -----------------------------------------------------------------------------------------
  3. Created VM, User Assigned Identity using CLI
  4. Create ResourceRG (If you've not created before)
  5. Create the User Identity to be assigned to the VM
    az identity create --name bruno123 --resource-group saviourRG

  6. Create VM the user Identity assigned
    az vm create \
    --resource-group userRG \
    --name userVM --image ubuntuLTS \
    --generate-ssh-key \
    --assign-identity bruno123 \
    --admin-username user \
    --admin-password pass1234@


using variable to create KeyVault
myKeyVault=az204vault-$RANDOM
myLocation=

Creating Keyvault
az keyvault create --name $myKeyVault --resource-group az204-vault-rg --location $myLocation
Creating secretkey
az keyvault secret set --vault-name $myKeyVault --name "ExamplePassword" --value "hVFkk965BuUv"
To see check the secret
az keyvault secret show --name "ExamplePassword" --vault-name $myKeyVault


  • Delete Resource Groups Created (Cleaning UP)

    az group delete --name
    az group delete --name elodemoRG --no-wait
    az group delete --name demokeyvault --no-wait
    az group delete --name NetworkWatcherRG --no-wait


Link for online terminal for practice

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay