Update-AzureRmVM
Updates the state of an Azure virtual machine.
Important
Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.
To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.
Syntax
Update-AzureRmVM
[-ResourceGroupName] <String>
-VM <PSVirtualMachine>
[-Tag <Hashtable>]
[-OsDiskWriteAccelerator <Boolean>]
[-UltraSSDEnabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzureRmVM
[-ResourceGroupName] <String>
-VM <PSVirtualMachine>
[-Tag <Hashtable>]
[-AssignIdentity]
[-OsDiskWriteAccelerator <Boolean>]
[-UltraSSDEnabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzureRmVM
[-ResourceGroupName] <String>
-VM <PSVirtualMachine>
[-Tag <Hashtable>]
-IdentityType <ResourceIdentityType>
[-IdentityId <String[]>]
[-OsDiskWriteAccelerator <Boolean>]
[-UltraSSDEnabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzureRmVM
[-Id] <String>
-VM <PSVirtualMachine>
[-Tag <Hashtable>]
[-OsDiskWriteAccelerator <Boolean>]
[-UltraSSDEnabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-AzureRmVM cmdlet updates the state of an Azure virtual machine to the state of a virtual machine object.
Examples
Example 1: Update a virtual machine
PS C:\> Update-AzureRmVM -ResourceGroupName "ResourceGroup11" -VM $VirtualMachine
This command updates the virtual machine, $VirtualMachine, in ResourceGroup11. The command updates it by using the virtual machine object stored in the $VirtualMachine variable. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet.
Parameters
Run cmdlet in the background and return a Job to track progress.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specify the system assigned identity for the virtual machine.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the Resource ID of the virtual machine.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the list of user identities associated with the virtual machine scale set. The user identity references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity.
Type: | Nullable<T>[ResourceIdentityType] |
Accepted values: | SystemAssigned, UserAssigned, SystemAssignedUserAssigned, None |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies whether WriteAccelerator should be enabled or disabled on the OS disk.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the resource group of the virtual machine.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the resources and resource groups can be tagged with a set of name-value pairs. Adding tags to resources enables you to group resources together across resource groups and to create your own views. Each resource or resource group can have a maximum of 15 tags.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine only if this property is enabled.
Type: | Boolean |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureRmVM cmdlet. This virtual machine object contains the updated state for the virtual machine.
Type: | PSVirtualMachine |
Aliases: | VMProfile |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |