Edit

Share via


New-AzVmssConfig

Creates a VMSS configuration object.

Syntax

DefaultParameterSet (Default)

New-AzVmssConfig
    [[-Overprovision] <Boolean>]
    [[-Location] <String>]
    [[-Tag] <Hashtable>]
    [[-SkuName] <String>]
    [[-SkuTier] <String>]
    [[-SkuCapacity] <Int32>]
    [[-UpgradePolicyMode] <UpgradeMode>]
    [[-OsProfile] <VirtualMachineScaleSetOSProfile>]
    [[-StorageProfile] <VirtualMachineScaleSetStorageProfile>]
    [[-NetworkInterfaceConfiguration] <VirtualMachineScaleSetNetworkConfiguration[]>]
    [[-Extension] <PSVirtualMachineScaleSetExtension[]>]
    [-EdgeZone <String>]
    [-SkipExtensionsOnOverprovisionedVMs]
    [-SinglePlacementGroup <Boolean>]
    [-ZoneBalance]
    [-PlatformFaultDomainCount <Int32>]
    [-Zone <String[]>]
    [-PlanName <String>]
    [-PlanPublisher <String>]
    [-PlanProduct <String>]
    [-PlanPromotionCode <String>]
    [-RollingUpgradePolicy <RollingUpgradePolicy>]
    [-EnableAutomaticRepair]
    [-AutomaticRepairGracePeriod <String>]
    [-EnableAutomaticOSUpgrade]
    [-DisableAutoRollback <Boolean>]
    [-EnableUltraSSD]
    [-HealthProbeId <String>]
    [-BootDiagnostic <BootDiagnostics>]
    [-LicenseType <String>]
    [-Priority <String>]
    [-EnableSpotRestore]
    [-SpotRestoreTimeout <String>]
    [-EvictionPolicy <String>]
    [-MaxPrice <Double>]
    [-TerminateScheduledEvents]
    [-TerminateScheduledEventNotBeforeTimeoutInMinutes <Int32>]
    [-ProximityPlacementGroupId <String>]
    [-ScaleInPolicy <String[]>]
    [-EncryptionAtHost]
    [-OrchestrationMode <String>]
    [-CapacityReservationGroupId <String>]
    [-UserData <String>]
    [-AutomaticRepairAction <String>]
    [-BaseRegularPriorityCount <Int32>]
    [-RegularPriorityPercentage <Int32>]
    [-ImageReferenceId <String>]
    [-SharedGalleryImageId <String>]
    [-OSImageScheduledEventEnabled]
    [-OSImageScheduledEventNotBeforeTimeoutInMinutes <String>]
    [-SecurityType <String>]
    [-EnableVtpm <Boolean>]
    [-EnableSecureBoot <Boolean>]
    [-SecurityPostureId <String>]
    [-SecurityPostureExcludeExtension <String[]>]
    [-SkuProfileVmSize <String[]>]
    [-SkuProfileAllocationStrategy <String>]
    [-EnableResilientVMCreate]
    [-EnableResilientVMDelete]
    [-EnableAutomaticZoneRebalance]
    [-AutomaticZoneRebalanceStrategy <String>]
    [-AutomaticZoneRebalanceBehavior <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ExplicitIdentityParameterSet

New-AzVmssConfig
    [[-Overprovision] <Boolean>]
    [[-Location] <String>]
    [[-Tag] <Hashtable>]
    [[-SkuName] <String>]
    [[-SkuTier] <String>]
    [[-SkuCapacity] <Int32>]
    [[-UpgradePolicyMode] <UpgradeMode>]
    [[-OsProfile] <VirtualMachineScaleSetOSProfile>]
    [[-StorageProfile] <VirtualMachineScaleSetStorageProfile>]
    [[-NetworkInterfaceConfiguration] <VirtualMachineScaleSetNetworkConfiguration[]>]
    [[-Extension] <PSVirtualMachineScaleSetExtension[]>]
    -IdentityType <ResourceIdentityType>
    [-EdgeZone <String>]
    [-SkipExtensionsOnOverprovisionedVMs]
    [-SinglePlacementGroup <Boolean>]
    [-ZoneBalance]
    [-PlatformFaultDomainCount <Int32>]
    [-Zone <String[]>]
    [-PlanName <String>]
    [-PlanPublisher <String>]
    [-PlanProduct <String>]
    [-PlanPromotionCode <String>]
    [-RollingUpgradePolicy <RollingUpgradePolicy>]
    [-EnableAutomaticRepair]
    [-AutomaticRepairGracePeriod <String>]
    [-EnableAutomaticOSUpgrade]
    [-DisableAutoRollback <Boolean>]
    [-EnableUltraSSD]
    [-HealthProbeId <String>]
    [-BootDiagnostic <BootDiagnostics>]
    [-LicenseType <String>]
    [-Priority <String>]
    [-EnableSpotRestore]
    [-SpotRestoreTimeout <String>]
    [-EvictionPolicy <String>]
    [-MaxPrice <Double>]
    [-TerminateScheduledEvents]
    [-TerminateScheduledEventNotBeforeTimeoutInMinutes <Int32>]
    [-ProximityPlacementGroupId <String>]
    [-ScaleInPolicy <String[]>]
    [-IdentityId <String[]>]
    [-EncryptionIdentity <String>]
    [-EncryptionAtHost]
    [-OrchestrationMode <String>]
    [-CapacityReservationGroupId <String>]
    [-UserData <String>]
    [-AutomaticRepairAction <String>]
    [-BaseRegularPriorityCount <Int32>]
    [-RegularPriorityPercentage <Int32>]
    [-ImageReferenceId <String>]
    [-SharedGalleryImageId <String>]
    [-OSImageScheduledEventEnabled]
    [-OSImageScheduledEventNotBeforeTimeoutInMinutes <String>]
    [-SecurityType <String>]
    [-EnableVtpm <Boolean>]
    [-EnableSecureBoot <Boolean>]
    [-SecurityPostureId <String>]
    [-SecurityPostureExcludeExtension <String[]>]
    [-SkuProfileVmSize <String[]>]
    [-SkuProfileAllocationStrategy <String>]
    [-EnableResilientVMCreate]
    [-EnableResilientVMDelete]
    [-EnableAutomaticZoneRebalance]
    [-AutomaticZoneRebalanceStrategy <String>]
    [-AutomaticZoneRebalanceBehavior <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The New-AzVmssConfig cmdlet creates a configurable local Virtual Manager Scale Set (VMSS) object.

Use the following cmdlets to configure the VMSS object:

See other cmdlets for virtual machine scale set here.

See Quickstart: Create a virtual machine scale set with Azure PowerShell for tutorial.

Examples

Example 1: Create a VMSS configuration object

$VMSS = New-AzVmssConfig -Location $Loc -SkuCapacity 2 -SkuName "Standard_A0" -UpgradePolicyMode "Automatic" -NetworkInterfaceConfiguration $NetCfg `
            | Add-AzVmssNetworkInterfaceConfiguration -Name "Test" -Primary $True -IPConfiguration $IPCfg `
            | Set-AzVmssOsProfile -ComputerNamePrefix "Test" -AdminUsername $adminUsername -AdminPassword $AdminPassword `
            | Set-AzVmssStorageProfile -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" `
            -ImageReferenceOffer $ImgRef.Offer -ImageReferenceSku $ImgRef.Skus -ImageReferenceVersion $ImgRef.Version `
            -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VHDContainer `
            | Add-AzVmssAdditionalUnattendContent -ComponentName  $AUCComponentName -Content  $AUCContent -PassName  $AUCPassName -SettingName  $AUCSetting;

New-AzVmss -ResourceGroupName $RGName -Name $VMSSName -VirtualMachineScaleSet $VMSS;

This example creates a VMSS configuration object. The first command uses the New-AzVmssConfig cmdlet to create a VMSS configuration object and stores the result in the variable named $VMSS. The second command uses the New-AzVmss cmdlet to create a VMSS that uses the VMSS configuration object created in the first command.

Example 2

Creates a VMSS configuration object. (autogenerated)

New-AzVmssConfig -Location <String> -Overprovision $false -SkuCapacity 2 -SkuName 'Standard_A0' -SecurityType "Standard" -Tag @{key0="value0";key1=$null;key2="value2"} -UpgradePolicyMode Automatic;

Example 3

Creates a VMSS configuration object. (autogenerated)

New-AzVmssConfig -Location <String> -SkuCapacity 2 -SkuName 'Standard_A0' -UpgradePolicyMode Automatic -IdentityType SystemAssigned -SecurityType "Standard";

Example 4: Create a VMSS with the OS Image Scheduled Events enabled

$publisher = "MicrosoftWindowsServer";
$offer = "WindowsServer";
$imgSku = "2019-Datacenter";
$version = "latest";
$vmssName = 'vmss' + $rgname;
$vmssSku = "Standard_D2s_v3";
$vmssname = "vmss" + $rgname;
$domainNameLabel = "d" + $rgname;
$securityTypeStnd = "Standard";
$username = <Username>;
$securePassword = ConvertTo-SecureString -String "****" -AsPlainText -Force;

$credential = New-Object System.Management.Automation.PSCredential ($username, $securePassword);

# SRP
$stoname = 'sto' + $rgname;
$stotype = 'Standard_GRS';
New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype;
$stoaccount = Get-AzStorageAccount -ResourceGroupName $rgname -Name $stoname;

# NRP
$subnet = New-AzVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
$vnet = New-AzVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet;
$vnet = Get-AzVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname;
$subnetId = $vnet.Subnets[0].Id;

# Create VMSS with managed disk
$timeoutValue = 'PT15M';
$ipCfg = New-AzVmssIpConfig -Name 'test' -SubnetId $subnetId;
$vmss = New-AzVmssConfig -Location $loc -SkuCapacity 2 -SkuName $vmssSku -OSImageScheduledEventEnabled -OSImageScheduledEventNotBeforeTimeoutInMinutes $timeoutValue -UpgradePolicyMode "Automatic" -SecurityType $securityTypeStnd `
    | Add-AzVmssNetworkInterfaceConfiguration -Name 'test' -Primary $true -IPConfiguration $ipCfg `
    | Set-AzVmssOsProfile -ComputerNamePrefix 'test' -AdminUsername $username -AdminPassword $password `
    | Set-AzVmssStorageProfile -OsDiskCreateOption 'FromImage' -OsDiskCaching 'None' `
       -ImageReferenceOffer $offer -ImageReferenceSku $imgSku -ImageReferenceVersion $version `
       -ImageReferencePublisher $publisher;

$result = New-AzVmss -ResourceGroupName $rgname -Name $vmssName -VirtualMachineScaleSet $vmss;

$vmss = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName;
# $vmss.VirtualMachineProfile.ScheduledEventsProfile.OsImageNotificationProfile.Enable is the OSImageScheduledEventEnabled flag.
# $vmss.VirtualMachineProfile.ScheduledEventsProfile.OsImageNotificationProfile.NotBeforeTimeout is the timeout value 'PT15M'.

Example 5: Create a Vmss with the security type TrustedLaunch

$rgname = "rganme";
 $loc = "eastus";
 New-AzResourceGroup -Name $rgname -Location $loc -Force;
# VMSS Profile & Hardware requirements for the TrustedLaunch default behavior.
$vmssSize = 'Standard_D4s_v3';
$PublisherName = "MicrosoftWindowsServer";
$Offer = "WindowsServer";
$SKU = "2016-datacenter-gensecond";
$securityType = "TrustedLaunch";
$enable = $true;
$disable = $false;
$extDefaultName = "GuestAttestation";
$vmGADefaultIdentity = "SystemAssigned";

# NRP
$subnet = New-AzVirtualNetworkSubnetConfig -Name ('subnet' + $rgname) -AddressPrefix "10.0.0.0/24";
$vnet = New-AzVirtualNetwork -Force -Name ('vnet' + $rgname) -ResourceGroupName $rgname -Location $loc -AddressPrefix "10.0.0.0/16" -Subnet $subnet;
$vnet = Get-AzVirtualNetwork -Name ('vnet' + $rgname) -ResourceGroupName $rgname;
$subnetId = $vnet.Subnets[0].Id;

# New VMSS Parameters
$vmssName1 = 'vmss1' + $rgname;
$vmssName2 = 'vmss2' + $rgname;
$vmssType = 'Microsoft.Compute/virtualMachineScaleSets';
$adminUsername = <Username>;
$adminPassword = ConvertTo-SecureString -String "****" -AsPlainText -Force;
$imgRef = New-Object -TypeName 'Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineImage';
$imgRef.PublisherName = $PublisherName;
$imgRef.Offer = $Offer;
$imgRef.Skus = $SKU;
$imgRef.Version = "latest";
$ipCfg = New-AzVmssIpConfig -Name 'test' -SubnetId $subnetId;

$vmss = New-AzVmssConfig -Location $loc -SkuCapacity 2 -SkuName $vmssSize -UpgradePolicyMode 'Manual' `
    | Add-AzVmssNetworkInterfaceConfiguration -Name 'test' -Primary $true -IPConfiguration $ipCfg `
    | Set-AzVmssOsProfile -ComputerNamePrefix 'test' -AdminUsername $adminUsername -AdminPassword $adminPassword `
    | Set-AzVmssStorageProfile -OsDiskCreateOption 'FromImage' -OsDiskCaching 'ReadOnly' `
    -ImageReferenceOffer $imgRef.Offer -ImageReferenceSku $imgRef.Skus -ImageReferenceVersion $imgRef.Version `
    -ImageReferencePublisher $imgRef.PublisherName;

# VMSS Creation using VMSSConfig for Trusted Launch SecurityType
$vmss1 = Set-AzVmssSecurityProfile -VirtualMachineScaleSet $vmss -SecurityType $securityType;
$result = New-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName1 -VirtualMachineScaleSet $vmss1;
$vmssGet = Get-AzVmss -ResourceGroupName $rgname -VMScaleSetName $vmssName1;

# Validate that for -SecurityType "TrustedLaunch" "-Vtpm" and -"SecureBoot" are "Enabled/true"
#$vmssGet.VirtualMachineProfile.SecurityProfile.UefiSettings.VTpmEnabled $true;
#$vmssGet.VirtualMachineProfile.SecurityProfile.UefiSettings.SecureBootEnabled $true;

This example Creates a new VMSS using VMSSConfig object for the Trusted Launch Security Type and validates flags SecureBoot and Vtpm as True by default.

Parameters

-AutomaticRepairAction

Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale set. Default value is replace.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AutomaticRepairGracePeriod

The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-AutomaticZoneRebalanceBehavior

Specifies the behavior for Automatic Zone Rebalance.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AutomaticZoneRebalanceStrategy

Specifies the strategy for Automatic Zone Rebalance.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BaseRegularPriorityCount

Specifies the minimum number of VMs that must be of Regular priority as a VMSS Flex instance scales out. This parameter is only valid for VMSS instances with Flexible OrchestrationMode.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BootDiagnostic

Specifies the virtual machine scale set boot diagnostics profile.

Parameter properties

Type:BootDiagnostics
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-CapacityReservationGroupId

Id of the capacity reservation Group that is used to allocate.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableAutoRollback

Disable Auto Rollback for Auto OS Upgrade Policy

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EdgeZone

Sets the edge zone name. If set, the query will be routed to the specified edgezone instead of the main region.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableAutomaticOSUpgrade

Whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the image becomes available.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AutoOSUpgrade

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableAutomaticRepair

Enables automatic repairs on the virtual machine scale set.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableAutomaticZoneRebalance

Specifies whether Automatic Zone Rebalance should be enabled on the virtual machine scale set. The default value is false.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableResilientVMCreate

Specifies whether resilient VM creation should be enabled on the virtual machine scale set. The default value is false.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableResilientVMDelete

Specifies whether resilient VM deletion should be enabled on the virtual machine scale set. The default value is false.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableSecureBoot

Specifies whether secure boot should be enabled on the virtual machine.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableSpotRestore

Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableUltraSSD

Enables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the virtual machine scale set. Managed disks with storage account type UltraSSD_LRS can be added to a VMSS only if this property is enabled.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableVtpm

Specifies whether vTPM should be enabled on the virtual machine.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EncryptionAtHost

This parameter will enable the encryption for all the disks including Resource/Temp disk at host itself. Default: The Encryption at host will be disabled unless this property is set to true for the resource.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EncryptionIdentity

Specifies the user identity associated with the virtual machine.That identity will be used for Azure Disk Encryption.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ExplicitIdentityParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EvictionPolicy

Specifies the eviction policy for the virtual machines in the scale set.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Extension

Specifies the extension information object for the VMSS. You can use the Add-AzVmssExtension cmdlet to add this object.

Parameter properties

Type:

PSVirtualMachineScaleSetExtension[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:10
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-HealthProbeId

Specifies the ID of a load balancer probe used to determine the health of an instance in the virtual machine scale set. HealthProbeId is in the form of '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IdentityId

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ExplicitIdentityParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IdentityType

Specifies the type of identity used for the virtual machine scale set. The type 'SystemAssignedUserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. The acceptable values for this parameter are:

  • SystemAssigned
  • UserAssigned
  • SystemAssignedUserAssigned
  • None

Parameter properties

Type:

Nullable<T>[ResourceIdentityType]

Default value:None
Accepted values:SystemAssigned, UserAssigned, SystemAssignedUserAssigned, None
Supports wildcards:False
DontShow:False

Parameter sets

ExplicitIdentityParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ImageReferenceId

Specified the gallery image unique id for vmss deployment. This can be fetched from gallery image GET call.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LicenseType

Specify the license type, which is for bringing your own license scenario.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Location

Specifies the Azure location where the VMSS is created.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MaxPrice

Specifies the maximum price you are willing to pay for a Spot VM/VMSS. This price is in US Dollars. This price will be compared with the current Spot price for the VM size. Also, the prices are compared at the time of create/update of Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Spot price. The maxPrice will also be used for evicting a Spot VM/VMSS if the current Spot price goes beyond the maxPrice after creation of VM/VMSS. Possible values are: any decimal value greater than zero. Example: 0.01538. -1 indicates that the Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

Parameter properties

Type:Double
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-NetworkInterfaceConfiguration

Specifies the network profile object that contains the networking properties for the VMSS configuration. You can use the Add-AzVmssNetworkInterfaceConfiguration cmdlet to add this object.

Parameter properties

Type:

VirtualMachineScaleSetNetworkConfiguration[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:9
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-OrchestrationMode

Specifies the orchestration mode for the virtual machine scale set. Possible values: Uniform, Flexible

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-OSImageScheduledEventEnabled

Specifies whether the OS Image Scheduled event is enabled or disabled.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OSImageScheduledEventNotBeforeTimeoutInMinutes

The length of time a virtual machine being reimaged or having its OS upgraded will have to potentially approve the OS Image Scheduled Event before the event is auto approved (timed out). The configuration is specified in ISO 8601 format, with the value set to 15 minutes (PT15M).

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OsProfile

Specifies the operating system profile object that contains the operating system properties for the VMSS configuration. You can use the Set-AzVmssOsProfile cmdlet to set this object.

Parameter properties

Type:VirtualMachineScaleSetOSProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:7
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Overprovision

Indicates whether the cmdlet overprovisions the VMSS.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PlanName

Specifies the plan name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PlanProduct

Specifies the plan product.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PlanPromotionCode

Specifies the plan promotion code.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PlanPublisher

Specifies the plan publisher.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PlatformFaultDomainCount

Fault Domain count for each placement group.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Priority

The priority for the virtual machien in the scale set. Only supported values are 'Regular', 'Spot' and 'Low'. 'Regular' is for regular virtual machine. 'Spot' is for spot virtual machine. 'Low' is also for spot virtual machine but is replaced by 'Spot'. Please use 'Spot' instead of 'Low'.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ProximityPlacementGroupId

The resource id of the Proximity Placement Group to use with this scale set.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RegularPriorityPercentage

Specifies the desired percentage of VMs, after the BaseRegularCount has been met, that are of Regular priority as the VMSS Flex instance scales out. This property is only valid for VMSS instances with Flexible OrchestrationMode.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RollingUpgradePolicy

Specifies the rolling upgrade policy.

Parameter properties

Type:RollingUpgradePolicy
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ScaleInPolicy

The rules to be followed when scaling-in a virtual machine scale set. Possible values are: 'Default', 'OldestVM' and 'NewestVM'. 'Default' when a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in. 'OldestVM' when a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal. 'NewestVM' when a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SecurityPostureExcludeExtension

List of virtual machine extensions to exclude when applying the security posture.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SecurityPostureId

The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SecurityType

Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. Default: UefiSettings will not be enabled unless this property is set.

Parameter properties

Type:String
Default value:None
Accepted values:TrustedLaunch, ConfidentialVM, Standard
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SharedGalleryImageId

Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SinglePlacementGroup

Specifies the single placement group.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SkipExtensionsOnOverprovisionedVMs

Specifies that the extensions do not run on the extra overprovisioned VMs.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SkuCapacity

Specifies the number of instances in the VMSS.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SkuName

Specifies the size of all the instances of VMSS. Get-AzComputeResourceSku can be used to find out available sizes for your subscription and region.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AccountType

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SkuProfileAllocationStrategy

Allocation strategy for the SKU profile.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SkuProfileVmSize

Array of VM sizes for the scale set.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SkuTier

Specifies the tier of VMSS. The acceptable values for this parameter are:

  • Standard
  • Basic

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SpotRestoreTimeout

Specifies timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-StorageProfile

Specifies the storage profile object that contains the disk properties for the VMSS configuration. You can use the Set-AzVmssStorageProfile cmdlet to set this object.

Parameter properties

Type:VirtualMachineScaleSetStorageProfile
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:8
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Tag

Key-value pairs in the form of a hash table. For example: @{key0="value0";key1=$null;key2="value2"}

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TerminateScheduledEventNotBeforeTimeoutInMinutes

Configurable length of time (in minutes) a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out).

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TerminateScheduledEvents

Enable the Terminate Scheduled events

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-UpgradePolicyMode

Specified the mode of an upgrade to virtual machines in the scale set. The acceptable values for this parameter are:

  • Automatic
  • Manual

Parameter properties

Type:

Nullable<T>[UpgradeMode]

Default value:None
Accepted values:Automatic, Manual, Rolling
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-UserData

UserData for the VM, which will be base-64 encoded. Customer should not pass any secrets in here.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Zone

Specifies the zone list for the virtual machine scale set.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ZoneBalance

Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Nullable<T>

String

Hashtable

Int32

Nullable<T>

VirtualMachineScaleSetOSProfile

VirtualMachineScaleSetStorageProfile

VirtualMachineScaleSetNetworkConfiguration

VirtualMachineScaleSetExtension

String

RollingUpgradePolicy

SwitchParameter

BootDiagnostics

Nullable<T>

Outputs

PSVirtualMachineScaleSet