I've been trying to solve this problem for almost two days and i need your help.
I created an Azure Pipeline on Azure DEvops that deploys a bunch of resources amongst them an Azure VM (I plan to add later more VMs), and i added an Azure Powershell task to stop the VM right after the Terraform Apply task in the YAML config file of my pipeline.
here is the two YAML tasks of Terraform Apply and Azure Powershell:
I tried the 'Install-Module Az.Compute' but my pipeline displayed this error :
Any suggestions on this issue will be very helpful !
The reason of the error was a typo in the Az Powershell command: Correct command
Get-AzVM | Stop-AzVM -Force
instead of :
Get-AzureVM | Stop-AzVM -Force
When in doubt always visit the Microsoft documentation : Az.Compute Module | Microsoft Learn