< Back

New-AzureRmVMConfig

Tue Jan 29, 2019 9:38 pm

NAME New-AzureRmVMConfig



SYNOPSIS

Creates a configurable virtual machine object.





SYNTAX

New-AzureRmVMConfig [-VMName] <String> [-VMSize] <String> [[-AvailabilitySetId] <String>] [[-LicenseType] <String>] -AssignIdentity

[-DefaultProfile <IAzureContextContainer>] [-Tags <Hashtable>] [-Zone <String[]>] [<CommonParameters>]



New-AzureRmVMConfig [-VMName] <String> [-VMSize] <String> [[-AvailabilitySetId] <String>] [[-LicenseType] <String>] [-IdentityType]

{SystemAssigned | UserAssigned | SystemAssignedUserAssigned | None} [-DefaultProfile <IAzureContextContainer>] [-IdentityId <String[]>] [-Tags

<Hashtable>] [-Zone <String[]>] [<CommonParameters>]





DESCRIPTION

The New-AzureRmVMConfig cmdlet creates a configurable local virtual machine object for Azure. Other cmdlets can be used to configure a virtual

machine object, such as Set-AzureRmVMOperatingSystem, Set-AzureRmVMSourceImage, Add-AzureRmVMNetworkInterface, and Set-AzureRmVMOSDisk.





PARAMETERS

-AssignIdentity [<SwitchParameter>]

Specify the system assigned identity for the virtual machine.



Required? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AvailabilitySetId <String>

Specifies the ID of an availability set. To obtain an availability set object, use the Get-AzureRmAvailabilitySet cmdlet. The availability set

object contains an ID property.



Required? false

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-IdentityId <String[]>

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}'



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-IdentityType <ResourceIdentityType>

The identity of the virtual machine, if configured.



Required? true

Position? 4

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LicenseType <String>

The license type, which is for bringing your own license scenario.



Required? false

Position? 3

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Tags <Hashtable>

The tags attached to the resource.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VMName <String>

Specifies a name for the virtual machine.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VMSize <String>

Specifies the size for the virtual machine.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Zone <String[]>

Specifies the zone list for the virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine







NOTES









Example 1: Create a virtual machine object



PS C:\\> $AvailabilitySet = Get-AzureRmAvailabilitySet -ResourceGroupName "ResourceGroup11" -Name "AvailabilitySet03"

PS C:\\> $VirtualMachine = New-AzureRmVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id



The first command gets the availability set named AvailablitySet03 in the resource group named ResourceGroup11, and then stores that object in the

$AvailabilitySet variable.



The second command creates a virtual machine object, and then stores it in the $VirtualMachine variable. The command assigns a name and size to

the virtual machine. The virtual machine belongs to the availability set stored in $AvailabilitySet.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... rmvmconfig

Update-AzureRmVmss

Set-AzureRmVMOperatingSystem

Set-AzureRmVMSourceImage

Get-AzureRmAvailabilitySet