Hi all.
I'm trying to learn how to work with Azure through PowerShell (specifically PowerShell 7.2) to manage resources and eventually automate it (I think). It's part of this resource for learning PowerShell, which can be found here: https://docs.microsoft.com/en-us/learn/paths/powershell/
I'm in the final module, where you use PowerShell to manage Azure resources. Think it mentioned that you will automate things as well, but I haven't gotten that far. The first step is to create a VM using New-AzVM and it doesn't work because I get this message:
I got this when doing this step:
New-AzVm -ResourceGroupName learn-10a7edbb-0445-470c-991d-cf39a63aef5b -Name "testvm-eus-01" -Credential (Get-Credential) -Location "East US" -Image UbuntuLTS -OpenPorts 22 -PublicIpAddressName "testvm-01"
I also tried using a private Azure subscription that I just created (and thus I'm not sure if there was any setup step I missed), and entered something like this:
New-AzVm -ResourceGroupName <resource-group-name> -Name <name> -Credential (Get-Credential) -Location <location> -Image UbuntuLTS -OpenPorts <relevant-port-number> -PublicIpAddressName <another-name>
I get the same error again. To my understanding this is the first step, so I don't think I have missed any preceding step, but could of course be wrong (though on my private subscription I did of connect to azure and create a resource group that I was going to use, all through PowerShell and it worked fine). Does anyone have any idea? New to this so I'm not sure where to begin to figure out the problem except asking.
Also my googling has found a similar issue in another place, namely for the Azure CLI version 2.33, but I made sure to update mine and it's on version 2.34.1.
Thanks for any help.




