Skip to content

VM agent installed even if -ProvisionVMAgent isn't specified, or -ProvisionVMAgent:$false specified #5101

@craiglandis

Description

@craiglandis

Cmdlet(s): Set-AzureRmVMOperatingSystem

PowerShell Version: 5.1.16299.64

Module Version: AzureRM.Compute 4.0.1 (November 2017 release)

OS Version: 10.0.16299.64

Description

-ProvisionVMAgent is a switch, so you would expect that if you don't specify it at all, the value is not True, and the VM agent will not be installed. But if you don't specify it, or if you explicitly specify it as False (-ProvisionVMAgent:$false) - VM agent is still installed.

Compare that to if you do a template deployment where your template specifies "provisionVMAgent": false - VM agent is not installed as expected with a template deployment.

Debug Output: (already provided internally)

Script/Steps for Reproduction

$vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize | Set-AzureRmVMOperatingSystem -Windows -ComputerName $vmName -Credential $cred -ProvisionVMAgent:$false | Set-AzureRmVMSourceImage -PublisherName $publisherName -Offer $offer -Skus $skus -Version $version | Add-AzureRmVMNetworkInterface -Id $nic.Id

New-AzureRmVM -ResourceGroupName $resourceGroupName -Location $location -VM $vmConfig

Example template where "provisionVMAgent": false in the template works as expected in that the VM agent does not get installed -

https://github.com/craiglandis/templates/blob/master/noga.json

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions