你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Compute virtualMachineScaleSets 2022-03-01

Bicep 资源定义

可以使用面向以下操作部署 virtualMachineScaleSets 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Compute/virtualMachineScaleSets 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Compute/virtualMachineScaleSets@2022-03-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  sku: {
    capacity: int
    name: 'string'
    tier: 'string'
  }
  extendedLocation: {
    name: 'string'
    type: 'EdgeZone'
  }
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
      {customized property}: {}
    }
  }
  plan: {
    name: 'string'
    product: 'string'
    promotionCode: 'string'
    publisher: 'string'
  }
  properties: {
    additionalCapabilities: {
      hibernationEnabled: bool
      ultraSSDEnabled: bool
    }
    automaticRepairsPolicy: {
      enabled: bool
      gracePeriod: 'string'
      repairAction: 'string'
    }
    doNotRunExtensionsOnOverprovisionedVMs: bool
    hostGroup: {
      id: 'string'
    }
    orchestrationMode: 'string'
    overprovision: bool
    platformFaultDomainCount: int
    proximityPlacementGroup: {
      id: 'string'
    }
    scaleInPolicy: {
      forceDeletion: bool
      rules: [
        'string'
      ]
    }
    singlePlacementGroup: bool
    spotRestorePolicy: {
      enabled: bool
      restoreTimeout: 'string'
    }
    upgradePolicy: {
      automaticOSUpgradePolicy: {
        disableAutomaticRollback: bool
        enableAutomaticOSUpgrade: bool
        useRollingUpgradePolicy: bool
      }
      mode: 'string'
      rollingUpgradePolicy: {
        enableCrossZoneUpgrade: bool
        maxBatchInstancePercent: int
        maxUnhealthyInstancePercent: int
        maxUnhealthyUpgradedInstancePercent: int
        pauseTimeBetweenBatches: 'string'
        prioritizeUnhealthyInstances: bool
      }
    }
    virtualMachineProfile: {
      applicationProfile: {
        galleryApplications: [
          {
            configurationReference: 'string'
            enableAutomaticUpgrade: bool
            order: int
            packageReferenceId: 'string'
            tags: 'string'
            treatFailureAsDeploymentFailure: bool
          }
        ]
      }
      billingProfile: {
        maxPrice: json('decimal-as-string')
      }
      capacityReservation: {
        capacityReservationGroup: {
          id: 'string'
        }
      }
      diagnosticsProfile: {
        bootDiagnostics: {
          enabled: bool
          storageUri: 'string'
        }
      }
      evictionPolicy: 'string'
      extensionProfile: {
        extensions: [
          {
            name: 'string'
            properties: {
              autoUpgradeMinorVersion: bool
              enableAutomaticUpgrade: bool
              forceUpdateTag: 'string'
              protectedSettings: any()
              protectedSettingsFromKeyVault: {
                secretUrl: 'string'
                sourceVault: {
                  id: 'string'
                }
              }
              provisionAfterExtensions: [
                'string'
              ]
              publisher: 'string'
              settings: any()
              suppressFailures: bool
              type: 'string'
              typeHandlerVersion: 'string'
            }
          }
        ]
        extensionsTimeBudget: 'string'
      }
      hardwareProfile: {
        vmSizeProperties: {
          vCPUsAvailable: int
          vCPUsPerCore: int
        }
      }
      licenseType: 'string'
      networkProfile: {
        healthProbe: {
          id: 'string'
        }
        networkApiVersion: '2020-11-01'
        networkInterfaceConfigurations: [
          {
            id: 'string'
            name: 'string'
            properties: {
              deleteOption: 'string'
              dnsSettings: {
                dnsServers: [
                  'string'
                ]
              }
              enableAcceleratedNetworking: bool
              enableFpga: bool
              enableIPForwarding: bool
              ipConfigurations: [
                {
                  id: 'string'
                  name: 'string'
                  properties: {
                    applicationGatewayBackendAddressPools: [
                      {
                        id: 'string'
                      }
                    ]
                    applicationSecurityGroups: [
                      {
                        id: 'string'
                      }
                    ]
                    loadBalancerBackendAddressPools: [
                      {
                        id: 'string'
                      }
                    ]
                    loadBalancerInboundNatPools: [
                      {
                        id: 'string'
                      }
                    ]
                    primary: bool
                    privateIPAddressVersion: 'string'
                    publicIPAddressConfiguration: {
                      name: 'string'
                      properties: {
                        deleteOption: 'string'
                        dnsSettings: {
                          domainNameLabel: 'string'
                        }
                        idleTimeoutInMinutes: int
                        ipTags: [
                          {
                            ipTagType: 'string'
                            tag: 'string'
                          }
                        ]
                        publicIPAddressVersion: 'string'
                        publicIPPrefix: {
                          id: 'string'
                        }
                      }
                      sku: {
                        name: 'string'
                        tier: 'string'
                      }
                    }
                    subnet: {
                      id: 'string'
                    }
                  }
                }
              ]
              networkSecurityGroup: {
                id: 'string'
              }
              primary: bool
            }
          }
        ]
      }
      osProfile: {
        adminPassword: 'string'
        adminUsername: 'string'
        allowExtensionOperations: bool
        computerNamePrefix: 'string'
        customData: 'string'
        linuxConfiguration: {
          disablePasswordAuthentication: bool
          patchSettings: {
            assessmentMode: 'string'
            automaticByPlatformSettings: {
              rebootSetting: 'string'
            }
            patchMode: 'string'
          }
          provisionVMAgent: bool
          ssh: {
            publicKeys: [
              {
                keyData: 'string'
                path: 'string'
              }
            ]
          }
        }
        secrets: [
          {
            sourceVault: {
              id: 'string'
            }
            vaultCertificates: [
              {
                certificateStore: 'string'
                certificateUrl: 'string'
              }
            ]
          }
        ]
        windowsConfiguration: {
          additionalUnattendContent: [
            {
              componentName: 'Microsoft-Windows-Shell-Setup'
              content: 'string'
              passName: 'OobeSystem'
              settingName: 'string'
            }
          ]
          enableAutomaticUpdates: bool
          patchSettings: {
            assessmentMode: 'string'
            automaticByPlatformSettings: {
              rebootSetting: 'string'
            }
            enableHotpatching: bool
            patchMode: 'string'
          }
          provisionVMAgent: bool
          timeZone: 'string'
          winRM: {
            listeners: [
              {
                certificateUrl: 'string'
                protocol: 'string'
              }
            ]
          }
        }
      }
      priority: 'string'
      scheduledEventsProfile: {
        terminateNotificationProfile: {
          enable: bool
          notBeforeTimeout: 'string'
        }
      }
      securityProfile: {
        encryptionAtHost: bool
        securityType: 'string'
        uefiSettings: {
          secureBootEnabled: bool
          vTpmEnabled: bool
        }
      }
      storageProfile: {
        dataDisks: [
          {
            caching: 'string'
            createOption: 'string'
            deleteOption: 'string'
            diskIOPSReadWrite: int
            diskMBpsReadWrite: int
            diskSizeGB: int
            lun: int
            managedDisk: {
              diskEncryptionSet: {
                id: 'string'
              }
              securityProfile: {
                diskEncryptionSet: {
                  id: 'string'
                }
                securityEncryptionType: 'string'
              }
              storageAccountType: 'string'
            }
            name: 'string'
            writeAcceleratorEnabled: bool
          }
        ]
        imageReference: {
          communityGalleryImageId: 'string'
          id: 'string'
          offer: 'string'
          publisher: 'string'
          sharedGalleryImageId: 'string'
          sku: 'string'
          version: 'string'
        }
        osDisk: {
          caching: 'string'
          createOption: 'string'
          deleteOption: 'string'
          diffDiskSettings: {
            option: 'Local'
            placement: 'string'
          }
          diskSizeGB: int
          image: {
            uri: 'string'
          }
          managedDisk: {
            diskEncryptionSet: {
              id: 'string'
            }
            securityProfile: {
              diskEncryptionSet: {
                id: 'string'
              }
              securityEncryptionType: 'string'
            }
            storageAccountType: 'string'
          }
          name: 'string'
          osType: 'string'
          vhdContainers: [
            'string'
          ]
          writeAcceleratorEnabled: bool
        }
      }
      userData: 'string'
    }
    zoneBalance: bool
  }
  zones: [
    'string'
  ]
}

属性值

virtualMachineScaleSets

名称 说明
name 资源名称 字符串 (必需)

字符限制:1-15 (Windows)
1-64 (Linux)



有效字符:
不得使用空格、控制字符或以下字符:
~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \ | ; : . ' " , < > / ?

不能以下划线开头。 不能以句点或连字符结尾。
location 资源位置 字符串 (必需)
标记 资源标记 标记名称和值的字典。 请参阅 模板中的标记
sku 虚拟机规模集 SKU。 Sku
extendedLocation 虚拟机规模集的扩展位置。 ExtendedLocation
标识 虚拟机规模集的标识(如果已配置)。 VirtualMachineScaleSetIdentity
plan 指定用于创建虚拟机的市场映像的相关信息。 此元素仅用于市场映像。 必须先启用该映像以供编程使用,然后才能从 API 使用市场映像。 在Azure 门户中,找到要使用的市场映像,然后单击“想要以编程方式部署”“入门”->。 输入任何所需信息,然后单击“ 保存”。 规划
properties 描述虚拟机规模集的属性。 VirtualMachineScaleSetProperties
zones 虚拟机规模集区域。 注意:只能在创建规模集时设置可用性区域 string[]

ExtendedLocation

名称 说明
name 扩展位置的名称。 字符串
type 扩展位置的类型。 “EdgeZone”

VirtualMachineScaleSetIdentity

名称 说明 Value
type 用于虚拟机规模集的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”将从虚拟机规模集中删除任何标识。 “None”
“SystemAssigned”
“SystemAssigned, UserAssigned”
“UserAssigned”
userAssignedIdentities 与虚拟机规模集关联的用户标识列表。 用户标识字典键引用将是 ARM 资源 ID,格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 UserAssignedIdentities

UserAssignedIdentities

名称 说明
{customized property} UserAssignedIdentitiesValue
{customized property} UserAssignedIdentitiesValue

UserAssignedIdentitiesValue

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

计划

名称 说明
name 计划 ID。 字符串
product 指定市场中映像的产品。 此值与 imageReference 元素下的 Offer 相同。 字符串
promotionCode 促销代码。 字符串
发布者 发布者 ID。 字符串

VirtualMachineScaleSetProperties

名称 说明
additionalCapabilities 指定在虚拟机规模集中的虚拟机上启用或禁用的其他功能。 例如:虚拟机是否能够支持使用UltraSSD_LRS存储帐户类型附加托管数据磁盘。 AdditionalCapabilities
automaticRepairsPolicy 自动修复策略。 AutomaticRepairsPolicy
doNotRunExtensionsOnOverprovisionedVMs 启用过度预配后,扩展仅在最终保留的请求数目的 VM 上启动。 因此,此属性将确保扩展不会在额外的过度预配的 VM 上运行。 bool
hostGroup 指定有关虚拟机规模集驻留的专用主机组的信息。

最低 API 版本:2020-06-01。
SubResource
orchestrationMode 指定虚拟机规模集的业务流程模式。 “灵活”
“Uniform”
过度预配 指定是否应过度预配虚拟机规模集。 bool
platformFaultDomainCount 每个放置组的容错域计数。 int
proximityPlacementGroup 指定虚拟机规模集应分配到的邻近放置组的相关信息。

最低 API 版本:2018-04-01。
SubResource
scaleInPolicy 指定在虚拟机规模集中缩放虚拟机时应用的策略。 ScaleInPolicy
singlePlacementGroup 如果为 true,则会将规模集限制为单个放置组,最大大小为 100 个虚拟机。 注意:如果 singlePlacementGroup 为 true,则可能会将其修改为 false。 但是,如果 singlePlacementGroup 为 false,则不可将其修改为 true。 bool
spotRestorePolicy 指定虚拟机规模集的现成还原属性。 SpotRestorePolicy
upgradePolicy 升级策略。 UpgradePolicy
virtualMachineProfile 虚拟机配置文件。 VirtualMachineScaleSetVMProfile
zoneBalance 在发生区域中断时,是否强制在 x 区域间严格均匀地进行虚拟机分发。 仅当规模集的 zone 属性包含多个区域时,才能设置 zoneBalance 属性。 如果没有指定区域或仅指定了一个区域,则不应设置 zoneBalance 属性。 bool

AdditionalCapabilities

名称 说明
hibernationEnabled 在 VM 上启用或禁用休眠功能的标志。 bool
ultraSSDEnabled 一个标志,用于启用或禁用在 VM 或 VMSS 上具有UltraSSD_LRS存储帐户类型的一个或多个托管数据磁盘的功能。 仅当启用此属性时,才能将存储帐户类型为 UltraSSD_LRS 的托管磁盘添加到虚拟机或虚拟机规模集。 bool

AutomaticRepairsPolicy

名称 说明
enabled 指定是否应在虚拟机规模集上启用自动修复。 默认值为 false。 bool
gracePeriod 由于 VM 上的状态更改而暂停自动修复的时间量。 宽限时间在状态更改完成后开始。 这有助于避免过早或意外修复。 持续时间应以 ISO 8601 格式指定。 PT10M) (允许的最小宽限期为 10 分钟,这也是默认值。 pt90M) (允许的最大宽限期为 90 分钟。 字符串
repairAction 修复操作的类型 (替换、重启、重置映像) ,这些操作将用于修复规模集中的不正常虚拟机。 默认值为 replace。 “Reimage”
“Replace”
“重启”

SubResource

名称 说明 Value
id 资源 ID 字符串

ScaleInPolicy

名称 说明
forceDeletion 此属性允许指定在虚拟机规模集正在缩放时,是否必须强制删除选择删除的虚拟机。 (预览版中的功能) bool
规则 在虚拟机规模集中缩放时要遵循的规则。

可能的值为:

默认 在中缩放虚拟机规模集时,如果规模集是区域性规模集,则规模集将首先跨区域进行均衡。 然后,它将尽可能跨容错域进行均衡。 在每个容错域中,选择要删除的虚拟机将是最新的虚拟机,这些虚拟机不受横向缩减保护。

OldestVM 当虚拟机规模集进行横向缩减时,将选择最旧的不受缩减保护的虚拟机进行删除。 对于区域性虚拟机规模集,规模集将首先跨区域进行均衡。 在每个区域中,将选择未受保护的最早虚拟机进行删除。

NewestVM 在缩减虚拟机规模集时,将选择未受到横向缩减保护的最新虚拟机进行删除。 对于区域性虚拟机规模集,规模集将首先跨区域进行均衡。 在每个区域中,将选择未受保护的最新虚拟机进行删除。

包含任意项的字符串数组:
'Default'
“NewestVM”
“OldestVM”

SpotRestorePolicy

名称 说明
enabled 启用现成-试用-还原功能,根据容量可用性和定价约束尝试以机会方式还原已逐出的 VMSS SPOT 实例 bool
restoreTimeout 表示为 ISO 8601 持续时间的超时值,此后平台不会尝试还原 VMSS SPOT 实例 字符串

UpgradePolicy

名称 说明
automaticOSUpgradePolicy 用于执行自动 OS 升级的配置参数。 AutomaticOSUpgradePolicy
mode 指定升级到规模集中虚拟机的模式。

可能的值为:

手动 - 控制将更新应用到规模集中的虚拟机。 可以使用 manualUpgrade 操作执行此操作。

自动 - 规模集中的所有虚拟机同时自动更新。
“自动”
“手动”
“滚动”
rollingUpgradePolicy 执行滚动升级时使用的配置参数。 RollingUpgradePolicy

AutomaticOSUpgradePolicy

名称 说明
disableAutomaticRollback 是否应禁用 OS 映像回滚功能。 默认值为 false。 bool
enableAutomaticOSUpgrade 指示当较新版本的 OS 映像可用时,是否应以滚动方式自动将 OS 升级应用于规模集实例。 默认值为 false。

对于基于 Windows 的规模集,如果此值设置为 true,enableAutomaticUpdates 将自动设置为 false,并且不能设置为 true。
bool
useRollingUpgradePolicy 指示是否应在自动操作系统升级期间使用滚动升级策略。 默认值为 false。 如果未在 VMSS 上定义任何策略,则自动 OS 升级将回退到默认策略。 bool

RollingUpgradePolicy

名称 说明
enableCrossZoneUpgrade 允许 VMSS 在构造升级批处理时忽略 AZ 边界。 请考虑更新域和 maxBatchInstancePercent 来确定批大小。 bool
maxBatchInstancePercent 通过一批滚动升级同时升级的总虚拟机实例的最大百分比。 由于这是最大值,以前或将来的批处理中运行不正常的实例可能会导致批处理中的实例百分比降低,以确保更高的可靠性。 此参数的默认值为 20%。 int

约束:
最小值 = 5
最大值 = 100
maxUnhealthyInstancePercent 规模集中可能同时运行不正常的虚拟机实例总数的最大百分比,可以是升级的结果,或者虚拟机运行状况检查在滚动升级中止之前发现处于不正常状态。 在启动任何批处理之前,将检查此约束。 此参数的默认值为 20%。 int

约束:
最小值 = 5
最大值 = 100
maxUnhealthyUpgradedInstancePercent 可发现处于不正常状态的已升级虚拟机实例的最大百分比。 此检查将在每个批处理升级后发生。 如果超过此百分比,滚动更新将中止。 此参数的默认值为 20%。 int

约束:
最小值 = 0
最大值 = 100
pauseTimeBetweenBatches 完成一批中所有虚拟机的更新到开始下一批之间的等待时间。 持续时间应以 ISO 8601 格式指定。 默认值为 0 秒 (PT0S) 。 字符串
prioritizeUnhealthyInstances 升级规模集中所有不正常的实例,然后再升级任何正常实例。 bool

VirtualMachineScaleSetVMProfile

名称 说明
applicationProfile 指定应提供给 VM/VMSS 的库应用程序 ApplicationProfile
billingProfile 指定 Azure 现成 VMSS 的计费相关详细信息。

最低 API 版本:2019-03-01。
BillingProfile
capacityReservation 指定规模集的容量预留相关详细信息。

最低 API 版本:2021-04-01。
CapacityReservationProfile
diagnosticsProfile 指定启动诊断设置状态。

最低 API 版本:2015-06-15。
DiagnosticsProfile
evictionPolicy 指定 Azure 现成虚拟机和 Azure 现成规模集的逐出策略。

对于 Azure 现成虚拟机,支持“Deallocate”和“Delete”,最低 API 版本为 2019-03-01。

对于 Azure 现成规模集,支持“Deallocate”和“Delete”,最低 API 版本为 2017-10-30-preview。
“Deallocate”
“Delete”
extensionProfile 指定规模集中虚拟机上安装的扩展的设置集合。 VirtualMachineScaleSetExtensionProfile
hardwareProfile 指定规模集的硬件配置文件相关详细信息。

最低 API 版本:2022-03-01。
VirtualMachineScaleSetHardwareProfile
LicenseType 指定正在使用的映像或磁盘已在本地获得许可。

Windows Server 操作系统的可能值为:

Windows_Client

Windows_Server

Linux Server 操作系统的可能值为:

RHEL) 的RHEL_BYOS (

SUSE) SLES_BYOS (

有关详细信息,请参阅 适用于 Windows Server 的 Azure 混合使用权益

适用于 Linux Server 的 Azure 混合使用权益

最低 API 版本:2015-06-15
字符串
networkProfile 指定规模集中虚拟机网络接口的属性。 VirtualMachineScaleSetNetworkProfile
osProfile 指定规模集中虚拟机的操作系统设置。 VirtualMachineScaleSetOSProfile
priority 指定规模集中虚拟机的优先级。

最低 API 版本:2017-10-30-preview
“低”
“常规”
“Spot”
scheduledEventsProfile 指定与计划事件相关的配置。 ScheduledEventsProfile
securityProfile 指定规模集中虚拟机的安全相关配置文件设置。 SecurityProfile
storageProfile 指定虚拟机磁盘的存储设置。 VirtualMachineScaleSetStorageProfile
userData 规模集中虚拟机的 UserData,必须采用 base-64 编码。 客户不应在此处传递任何机密。

最低 API 版本:2021-03-01
字符串

ApplicationProfile

名称 说明
galleryApplications 指定应提供给 VM/VMSS 的库应用程序 VMGalleryApplication[]

VMGalleryApplication

名称 说明
configurationReference 可选,指定 Azure Blob 的 URI,该 URI 将替换包的默认配置(如果提供) 字符串
enableAutomaticUpgrade 如果设置为 true,则当 PIR/SIG 中提供了新的库应用程序版本时,它将针对 VM/VMSS 自动更新 bool
顺序 可选,指定包的安装顺序 int
packageReferenceId 指定 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} 格式的 GalleryApplicationVersion 资源 ID 字符串 (必需)
标记 可选,指定用于更多泛型上下文的传递值。 字符串
treatFailureAsDeploymentFailure 可选,如果为 true,则 VmApplication 中任何操作的任何失败都将使部署失败 bool

BillingProfile

名称 说明
maxPrice 指定愿意为 Azure 现成 VM/VMSS 支付的最高价格。 此价格以美元为单位。

此价格将与 VM 大小的当前 Azure 现成价格进行比较。 此外,在创建/更新 Azure 现成 VM/VMSS 时会比较价格,仅当 maxPrice 大于当前 Azure 现成价格时,操作才会成功。

如果创建 VM/VMSS 后当前 Azure 现成价格超出 maxPrice,maxPrice 还将用于逐出 Azure 现成 VM/VMSS。

可能的值为:

- 任何大于零的十进制值。 示例:0.01538

-1 – 指示默认价格是按需的。

可以将 maxPrice 设置为 -1,以指示不应出于价格原因逐出 Azure 现成 VM/VMSS。 此外,如果未提供,则默认最大价格为 -1。

最低 API 版本:2019-03-01。 若要指定十进制值,请使用 json () 函数。
int 或 json decimal

CapacityReservationProfile

名称 说明
capacityReservationGroup 指定容量预留组资源 ID,该 ID 用于分配虚拟机或规模集 VM 实例,前提是已预留足够的容量。 有关更多详细信息,请参阅 https://aka.ms/CapacityReservation SubResource

DiagnosticsProfile

名称 说明
bootDiagnostics 启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图以诊断 VM 状态。
注意:如果指定 storageUri,请确保存储帐户与 VM 位于同一区域和订阅中。

可以轻松查看控制台日志的输出。

Azure 还使你能够查看虚拟机监控程序中 VM 的屏幕截图。
BootDiagnostics

BootDiagnostics

名称 说明
enabled 是否应在虚拟机上启用启动诊断。 bool
storageUri 用于放置控制台输出和屏幕截图的存储帐户的 URI。

如果在启用启动诊断时未指定 storageUri,则将使用托管存储。
字符串

VirtualMachineScaleSetExtensionProfile

名称 说明
扩展 虚拟机规模集子扩展资源。 VirtualMachineScaleSetExtension[]
extensionsTimeBudget 指定为所有扩展分配的启动时间。 持续时间应介于 15 分钟到 120 分钟之间, (包括) ,并且应以 ISO 8601 格式指定。 默认值为 90 分钟 (PT1H30M) 。

最低 API 版本:2020-06-01
字符串

VirtualMachineScaleSetExtension

名称 说明
name 扩展插件的名称。 string
properties 描述虚拟机规模集扩展的属性。 VirtualMachineScaleSetExtensionProperties

VirtualMachineScaleSetExtensionProperties

名称 说明
autoUpgradeMinorVersion 指示扩展是否应使用较新的次要版本(如果在部署时可用)。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。 bool
enableAutomaticUpgrade 指示如果有较新版本的可用扩展,平台是否应自动升级扩展。 bool
forceUpdateTag 如果提供的值与以前的值不同,则即使扩展配置未更改,也会强制更新扩展处理程序。 字符串
protectedSettings 该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。 对于 Bicep,可以使用 任何 () 函数。
protectedSettingsFromKeyVault 通过引用传递并从密钥保管库使用的扩展保护设置 KeyVaultSecretReference
provisionAfterExtensions 扩展名称的集合,之后需要预配此扩展。 string[]
发布者 扩展处理程序发布者的名称。 字符串
设置 扩展的 Json 格式的公共设置。 对于 Bicep,可以使用 任何 () 函数。
suppressFailures 指示无论此值) 如何,都不会禁止因扩展而引发的故障 (操作故障(如未连接到 VM)。 默认值为 false。 bool
类型 指定扩展的类型;例如“CustomScriptExtension”。 字符串
typeHandlerVersion 指定脚本处理程序的版本。 字符串

KeyVaultSecretReference

名称 说明
secretUrl 引用密钥保管库中的机密的 URL。 字符串 (必需)
sourceVault 包含机密的密钥保管库的相对 URL。 需要子资源 ()

VirtualMachineScaleSetHardwareProfile

名称 说明
vmSizeProperties 指定用于自定义虚拟机大小的属性。 最低 API 版本:2022-03-01。

有关更多详细信息,请按照 VM 自定义 中的说明进行操作。
VMSizeProperties

VMSizeProperties

名称 说明
vCPUsAvailable 指定可用于 VM 的 vCPU 数。

如果未在请求正文中指定此属性,则默认行为是将其设置为可用于该 VM 大小的 vCPU 值,该值在列出 区域 中的所有可用虚拟机大小的 API 响应中公开。
int
vCPUPerCore 指定 vCPU 与物理核心的比率。

如果未在请求正文中指定此属性,则对于列出区域中所有可用虚拟机大小的 API 响应中公开的 VM 大小,默认行为设置为 vCPUPerCore 的值

将此属性设置为 1 还意味着禁用超线程。
int

VirtualMachineScaleSetNetworkProfile

名称 说明
healthProbe 对负载均衡器探测的引用,用于确定虚拟机规模集中实例的运行状况。 引用的格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}”。 ApiEntityReference
networkApiVersion 指定在业务流程模式为虚拟机规模集的网络接口配置中创建网络资源时使用的 Microsoft.Network API 版本 '2020-11-01'
networkInterfaceConfigurations 网络配置列表。 VirtualMachineScaleSetNetworkConfiguration[]

ApiEntityReference

名称 说明 Value
id 采用 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 格式的 ARM 资源 ID。 字符串

VirtualMachineScaleSetNetworkConfiguration

名称 说明 Value
id 资源 ID 字符串
name 网络配置名称。 字符串 (必需)
properties 介绍虚拟机规模集网络配置文件的 IP 配置。 VirtualMachineScaleSetNetworkConfigurationProperties

VirtualMachineScaleSetNetworkConfigurationProperties

名称 说明
deleteOption 指定删除 VM 时网络接口会发生什么情况 “Delete”
“分离”
dnsSettings 要应用于网络接口的 dns 设置。 VirtualMachineScaleSetNetworkConfigurationDnsSetting...
enableAcceleratedNetworking 指定网络接口是否已启用加速网络。 bool
enableFpga 指定网络接口是否已启用 FPGA 网络。 bool
enableIPForwarding 是否在此 NIC 上启用了 IP 转发。 bool
ipConfigurations 指定网络接口的 IP 配置。 VirtualMachineScaleSetIPConfiguration[] (必需的)
networkSecurityGroup 网络安全组。 SubResource
角色实体 指定主网络接口,以防虚拟机具有 1 个以上的网络接口。 bool

VirtualMachineScaleSetNetworkConfigurationDnsSetting...

名称 说明
dnsServers DNS 服务器 IP 地址列表 string[]

VirtualMachineScaleSetIPConfiguration

名称 说明 Value
id 资源 ID 字符串
name IP 配置名称。 字符串 (必需)
properties 介绍虚拟机规模集网络配置文件的 IP 配置属性。 VirtualMachineScaleSetIPConfigurationProperties

VirtualMachineScaleSetIPConfigurationProperties

名称 说明
applicationGatewayBackendAddressPools 指定对应用程序网关的后端地址池的引用数组。 规模集可以引用多个应用程序网关的后端地址池。 多个规模集不能使用相同的应用程序网关。 SubResource[]
applicationSecurityGroups 指定对应用程序安全组的引用数组。 SubResource[]
loadBalancerBackendAddressPools 指定对负载均衡器的后端地址池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的后端地址池。 多个规模集不能使用相同的基本 SKU 负载均衡器。 SubResource[]
loadBalancerInboundNatPools 指定对负载均衡器的入站 Nat 池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的入站 nat 池。 多个规模集不能使用相同的基本 SKU 负载均衡器。 SubResource[]
角色实体 指定主网络接口,以防虚拟机具有 1 个以上的网络接口。 bool
privateIPAddressVersion 从 Api-Version 2017-03-30 开始提供,它表示特定的 ip 配置是 IPv4 还是 IPv6。 默认值为 IPv4。 可能的值为:“IPv4”和“IPv6”。 “IPv4”
“IPv6”
publicIPAddressConfiguration publicIPAddressConfiguration。 VirtualMachineScaleSetPublicIPAddressConfiguration
子网 指定子网的标识符。 ApiEntityReference

VirtualMachineScaleSetPublicIPAddressConfiguration

名称 说明
name publicIP 地址配置名称。 字符串 (必需)
properties 介绍虚拟机规模集 IP 配置的 PublicIPAddress 配置 VirtualMachineScaleSetPublicIPAddressConfigurationPr...
sku 介绍公共 IP SKU。 只能将 OrchestrationMode 设置为灵活。 PublicIPAddressSku

VirtualMachineScaleSetPublicIPAddressConfigurationPr...

名称 说明
deleteOption 指定删除 VM 时公共 IP 会发生什么情况 'Delete'
“分离”
dnsSettings 要应用于 publicIP 地址 的 DNS 设置。 VirtualMachineScaleSetPublicIPAddressConfigurationDn...
idleTimeoutInMinutes 公共 IP 地址的空闲超时。 int
ipTags 与公共 IP 地址关联的 IP 标记列表。 VirtualMachineScaleSetIpTag[]
publicIPAddressVersion 从 Api-Version 2019-07-01 起提供,它表示特定的 ip 配置是 IPv4 还是 IPv6。 默认值为 IPv4。 可能的值为:“IPv4”和“IPv6”。 “IPv4”
“IPv6”
publicIPPrefix 要从中分配 publicIP 地址的 PublicIPPrefix。 SubResource

VirtualMachineScaleSetPublicIPAddressConfigurationDn...

名称 说明
domainNameLabel 域名标签。域名标签和 vm 索引的串联将是将创建的 PublicIPAddress 资源的域名标签 字符串 (必需)

VirtualMachineScaleSetIpTag

名称 说明
ipTagType IP 标记类型。 示例:FirstPartyUsage。 字符串
标记 与公共 IP 关联的 IP 标记。 示例:SQL、存储等。 字符串

PublicIPAddressSku

名称 说明
name 指定公共 IP SKU 名称 'Basic'
'Standard'
指定公共 IP SKU 层 'Global'
'Regional'

VirtualMachineScaleSetOSProfile

名称 说明
adminPassword 指定管理员帐户的密码。

Windows) 最小长度 (: 8 个字符

Linux) 最小长度 (: 6 个字符

最大长度 (Windows) : 123 个字符

最大长度 (Linux) : 72 个字符

复杂性要求: 需要满足以下 4 个条件中的 3 个
包含较低字符
包含大写字符
有一个数字
具有一个特殊字符 (正则表达式匹配 [\W_])

不允许的值: “abc@123”、“P@$$w 0rd”、“P@ssw0rd”、“P@ssword123”、“Pa$$word”、“pass@word1”、“Password!”、“Password1”、“Password22”、“iloveyou!”

有关重置密码的信息,请参阅 如何在 Windows VM 中重置远程桌面服务或其登录密码

有关重置 root 密码的信息,请参阅使用 VMAccess 扩展管理用户、SSH 和检查或修复 Azure Linux VM 上的磁盘
字符串

约束:
敏感值。 作为安全参数传入。
adminUsername 指定管理员帐户的名称。

仅限 Windows 的限制: 不能以“.”结尾

不允许的值: “administrator”, “admin”, “user”, “user1”, “test”, “user2”, “test1”, “user3”, “admin1”, “1”, “123”、“a”、“actuser”、“adm”、“admin2”、“aspnet”、“backup”、“console”、“david”、“guest”、“john”、“owner”、“root”、“server”、“sql”、“support”、“support_388945a0”、“sys”、“test2”、“test3”、“user4”、“user5”。

Linux) (最小长度: 1 个字符

最大长度 (Linux) : 64 个字符

最大长度 (Windows) : 20 个字符
字符串
allowExtensionOperations 指定是否应在虚拟机规模集上允许扩展操作。

仅当虚拟机规模集上不存在任何扩展时,才能将其设置为 False。
bool
computerNamePrefix 指定规模集中所有虚拟机的计算机名称前缀。 计算机名称前缀的长度必须为 1 到 15 个字符。 字符串
customData 指定自定义数据的 Base-64 编码的字符串。 Base-64 编码的字符串将解码为一个二元数组并作为一个文件保存在虚拟机上。 该二元数组的最大长度为 65535 字节。

有关对 VM 使用 cloud-init,请参阅 在创建期间使用 cloud-init 自定义 Linux VM
字符串
linuxConfiguration 指定虚拟机上的 Linux 操作系统设置。

有关支持的 Linux 分发版的列表,请参阅 Linux on Azure-Endorsed Distributions
LinuxConfiguration
机密 指定应安装在规模集中虚拟机上的证书集。 若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展 VaultSecretGroup[]
windowsConfiguration 指定虚拟机上的 Windows 操作系统设置。 WindowsConfiguration

LinuxConfiguration

名称 说明
disablePasswordAuthentication 指定是否应禁用密码身份验证。 bool
patchSettings [预览功能]指定与 Linux 上的 VM 来宾修补相关的设置。 LinuxPatchSettings
provisionVMAgent 指示是否应在虚拟机上设置虚拟机代理。

如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。
bool
ssh 指定 Linux OS 的 SSH 密钥配置。 SshConfiguration

LinuxPatchSettings

名称 说明
assessmentMode 指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值为:

ImageDefault - 控制虚拟机上修补程序评估的时间安排。

AutomaticByPlatform - 平台将触发定期修补程序评估。 属性 provisionVMAgent 必须为 true。
“AutomaticByPlatform”
“ImageDefault”
automaticByPlatformSettings 指定 Linux 上的 VM 来宾修补中的修补模式 AutomaticByPlatform 的其他设置。 LinuxVMGuestPatchAutomaticByPlatformSettings
patchMode 指定将 VM 来宾修补到 IaaS 虚拟机或与虚拟机规模集关联的虚拟机的模式,其中 OrchestrationMode 为灵活。

可能的值为:

ImageDefault - 使用虚拟机的默认修补配置。

AutomaticByPlatform - 虚拟机将由平台自动更新。 属性 provisionVMAgent 必须为 true
“AutomaticByPlatform”
“ImageDefault”

LinuxVMGuestPatchAutomaticByPlatformSettings

名称 说明
rebootSetting 指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。 “Always”
“IfRequired”
“从不”
“未知”

SshConfiguration

名称 说明
publicKeys 用于对基于 Linux 的 VM 进行身份验证的 SSH 公钥列表。 SshPublicKey[]

SshPublicKey

名称 说明
keyData 用于通过 ssh 向 VM 进行身份验证的 SSH 公钥证书。 密钥需要至少为 2048 位且采用 ssh-rsa 格式。

有关创建 ssh 密钥,请参阅 [在 Linux 和 Mac 上为 Azure 中的 Linux VM 创建 SSH 密钥]/azure/virtual-machines/linux/create-ssh-keys-detailed) 。
字符串
path 指定所创建的 VM 上存储 ssh 公钥的完整路径。 如果该文件已存在,则指定的密钥将追加到该文件上。 示例:/home/user/.ssh/authorized_keys 字符串

VaultSecretGroup

名称 说明
sourceVault 包含 VaultCertificates 中所有证书的密钥保管库的相对 URL。 SubResource
vaultCertificates SourceVault 中包含证书的密钥保管库引用列表。 VaultCertificate[]

VaultCertificate

名称 说明
certificateStore 对于 Windows VM,指定应向其添加证书的虚拟机上的证书存储。 指定的证书存储隐式位于 LocalMachine 帐户中。

对于 Linux VM,证书文件位于 /var/lib/waagent 目录下,X509 证书文件的文件名 <为 UppercaseThumbprint.crt>, <私钥的文件名为 UppercaseThumbprint.prv>。 这两个文件都采用 .pem 格式。
字符串
certificateUrl 这是已作为机密上传到密钥保管库的证书的 URL。 若要向密钥保管库添加机密,请参阅将密钥或机密添加到密钥保管库。 在这种情况下,证书必须是以下 JSON 对象的 Base64 编码,该对象以 UTF-8 编码:

{
“data”:“{Base64-encoded-certificate}”,
“dataType”:“pfx”,
“password”:“{pfx-file-password}”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展
字符串

WindowsConfiguration

名称 说明
additionalUnattendContent 指定可包含在 Windows 安装程序使用的 Unattend.xml 文件中的其他 Base-64 编码 XML 格式信息。 AdditionalUnattendContent[]
enableAutomaticUpdates 指示是否为 Windows 虚拟机启用自动汇报。 默认值为 true。

对于虚拟机规模集,可以更新此属性,更新将在 OS 重新预配时生效。
bool
patchSettings [预览功能]指定与 Windows 上的 VM 来宾修补相关的设置。 PatchSettings
provisionVMAgent 指示是否应在虚拟机上设置虚拟机代理。

如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。
bool
timezone 指定虚拟机的时区。 例如“太平洋标准时间”。

可以从 TimeZoneInfo.GetSystemTimeZones 返回的时区 TimeZoneInfo.Id 值。
字符串
winRM 指定 Windows 远程管理侦听器。 这将启用远程 Windows PowerShell。 WinRMConfiguration

AdditionalUnattendContent

名称 说明
componentName 组件名称。 目前,唯一允许的值是 Microsoft-Windows-Shell-Setup。 “Microsoft-Windows-Shell-Setup”
内容 指定添加到指定路径和组件的 unattend.xml 文件的 XML 格式化内容。 XML 必须小于 4KB,并且必须包含要插入的设置或功能的根元素。 字符串
passName 传递名称。 目前,唯一允许的值是 OobeSystem。 “OobeSystem”
settingName 指定内容适用于的设置的名称。 可能的值为:FirstLogonCommands 和 AutoLogon。 “AutoLogon”
“FirstLogonCommands”

PatchSettings

名称 说明
assessmentMode 指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值为:

ImageDefault - 控制虚拟机上修补程序评估的时间安排。

AutomaticByPlatform - 平台将触发定期修补程序评估。 属性 provisionVMAgent 必须为 true。
“AutomaticByPlatform”
“ImageDefault”
automaticByPlatformSettings 指定 Windows 上的 VM 来宾修补中的修补模式 AutomaticByPlatform 的其他设置。 WindowsVMGuestPatchAutomaticByPlatformSettings
enableHotpatching 使客户无需重新启动即可修补其 Azure VM。 对于 enableHotpatching,必须将“provisionVMAgent”设置为 true,“patchMode”必须设置为“AutomaticByPlatform”。 bool
patchMode 指定将 VM 来宾修补到 IaaS 虚拟机或与虚拟机规模集关联的虚拟机的模式,其中 OrchestrationMode 为灵活。

可能的值为:

手动 - 控制将修补程序应用到虚拟机。 为此,可以在 VM 中手动应用修补程序。 在此模式下,自动更新处于禁用状态;属性 WindowsConfiguration.enableAutomaticUpdates 必须为 false

AutomaticByOS - 操作系统会自动更新虚拟机。 属性 WindowsConfiguration.enableAutomaticUpdates 必须为 true。

AutomaticByPlatform - 虚拟机将由平台自动更新。 属性 provisionVMAgent 和 WindowsConfiguration.enableAutomaticUpdates 必须为 true
“AutomaticByOS”
“AutomaticByPlatform”
“手动”

WindowsVMGuestPatchAutomaticByPlatformSettings

名称 说明
rebootSetting 指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。 “Always”
'IfRequired'
“从不”
“未知”

WinRMConfiguration

名称 说明
侦听器 Windows 远程管理侦听器的列表 WinRMListener[]

WinRMListener

名称 说明
certificateUrl 这是已作为机密上传到密钥保管库的证书的 URL。 若要将机密添加到密钥保管库,请参阅将密钥或机密添加到密钥保管库。 在这种情况下,证书必须是以下 JSON 对象的 Base64 编码,该对象以 UTF-8 编码:

{
“data”:“{Base64-encoded-certificate}”,
“dataType”:“pfx”,
“password”:“{pfx-file-password}”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展
字符串
protocol 指定 WinRM 侦听器的协议。

可能的值为:
http

https
'Http'
'Https'

ScheduledEventsProfile

名称 说明
terminateNotificationProfile 指定与终止计划事件相关的配置。 TerminateNotificationProfile

TerminateNotificationProfile

名称 说明
enable 指定是启用或禁用 Terminate Scheduled 事件。 bool
notBeforeTimeout 在自动批准该事件之前,要删除的虚拟机可能需要批准“终止计划事件”的可配置时间长度, () 超时。 必须以 ISO 8601 格式指定配置,默认值为 5 分钟 (PT5M) 字符串

SecurityProfile

名称 说明
encryptionAtHost 用户可以在请求中使用此属性来启用或禁用虚拟机或虚拟机规模集的主机加密。 这将为所有磁盘启用加密,包括主机本身的资源/临时磁盘。

默认值:除非资源的此属性设置为 true,否则将禁用主机加密。
bool
securityType 指定虚拟机的 SecurityType。 必须将其设置为任何指定的值才能启用 UefiSettings。

默认值:除非设置了此属性,否则不会启用 UefiSettings。
“ConfidentialVM”
'TrustedLaunch'
uefiSettings 指定创建虚拟机时使用的安全设置,例如安全启动和 vTPM。

最低 API 版本:2020-12-01
UefiSettings

UefiSettings

名称 说明
secureBootEnabled 指定是否应在虚拟机上启用安全启动。

最低 API 版本:2020-12-01
bool
vTpmEnabled 指定是否应在虚拟机上启用 vTPM。

最低 API 版本:2020-12-01
bool

VirtualMachineScaleSetStorageProfile

名称 说明
dataDisks 指定用于将数据磁盘添加到规模集中的虚拟机的参数。

有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD
VirtualMachineScaleSetDataDisk[]
imageReference 指定有关要使用的映像的信息。 可以指定有关平台映像、市场映像或虚拟机映像的信息。 若要使用平台映像、市场映像或虚拟机映像,但未在其他创建操作中使用,则此元素是必需的。 ImageReference
osDisk 指定有关规模集中虚拟机使用的操作系统磁盘的信息。

有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD
VirtualMachineScaleSetOSDisk

VirtualMachineScaleSetDataDisk

名称 说明
缓存 指定缓存要求。

可能的值为:



ReadOnly

ReadWrite

默认值: 对于标准存储,无。适用于高级存储的 ReadOnly
“None”
“ReadOnly”
“ReadWrite”
createOption 创建选项。 “附加”
“空”
“FromImage” (必需)
deleteOption 指定在 VMSS 灵活删除时是应删除还是分离数据磁盘 (此功能仅适用于具有灵活 OrchestrationMode 的 VMSs) 。

可能的值:

删除 如果使用此值,则删除 VMSS Flex VM 时会删除数据磁盘。

分离 如果使用此值,则删除 VMSS Flex VM 后,数据磁盘将保留。

默认值设置为 Delete
“Delete”
“分离”
diskIOPSReadWrite 指定托管磁盘 Read-Write IOPS。 应仅在UltraSSD_LRS StorageAccountType 时才使用。 如果未指定,将根据 diskSizeGB 分配默认值。 int
diskMBpsReadWrite 指定托管磁盘的带宽(以 MB/秒为单位)。 应仅在UltraSSD_LRS StorageAccountType 时才使用。 如果未指定,将根据 diskSizeGB 分配默认值。 int
diskSizeGB 指定空数据磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。

此值不能大于 1023 GB
int
lun 指定数据磁盘的逻辑单元号。 此值用于标识 VM 中的数据磁盘,因此对于附加到 VM 的每个数据磁盘必须是唯一的。 int (必需)
managedDisk 托管磁盘参数。 VirtualMachineScaleSetManagedDiskParameters
name 磁盘名称。 字符串
writeAcceleratorEnabled 指定是在磁盘上启用或禁用 writeAccelerator。 bool

VirtualMachineScaleSetManagedDiskParameters

名称 说明
diskEncryptionSet 指定托管磁盘的客户托管磁盘加密集资源 ID。 DiskEncryptionSetParameters
securityProfile 指定托管磁盘的安全配置文件。 VMDiskSecurityProfile
storageAccountType 指定托管磁盘的存储帐户类型。 注意:UltraSSD_LRS只能与数据磁盘一起使用,它不能与 OS 磁盘一起使用。 “PremiumV2_LRS”
“Premium_LRS”
“Premium_ZRS”
“StandardSSD_LRS”
“StandardSSD_ZRS”
“Standard_LRS”
“UltraSSD_LRS”

DiskEncryptionSetParameters

名称 说明 Value
id 资源 ID 字符串

VMDiskSecurityProfile

名称 说明
diskEncryptionSet 指定用于客户托管密钥加密的机密 VM OS 磁盘和 VMGuest Blob 的托管磁盘的客户托管磁盘加密集资源 ID。 DiskEncryptionSetParameters
securityEncryptionType 指定托管磁盘的 EncryptionType。
它设置为 DiskWithVMGuestState 以加密托管磁盘以及 VMGuestState blob,将 VMGuestStateOnly 设置为仅加密 VMGuestState blob。

注意:只能为机密 VM 设置它。
“DiskWithVMGuestState”
“VMGuestStateOnly”

ImageReference

名称 说明
communityGalleryImageId 指定了 vm 部署的社区库映像唯一 ID。 这可以从社区库映像 GET 调用中提取。 string
id 资源 ID 字符串
offer 指定用于创建虚拟机的平台映像或市场映像的套餐。 字符串
发布者 映像发布者。 字符串
sharedGalleryImageId 指定 VM 部署的共享库映像唯一 ID。 这可以从共享库映像 GET 调用中提取。 字符串
sku 映像 SKU。 字符串
版本 指定用于创建虚拟机的平台映像或市场映像的版本。 允许的格式为 Major.Minor.Build 或“latest”。 主要、次要和内部版本是十进制数。 指定“latest”以使用部署时可用的最新版本的映像。 即使使用“最新”,VM 映像也不会在部署后自动更新,即使新版本可用。 请不要对库映像部署使用字段“version”,库映像应始终使用“id”字段进行部署,若要使用库映像的“最新”版本,只需在“id”字段中设置“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleryName}/images/{imageName}”。 字符串

VirtualMachineScaleSetOSDisk

名称 说明
缓存 指定缓存要求。

可能的值为:



ReadOnly

ReadWrite

默认值: 对于标准存储,无。适用于高级存储的 ReadOnly
“None”
“ReadOnly”
“ReadWrite”
createOption 指定应如何创建规模集中的虚拟机。

唯一允许的值是: FromImage \u2013 使用映像创建虚拟机时使用此值。 如果使用平台映像,则还需要使用上述 imageReference 元素。 如果使用的是市场映像,则还需要使用前面所述的 plan 元素。
“附加”
“空”
“FromImage” (必需)
deleteOption 指定在 VMSS Flex 删除时是应删除还是分离 OS 磁盘, (此功能仅适用于仅) 灵活 OrchestrationMode 的 VMSS。

可能的值:

删除 如果使用此值,则会在删除 VMSS Flex VM 时删除 OS 磁盘。

分离 如果使用此值,则删除 VMSS Flex VM 后,OS 磁盘将保留。

默认值设置为 Delete。 对于临时 OS 磁盘,默认值设置为 Delete。 用户无法更改临时 OS 磁盘的删除选项。
“Delete”
“分离”
diffDiskSettings 指定虚拟机规模集使用的操作系统磁盘的临时磁盘设置。 DiffDiskSettings
diskSizeGB 指定操作系统磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。

此值不能大于 1023 GB
int
image 指定要基于规模集的非托管用户映像的信息。 VirtualHardDisk
managedDisk 托管磁盘参数。 VirtualMachineScaleSetManagedDiskParameters
name 磁盘名称。 字符串
osType 此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 的类型。

可能的值为:

Windows

Linux
“Linux”
“Windows”
vhdContainers 指定用于存储规模集操作系统磁盘的容器 URL。 string[]
writeAcceleratorEnabled 指定是在磁盘上启用或禁用 writeAccelerator。 bool

DiffDiskSettings

名称 说明
选项 指定操作系统磁盘的临时磁盘设置。 “Local”
放置 指定操作系统磁盘的临时磁盘放置。

可能的值为:

CacheDisk

ResourceDisk

默认值:如果为 VM 大小配置了 CacheDisk ,则使用 ResourceDisk

请参阅 /azure/virtual-machines/windows/sizes 和 /azure/virtual-machines/linux/sizes 上的 Windows VM 的 VM 大小文档,检查哪些 VM 大小公开缓存磁盘。
'CacheDisk'
“ResourceDisk”

VirtualHardDisk

名称 说明
uri 指定虚拟硬盘的 URI。 字符串

SKU

名称 说明
容量 指定规模集中的虚拟机数。 int
name SKU 名称。 字符串
指定规模集中虚拟机的层。

可能的值:

标准

基本
字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
使用 LB 探测和自动修复部署 VM 规模集

部署到 Azure
此模板允许在配置了运行状况探测的负载均衡器后面部署 Linux VM 的 VM 规模集。 规模集还启用了自动实例修复策略,宽限期为 30 分钟。
部署将每个 VM 连接到Azure 文件存储共享的 VMSS

部署到 Azure
此模板部署 Ubuntu 虚拟机规模集,并使用自定义脚本扩展将每个 VM 连接到Azure 文件存储共享
使用自定义脚本扩展部署 Windows VM 规模集

部署到 Azure
此模板允许使用各种 Windows 版本的最新修补版本部署 Windows VM 的 VM 规模集。 这些 VM 具有用于自定义的自定义脚本扩展,并且位于具有 RDp 连接的 NAT 规则的负载均衡器后面。
将规模集部署到现有 vnet 中

部署到 Azure
此模板将 VM 规模集部署到已存在的 vnet 中。
将多个 VM 添加到虚拟机规模集中

部署到 Azure
此模板将使用托管磁盘、公共 IP 和网络接口创建 N 个 VM。 它将在灵活业务流程模式下的虚拟机规模集中创建 VM。 它们将在虚拟网络也将作为部署的一部分创建
VMSS 灵活业务流程模式快速入门 Linux

部署到 Azure
此模板部署一个简单的 VM 规模集,其中包含Azure 负载均衡器后面的实例。 VM 规模集处于灵活业务流程模式。 使用 os 参数选择 Linux (Ubuntu) 或 Windows (Windows Server Datacenter 2019) 部署。 注意:此快速入门模板允许从任何 Internet 地址 (SSH、RDP) 对 VM 管理端口进行网络访问,不应用于生产部署。
使用 ILB 后面的 Linux VM 部署 VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Ubuntu Linux 15.10 或 14.04.4-LTS 部署 Linux VM 的 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的内部负载均衡器后面。
使用 Linux 自定义映像部署 VM 规模集

部署到 Azure
此模板允许在规模集中部署自定义 VM Linux 映像。 这些 VM 位于负载均衡器后面,默认情况下端口 80) 上的 HTTP 负载均衡 (。 此示例使用自定义脚本执行应用程序部署和更新,可能需要为自己的更新过程提供自定义脚本。 必须在创建 VMSS 的同一订阅和区域中提供 VM 的通用映像。
使用 Linux VM 部署简单的 VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Ubuntu Linux 14.04.4-LTS 或 16.04-LTS 部署 Linux VM 的简单 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的负载均衡器后面。
在可用性区域中部署具有 Linux VM 的 VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Ubuntu Linux 14.04.4-LTS 或 16.04-LTS 部署 Linux VM 的简单 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的负载均衡器后面。
部署具有主要/辅助体系结构的 Linux VMSS

部署到 Azure
此模板允许在主辅助体系结构中使用自定义脚本扩展部署 Linux VMSS
具有 Linux VM 和公共 IPv4 的简单 VM 规模集(每个 VM)

部署到 Azure
此模板演示如何部署具有负载均衡器、入站 NAT 规则和每个 VM 的公共 IP 的简单规模集。
部署支持受信任启动的 Windows VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Windows Server 2016、Windows Server 2019 或 Windows Server 2022 Azure Edition 部署可受信任启动的 Windows VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。 如果启用 Secureboot 和 vTPM,则会在 VMSS 上安装来宾证明扩展。 此扩展将通过云执行远程 证明
使用 Azure 应用程序网关 部署 Ubuntu VM 规模集

部署到 Azure
此模板允许部署与 Azure 应用程序网关 集成的简单 Ubuntu VM 规模集,并且最多支持 1000 个 VM
使用 Linux VM 和自动缩放部署 VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Ubuntu Linux 15.04 或 14.04.4-LTS 部署 Linux VM 的简单 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的负载均衡器后面。它们还集成了自动缩放
已启用 SSL 的 VM 规模集

部署到 Azure
部署使用安全部署的 SSL 证书(以 Azure 密钥保管库 形式)配置的 Web 服务器
将规模集部署到 Windows 上的现有 vnet 中

部署到 Azure
此模板将 Windows 2016 Datacenter VM 规模集部署到已存在的资源组、vnet 和子网中。
使用 Azure 应用程序网关 部署 Windows VM 规模集

部署到 Azure
此模板允许部署与 Azure 应用程序网关 集成的简单 Windows VM 规模集,并且最多支持 1000 个 VM
使用 Windows VM 和自动缩放部署 VM 规模集

部署到 Azure
此模板允许使用 Windows 2008-R2-SP1、2012-Datacenter 或 2012-R2-Datacenter 的最新修补版本部署 Windows VM 的简单 VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。 它们还集成了自动缩放
使用 Windows 自定义映像部署 VM 规模集

部署到 Azure
通过此模板,可以部署简单的 VM 规模集和自定义 Windows 映像。 这些 VM 位于负载均衡器后面,默认情况下端口 80 上的 HTTP 负载均衡 ()
使用 Windows VM 部署简单的 VM 规模集

部署到 Azure
此模板允许你使用各种 Windows 版本的最新修补版本部署 Windows VM 的简单 VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。
在 可用性区域 中使用 Windows VM 部署 VM 规模集

部署到 Azure
此模板允许你使用各种 Windows 版本的最新修补版本部署 Windows VM 的 VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。
具有公共 IP 前缀的 VMSS

部署到 Azure
用于部署具有公共 IP 前缀的 VMSS 的模板

ARM 模板资源定义

virtualMachineScaleSets 资源类型可以通过针对以下操作进行部署:

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Compute/virtualMachineScaleSets 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "apiVersion": "2022-03-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "sku": {
    "capacity": "int",
    "name": "string",
    "tier": "string"
  },
  "extendedLocation": {
    "name": "string",
    "type": "EdgeZone"
  },
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {},
      "{customized property}": {}
    }
  },
  "plan": {
    "name": "string",
    "product": "string",
    "promotionCode": "string",
    "publisher": "string"
  },
  "properties": {
    "additionalCapabilities": {
      "hibernationEnabled": "bool",
      "ultraSSDEnabled": "bool"
    },
    "automaticRepairsPolicy": {
      "enabled": "bool",
      "gracePeriod": "string",
      "repairAction": "string"
    },
    "doNotRunExtensionsOnOverprovisionedVMs": "bool",
    "hostGroup": {
      "id": "string"
    },
    "orchestrationMode": "string",
    "overprovision": "bool",
    "platformFaultDomainCount": "int",
    "proximityPlacementGroup": {
      "id": "string"
    },
    "scaleInPolicy": {
      "forceDeletion": "bool",
      "rules": [ "string" ]
    },
    "singlePlacementGroup": "bool",
    "spotRestorePolicy": {
      "enabled": "bool",
      "restoreTimeout": "string"
    },
    "upgradePolicy": {
      "automaticOSUpgradePolicy": {
        "disableAutomaticRollback": "bool",
        "enableAutomaticOSUpgrade": "bool",
        "useRollingUpgradePolicy": "bool"
      },
      "mode": "string",
      "rollingUpgradePolicy": {
        "enableCrossZoneUpgrade": "bool",
        "maxBatchInstancePercent": "int",
        "maxUnhealthyInstancePercent": "int",
        "maxUnhealthyUpgradedInstancePercent": "int",
        "pauseTimeBetweenBatches": "string",
        "prioritizeUnhealthyInstances": "bool"
      }
    },
    "virtualMachineProfile": {
      "applicationProfile": {
        "galleryApplications": [
          {
            "configurationReference": "string",
            "enableAutomaticUpgrade": "bool",
            "order": "int",
            "packageReferenceId": "string",
            "tags": "string",
            "treatFailureAsDeploymentFailure": "bool"
          }
        ]
      },
      "billingProfile": {
        "maxPrice": "[json('decimal-as-string')]"
      },
      "capacityReservation": {
        "capacityReservationGroup": {
          "id": "string"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "enabled": "bool",
          "storageUri": "string"
        }
      },
      "evictionPolicy": "string",
      "extensionProfile": {
        "extensions": [
          {
            "name": "string",
            "properties": {
              "autoUpgradeMinorVersion": "bool",
              "enableAutomaticUpgrade": "bool",
              "forceUpdateTag": "string",
              "protectedSettings": {},
              "protectedSettingsFromKeyVault": {
                "secretUrl": "string",
                "sourceVault": {
                  "id": "string"
                }
              },
              "provisionAfterExtensions": [ "string" ],
              "publisher": "string",
              "settings": {},
              "suppressFailures": "bool",
              "type": "string",
              "typeHandlerVersion": "string"
            }
          }
        ],
        "extensionsTimeBudget": "string"
      },
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": "int",
          "vCPUsPerCore": "int"
        }
      },
      "licenseType": "string",
      "networkProfile": {
        "healthProbe": {
          "id": "string"
        },
        "networkApiVersion": "2020-11-01",
        "networkInterfaceConfigurations": [
          {
            "id": "string",
            "name": "string",
            "properties": {
              "deleteOption": "string",
              "dnsSettings": {
                "dnsServers": [ "string" ]
              },
              "enableAcceleratedNetworking": "bool",
              "enableFpga": "bool",
              "enableIPForwarding": "bool",
              "ipConfigurations": [
                {
                  "id": "string",
                  "name": "string",
                  "properties": {
                    "applicationGatewayBackendAddressPools": [
                      {
                        "id": "string"
                      }
                    ],
                    "applicationSecurityGroups": [
                      {
                        "id": "string"
                      }
                    ],
                    "loadBalancerBackendAddressPools": [
                      {
                        "id": "string"
                      }
                    ],
                    "loadBalancerInboundNatPools": [
                      {
                        "id": "string"
                      }
                    ],
                    "primary": "bool",
                    "privateIPAddressVersion": "string",
                    "publicIPAddressConfiguration": {
                      "name": "string",
                      "properties": {
                        "deleteOption": "string",
                        "dnsSettings": {
                          "domainNameLabel": "string"
                        },
                        "idleTimeoutInMinutes": "int",
                        "ipTags": [
                          {
                            "ipTagType": "string",
                            "tag": "string"
                          }
                        ],
                        "publicIPAddressVersion": "string",
                        "publicIPPrefix": {
                          "id": "string"
                        }
                      },
                      "sku": {
                        "name": "string",
                        "tier": "string"
                      }
                    },
                    "subnet": {
                      "id": "string"
                    }
                  }
                }
              ],
              "networkSecurityGroup": {
                "id": "string"
              },
              "primary": "bool"
            }
          }
        ]
      },
      "osProfile": {
        "adminPassword": "string",
        "adminUsername": "string",
        "allowExtensionOperations": "bool",
        "computerNamePrefix": "string",
        "customData": "string",
        "linuxConfiguration": {
          "disablePasswordAuthentication": "bool",
          "patchSettings": {
            "assessmentMode": "string",
            "automaticByPlatformSettings": {
              "rebootSetting": "string"
            },
            "patchMode": "string"
          },
          "provisionVMAgent": "bool",
          "ssh": {
            "publicKeys": [
              {
                "keyData": "string",
                "path": "string"
              }
            ]
          }
        },
        "secrets": [
          {
            "sourceVault": {
              "id": "string"
            },
            "vaultCertificates": [
              {
                "certificateStore": "string",
                "certificateUrl": "string"
              }
            ]
          }
        ],
        "windowsConfiguration": {
          "additionalUnattendContent": [
            {
              "componentName": "Microsoft-Windows-Shell-Setup",
              "content": "string",
              "passName": "OobeSystem",
              "settingName": "string"
            }
          ],
          "enableAutomaticUpdates": "bool",
          "patchSettings": {
            "assessmentMode": "string",
            "automaticByPlatformSettings": {
              "rebootSetting": "string"
            },
            "enableHotpatching": "bool",
            "patchMode": "string"
          },
          "provisionVMAgent": "bool",
          "timeZone": "string",
          "winRM": {
            "listeners": [
              {
                "certificateUrl": "string",
                "protocol": "string"
              }
            ]
          }
        }
      },
      "priority": "string",
      "scheduledEventsProfile": {
        "terminateNotificationProfile": {
          "enable": "bool",
          "notBeforeTimeout": "string"
        }
      },
      "securityProfile": {
        "encryptionAtHost": "bool",
        "securityType": "string",
        "uefiSettings": {
          "secureBootEnabled": "bool",
          "vTpmEnabled": "bool"
        }
      },
      "storageProfile": {
        "dataDisks": [
          {
            "caching": "string",
            "createOption": "string",
            "deleteOption": "string",
            "diskIOPSReadWrite": "int",
            "diskMBpsReadWrite": "int",
            "diskSizeGB": "int",
            "lun": "int",
            "managedDisk": {
              "diskEncryptionSet": {
                "id": "string"
              },
              "securityProfile": {
                "diskEncryptionSet": {
                  "id": "string"
                },
                "securityEncryptionType": "string"
              },
              "storageAccountType": "string"
            },
            "name": "string",
            "writeAcceleratorEnabled": "bool"
          }
        ],
        "imageReference": {
          "communityGalleryImageId": "string",
          "id": "string",
          "offer": "string",
          "publisher": "string",
          "sharedGalleryImageId": "string",
          "sku": "string",
          "version": "string"
        },
        "osDisk": {
          "caching": "string",
          "createOption": "string",
          "deleteOption": "string",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "string"
          },
          "diskSizeGB": "int",
          "image": {
            "uri": "string"
          },
          "managedDisk": {
            "diskEncryptionSet": {
              "id": "string"
            },
            "securityProfile": {
              "diskEncryptionSet": {
                "id": "string"
              },
              "securityEncryptionType": "string"
            },
            "storageAccountType": "string"
          },
          "name": "string",
          "osType": "string",
          "vhdContainers": [ "string" ],
          "writeAcceleratorEnabled": "bool"
        }
      },
      "userData": "string"
    },
    "zoneBalance": "bool"
  },
  "zones": [ "string" ]
}

属性值

virtualMachineScaleSets

名称 说明 Value
type 资源类型 “Microsoft.Compute/virtualMachineScaleSets”
apiVersion 资源 API 版本 '2022-03-01'
name 资源名称 字符串 (必需)

字符限制:1-15 (Windows)
1-64 (Linux)



有效字符:
不得使用空格、控制字符或以下字符:
~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \ | ; : . ' " , < > / ?

不能以下划线开头。 不能以句点或连字符结尾。
location 资源位置 字符串 (必需)
标记 资源标记 标记名称和值的字典。 请参阅 模板中的标记
sku 虚拟机规模集 SKU。 Sku
extendedLocation 虚拟机规模集的扩展位置。 ExtendedLocation
标识 虚拟机规模集的标识(如果已配置)。 VirtualMachineScaleSetIdentity
plan 指定有关用于创建虚拟机的市场映像的信息。 此元素仅用于市场映像。 必须先启用映像以供编程使用,然后才能从 API 使用市场映像。 在Azure 门户中,找到要使用的市场映像,然后单击“想要以编程方式部署”“入门”->。 输入任何所需信息,然后单击“ 保存”。 规划
properties 描述虚拟机规模集的属性。 VirtualMachineScaleSetProperties
zones 虚拟机规模集区域。 注意:只能在创建规模集时设置可用性区域 string[]

ExtendedLocation

名称 说明
name 扩展位置的名称。 字符串
type 扩展位置的类型。 “EdgeZone”

VirtualMachineScaleSetIdentity

名称 说明 Value
type 用于虚拟机规模集的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”将从虚拟机规模集中删除任何标识。 “None”
“SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
userAssignedIdentities 与虚拟机规模集关联的用户标识列表。 用户标识字典密钥引用将是 ARM 资源 ID,格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 UserAssignedIdentities

UserAssignedIdentities

名称 说明
{customized property} UserAssignedIdentitiesValue
{customized property} UserAssignedIdentitiesValue

UserAssignedIdentitiesValue

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

计划

名称 说明
name 计划 ID。 字符串
product 指定市场中映像的产品。 此值与 imageReference 元素下的 Offer 相同。 字符串
promotionCode 促销代码。 字符串
发布者 发布者 ID。 字符串

VirtualMachineScaleSetProperties

名称 说明
additionalCapabilities 指定在虚拟机规模集中的虚拟机上启用或禁用的其他功能。 例如:虚拟机是否能够支持使用UltraSSD_LRS存储帐户类型附加托管数据磁盘。 AdditionalCapabilities
automaticRepairsPolicy 自动修复策略。 AutomaticRepairsPolicy
doNotRunExtensionsOnOverprovisionedVMs 启用过度预配后,扩展仅在最终保留的请求数目的 VM 上启动。 因此,此属性将确保扩展不会在额外的过度预配的 VM 上运行。 bool
hostGroup 指定有关虚拟机规模集驻留的专用主机组的信息。

最低 API 版本:2020-06-01。
SubResource
orchestrationMode 指定虚拟机规模集的业务流程模式。 “灵活”
“Uniform”
过度预配 指定是否应过度预配虚拟机规模集。 bool
platformFaultDomainCount 每个放置组的容错域计数。 int
proximityPlacementGroup 指定虚拟机规模集应分配到的邻近放置组的相关信息。

最低 API 版本:2018-04-01。
SubResource
scaleInPolicy 指定在虚拟机规模集中缩放虚拟机时应用的策略。 ScaleInPolicy
singlePlacementGroup 如果为 true,则会将规模集限制为单个放置组,最大大小为 100 个虚拟机。 注意:如果 singlePlacementGroup 为 true,则可能会将其修改为 false。 但是,如果 singlePlacementGroup 为 false,则不可将其修改为 true。 bool
spotRestorePolicy 指定虚拟机规模集的现成还原属性。 SpotRestorePolicy
upgradePolicy 升级策略。 UpgradePolicy
virtualMachineProfile 虚拟机配置文件。 VirtualMachineScaleSetVMProfile
zoneBalance 在发生区域中断时,是否强制在 x 区域间严格均匀地进行虚拟机分发。 仅当规模集的 zone 属性包含多个区域时,才能设置 zoneBalance 属性。 如果没有指定区域或仅指定了一个区域,则不应设置 zoneBalance 属性。 bool

AdditionalCapabilities

名称 说明
hibernationEnabled 在 VM 上启用或禁用休眠功能的标志。 bool
ultraSSDEnabled 一个标志,用于启用或禁用在 VM 或 VMSS 上具有UltraSSD_LRS存储帐户类型的一个或多个托管数据磁盘的功能。 仅当启用此属性时,才能将存储帐户类型为 UltraSSD_LRS 的托管磁盘添加到虚拟机或虚拟机规模集。 bool

AutomaticRepairsPolicy

名称 说明
enabled 指定是否应在虚拟机规模集上启用自动修复。 默认值为 false。 bool
gracePeriod 由于 VM 上的状态更改而暂停自动修复的时间量。 宽限时间在状态更改完成后开始。 这有助于避免过早或意外修复。 持续时间应以 ISO 8601 格式指定。 PT10M) (允许的最小宽限期为 10 分钟,这也是默认值。 pt90M) (允许的最大宽限期为 90 分钟。 字符串
repairAction 修复操作的类型 (替换、重启、重置映像) ,这些操作将用于修复规模集中的不正常虚拟机。 默认值为 replace。 “Reimage”
“Replace”
“重启”

SubResource

名称 说明 Value
id 资源 ID 字符串

ScaleInPolicy

名称 说明
forceDeletion 此属性允许指定在虚拟机规模集正在缩放时,是否必须强制删除选择删除的虚拟机。 (预览版中的功能) bool
规则 在虚拟机规模集中缩放时要遵循的规则。

可能的值为:

默认 在中缩放虚拟机规模集时,如果规模集是区域性规模集,则规模集将首先跨区域进行均衡。 然后,它将尽可能跨容错域进行均衡。 在每个容错域中,选择要删除的虚拟机将是最新的虚拟机,这些虚拟机不受横向缩减保护。

OldestVM 当虚拟机规模集进行横向缩减时,将选择最旧的不受缩减保护的虚拟机进行删除。 对于区域性虚拟机规模集,规模集将首先跨区域进行均衡。 在每个区域中,将选择未受保护的最早虚拟机进行删除。

NewestVM 在缩减虚拟机规模集时,将选择未受到横向缩减保护的最新虚拟机进行删除。 对于区域性虚拟机规模集,规模集将首先跨区域进行均衡。 在每个区域中,将选择未受保护的最新虚拟机进行删除。

包含任意项的字符串数组:
'Default'
“NewestVM”
“OldestVM”

SpotRestorePolicy

名称 说明
enabled 启用现成-试用-还原功能,根据容量可用性和定价约束尝试以机会方式还原已逐出的 VMSS SPOT 实例 bool
restoreTimeout 表示为 ISO 8601 持续时间的超时值,此后平台不会尝试还原 VMSS SPOT 实例 字符串

UpgradePolicy

名称 说明
automaticOSUpgradePolicy 用于执行自动 OS 升级的配置参数。 AutomaticOSUpgradePolicy
mode 指定升级到规模集中虚拟机的模式。

可能的值为:

手动 - 控制将更新应用到规模集中的虚拟机。 可以使用 manualUpgrade 操作执行此操作。

自动 - 规模集中的所有虚拟机同时自动更新。
“自动”
“手动”
“滚动”
rollingUpgradePolicy 执行滚动升级时使用的配置参数。 RollingUpgradePolicy

AutomaticOSUpgradePolicy

名称 说明
disableAutomaticRollback 是否应禁用 OS 映像回滚功能。 默认值为 false。 bool
enableAutomaticOSUpgrade 指示当较新版本的 OS 映像可用时,是否应以滚动方式自动将 OS 升级应用于规模集实例。 默认值为 false。

对于基于 Windows 的规模集,如果此值设置为 true,enableAutomaticUpdates 将自动设置为 false,并且不能设置为 true。
bool
useRollingUpgradePolicy 指示是否应在自动操作系统升级期间使用滚动升级策略。 默认值为 false。 如果未在 VMSS 上定义任何策略,则自动 OS 升级将回退到默认策略。 bool

RollingUpgradePolicy

名称 说明
enableCrossZoneUpgrade 允许 VMSS 在构造升级批处理时忽略 AZ 边界。 请考虑更新域和 maxBatchInstancePercent 以确定批大小。 bool
maxBatchInstancePercent 在一批中通过滚动升级同时升级的总虚拟机实例的最大百分比。 由于这是最大值,以前或将来的批处理中运行不正常的实例可能会导致批处理中实例的百分比降低,以确保更高的可靠性。 此参数的默认值为 20%。 int

约束:
最小值 = 5
最大值 = 100
maxUnhealthyInstancePercent 规模集中可能同时处于不正常状态的虚拟机实例总数的最大百分比,该百分比可能是升级的结果,或者是在滚动升级中止之前虚拟机运行状况检查发现处于不正常状态的结果。 在启动任何批处理之前,将检查此约束。 此参数的默认值为 20%。 int

约束:
最小值 = 5
最大值 = 100
maxUnhealthyUpgradedInstancePercent 可发现处于不正常状态的已升级虚拟机实例的最大百分比。 此检查将在每个批升级后发生。 如果超过此百分比,滚动更新将中止。 此参数的默认值为 20%。 int

约束:
最小值 = 0
最大值 = 100
pauseTimeBetweenBatches 在一个批处理中完成所有虚拟机的更新和开始下一批之间的等待时间。 持续时间应以 ISO 8601 格式指定。 PT0S) (默认值为 0 秒。 字符串
prioritizeUnhealthyInstances 升级规模集中所有运行不正常的实例,然后再升级任何正常实例。 bool

VirtualMachineScaleSetVMProfile

名称 说明
applicationProfile 指定应提供给 VM/VMSS 的库应用程序 ApplicationProfile
billingProfile 指定 Azure 现成 VMSS 的计费相关详细信息。

最低 API 版本:2019-03-01。
BillingProfile
capacityReservation 指定规模集的容量预留相关详细信息。

最低 API 版本:2021-04-01。
CapacityReservationProfile
diagnosticsProfile 指定启动诊断设置状态。

最低 API 版本:2015-06-15。
DiagnosticsProfile
evictionPolicy 指定 Azure 现成虚拟机和 Azure 现成规模集的逐出策略。

对于 Azure 现成虚拟机,支持“Deallocate”和“Delete”,最低 api 版本为 2019-03-01。

对于 Azure 现成规模集,支持“Deallocate”和“Delete”,最低 api 版本为 2017-10-30-preview。
“Deallocate”
'Delete'
extensionProfile 为规模集中的虚拟机上安装的扩展指定设置的集合。 VirtualMachineScaleSetExtensionProfile
hardwareProfile 指定规模集的硬件配置文件相关详细信息。

最低 API 版本:2022-03-01。
VirtualMachineScaleSetHardwareProfile
LicenseType 指定正在使用的映像或磁盘在本地获得许可。

Windows Server 操作系统的可能值为:

Windows_Client

Windows_Server

Linux Server 操作系统的可能值为:

RHEL) 的RHEL_BYOS (

SUSE) SLES_BYOS (

有关详细信息,请参阅 适用于 Windows Server 的 Azure 混合使用权益

适用于 Linux 服务器的 Azure 混合使用权益

最低 API 版本:2015-06-15
字符串
networkProfile 指定规模集中虚拟机网络接口的属性。 VirtualMachineScaleSetNetworkProfile
osProfile 指定规模集中虚拟机的操作系统设置。 VirtualMachineScaleSetOSProfile
priority 指定规模集中虚拟机的优先级。

最低 API 版本:2017-10-30-preview
'Low'
'Regular'
“Spot”
scheduledEventsProfile 指定与计划事件相关的配置。 ScheduledEventsProfile
securityProfile 为规模集中的虚拟机指定与安全相关的配置文件设置。 SecurityProfile
storageProfile 指定虚拟机磁盘的存储设置。 VirtualMachineScaleSetStorageProfile
userData 规模集中虚拟机的 UserData,必须采用 base-64 编码。 客户不应在此处传递任何机密。

最低 API 版本:2021-03-01
字符串

ApplicationProfile

名称 说明
galleryApplications 指定应提供给 VM/VMSS 的库应用程序 VMGalleryApplication[]

VMGalleryApplication

名称 说明
configurationReference 可选,指定 Azure Blob 的 URI,该 URI 将替换包的默认配置(如果提供) 字符串
enableAutomaticUpgrade 如果设置为 true,则当 PIR/SIG 中提供了新的库应用程序版本时,它将针对 VM/VMSS 自动更新 bool
顺序 可选,指定包的安装顺序 int
packageReferenceId 指定 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} 格式的 GalleryApplicationVersion 资源 ID 字符串 (必需)
标记 可选,指定用于更多泛型上下文的传递值。 字符串
treatFailureAsDeploymentFailure 可选,如果为 true,则 VmApplication 中任何操作的任何失败都将使部署失败 bool

BillingProfile

名称 说明
maxPrice 指定愿意为 Azure 现成 VM/VMSS 支付的最高价格。 此价格以美元为单位。

此价格将与 VM 大小的当前 Azure 现成价格进行比较。 此外,在创建/更新 Azure 现成 VM/VMSS 时会比较价格,仅当 maxPrice 大于当前 Azure 现成价格时,操作才会成功。

如果创建 VM/VMSS 后当前 Azure 现成价格超出 maxPrice,maxPrice 还将用于逐出 Azure 现成 VM/VMSS。

可能的值为:

- 任何大于零的十进制值。 示例:0.01538

-1 – 指示默认价格是按需的。

可以将 maxPrice 设置为 -1,以指示不应出于价格原因逐出 Azure 现成 VM/VMSS。 此外,如果未提供,则默认最大价格为 -1。

最低 API 版本:2019-03-01。 若要指定十进制值,请使用 json () 函数。
int 或 json decimal

CapacityReservationProfile

名称 说明
capacityReservationGroup 指定容量预留组资源 ID,该 ID 用于分配虚拟机或规模集 VM 实例,前提是已预留足够的容量。 有关更多详细信息,请参阅 https://aka.ms/CapacityReservation SubResource

DiagnosticsProfile

名称 说明
bootDiagnostics 启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图以诊断 VM 状态。
注意:如果指定 storageUri,请确保存储帐户与 VM 位于同一区域和订阅中。

可以轻松查看控制台日志的输出。

Azure 还使你能够查看虚拟机监控程序中 VM 的屏幕截图。
BootDiagnostics

BootDiagnostics

名称 说明
enabled 是否应在虚拟机上启用启动诊断。 bool
storageUri 用于放置控制台输出和屏幕截图的存储帐户的 URI。

如果在启用启动诊断时未指定 storageUri,则将使用托管存储。
字符串

VirtualMachineScaleSetExtensionProfile

名称 说明
扩展 虚拟机规模集子扩展资源。 VirtualMachineScaleSetExtension[]
extensionsTimeBudget 指定为所有扩展分配的启动时间。 持续时间应介于 15 分钟到 120 分钟之间, (包括) ,并且应以 ISO 8601 格式指定。 默认值为 90 分钟 (PT1H30M) 。

最低 API 版本:2020-06-01
字符串

VirtualMachineScaleSetExtension

名称 说明
name 扩展插件的名称。 string
properties 介绍虚拟机规模集扩展的属性。 VirtualMachineScaleSetExtensionProperties

VirtualMachineScaleSetExtensionProperties

名称 说明
autoUpgradeMinorVersion 指示如果扩展在部署时可用,则是否应使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。 bool
enableAutomaticUpgrade 指示如果有较新版本的可用扩展,则平台是否应自动升级扩展。 bool
forceUpdateTag 如果提供的值与以前的值不同,则即使扩展配置未更改,扩展处理程序也将被迫更新。 字符串
protectedSettings 该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。
protectedSettingsFromKeyVault 扩展保护的设置,这些设置通过引用传递,并从密钥保管库使用 KeyVaultSecretReference
provisionAfterExtensions 扩展名称的集合,之后需要预配此扩展。 string[]
发布者 扩展处理程序发布者的名称。 字符串
设置 扩展的 Json 格式公共设置。
suppressFailures 指示是否将禁止从扩展引发的故障, (操作故障(如未连接到 VM)将不会被禁止,而不考虑此值) 。 默认值为 false。 bool
类型 指定扩展的类型;例如“CustomScriptExtension”。 字符串
typeHandlerVersion 指定脚本处理程序的版本。 字符串

KeyVaultSecretReference

名称 说明
secretUrl 引用密钥保管库中的机密的 URL。 字符串 (必需)
sourceVault 包含机密的密钥保管库的相对 URL。 需要 SubResource ()

VirtualMachineScaleSetHardwareProfile

名称 说明
vmSizeProperties 指定用于自定义虚拟机大小的属性。 最低 API 版本:2022-03-01。

有关更多详细信息,请按照 VM 自定义 中的说明进行操作。
VMSizeProperties

VMSizeProperties

名称 说明
vCPUsAvailable 指定可用于 VM 的 vCPU 数。

如果未在请求正文中指定此属性,则默认行为是将其设置为可用于该 VM 大小的 vCPU 的值,该 VM 大小在 API 响应中公开, 即列出区域中的所有可用虚拟机大小
int
vCPUsPerCore 指定 vCPU 与物理核心的比率。

如果未在请求正文中指定此属性,则对于列出区域中所有可用虚拟机大小的 API 响应中公开的 VM 大小,默认行为设置为 vCPUsPerCore 的值

将此属性设置为 1 还意味着禁用超线程。
int

VirtualMachineScaleSetNetworkProfile

名称 说明
healthProbe 对负载均衡器探测的引用,用于确定虚拟机规模集中实例的运行状况。 引用的格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}”。 ApiEntityReference
networkApiVersion 指定在业务流程模式为“灵活”的虚拟机规模集的网络接口配置中创建网络资源时使用的 Microsoft.Network API 版本 '2020-11-01'
networkInterfaceConfigurations 网络配置列表。 VirtualMachineScaleSetNetworkConfiguration[]

ApiEntityReference

名称 说明 Value
id 采用 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 格式的 ARM 资源 ID。 字符串

VirtualMachineScaleSetNetworkConfiguration

名称 说明 Value
id 资源 ID 字符串
name 网络配置名称。 字符串 (必需)
properties 介绍虚拟机规模集网络配置文件的 IP 配置。 VirtualMachineScaleSetNetworkConfigurationProperties

VirtualMachineScaleSetNetworkConfigurationProperties

名称 说明
deleteOption 指定删除 VM 时网络接口会发生什么情况 “Delete”
“分离”
dnsSettings 要应用于网络接口的 dns 设置。 VirtualMachineScaleSetNetworkConfigurationDnsSetting...
enableAcceleratedNetworking 指定网络接口是否已启用加速网络。 bool
enableFpga 指定网络接口是否已启用 FPGA 网络。 bool
enableIPForwarding 是否在此 NIC 上启用了 IP 转发。 bool
ipConfigurations 指定网络接口的 IP 配置。 VirtualMachineScaleSetIPConfiguration[] (必需的)
networkSecurityGroup 网络安全组。 SubResource
角色实体 指定主网络接口,以防虚拟机具有 1 个以上的网络接口。 bool

VirtualMachineScaleSetNetworkConfigurationDnsSetting...

名称 说明
dnsServers DNS 服务器 IP 地址列表 string[]

VirtualMachineScaleSetIPConfiguration

名称 说明 Value
id 资源 ID 字符串
name IP 配置名称。 字符串 (必需)
properties 介绍虚拟机规模集网络配置文件的 IP 配置属性。 VirtualMachineScaleSetIPConfigurationProperties

VirtualMachineScaleSetIPConfigurationProperties

名称 说明
applicationGatewayBackendAddressPools 指定对应用程序网关的后端地址池的引用数组。 规模集可以引用多个应用程序网关的后端地址池。 多个规模集不能使用相同的应用程序网关。 SubResource[]
applicationSecurityGroups 指定对应用程序安全组的引用数组。 SubResource[]
loadBalancerBackendAddressPools 指定对负载均衡器的后端地址池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的后端地址池。 多个规模集不能使用相同的基本 SKU 负载均衡器。 SubResource[]
loadBalancerInboundNatPools 指定对负载均衡器的入站 Nat 池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的入站 nat 池。 多个规模集不能使用相同的基本 SKU 负载均衡器。 SubResource[]
角色实体 指定主网络接口,以防虚拟机具有 1 个以上的网络接口。 bool
privateIPAddressVersion 从 Api-Version 2017-03-30 开始提供,它表示特定的 ip 配置是 IPv4 还是 IPv6。 默认值为 IPv4。 可能的值为:“IPv4”和“IPv6”。 “IPv4”
“IPv6”
publicIPAddressConfiguration publicIPAddressConfiguration。 VirtualMachineScaleSetPublicIPAddressConfiguration
子网 指定子网的标识符。 ApiEntityReference

VirtualMachineScaleSetPublicIPAddressConfiguration

名称 说明
name publicIP 地址配置名称。 字符串 (必需)
properties 介绍虚拟机规模集 IP 配置的 PublicIPAddress 配置 VirtualMachineScaleSetPublicIPAddressConfigurationPr...
sku 描述公共 IP SKU。 只能将 OrchestrationMode 设置为灵活。 PublicIPAddressSku

VirtualMachineScaleSetPublicIPAddressConfigurationPr...

名称 说明
deleteOption 指定删除 VM 时公共 IP 会发生什么情况 'Delete'
“分离”
dnsSettings 要应用于 publicIP 地址 的 DNS 设置。 VirtualMachineScaleSetPublicIPAddressConfigurationDn...
idleTimeoutInMinutes 公共 IP 地址的空闲超时。 int
ipTags 与公共 IP 地址关联的 IP 标记列表。 VirtualMachineScaleSetIpTag[]
publicIPAddressVersion 从 Api-Version 2019-07-01 起提供,它表示特定的 ip 配置是 IPv4 还是 IPv6。 默认值为 IPv4。 可能的值为:“IPv4”和“IPv6”。 “IPv4”
“IPv6”
publicIPPrefix 要从中分配 publicIP 地址的 PublicIPPrefix。 SubResource

VirtualMachineScaleSetPublicIPAddressConfigurationDn...

名称 说明
domainNameLabel 域名标签。域名标签和 vm 索引的串联将是将创建的 PublicIPAddress 资源的域名标签 字符串 (必需)

VirtualMachineScaleSetIpTag

名称 说明
ipTagType IP 标记类型。 示例:FirstPartyUsage。 字符串
标记 与公共 IP 关联的 IP 标记。 示例:SQL、存储等。 字符串

PublicIPAddressSku

名称 说明
name 指定公共 IP SKU 名称 'Basic'
'Standard'
指定公共 IP SKU 层 'Global'
'Regional'

VirtualMachineScaleSetOSProfile

名称 说明
adminPassword 指定管理员帐户的密码。

Windows) 最小长度 (: 8 个字符

Linux) 最小长度 (: 6 个字符

最大长度 (Windows) : 123 个字符

最大长度 (Linux) : 72 个字符

复杂性要求: 需要满足以下 4 个条件中的 3 个
包含较低字符
包含大写字符
有一个数字
具有一个特殊字符 (正则表达式匹配 [\W_])

不允许的值: “abc@123”、“P@$$w 0rd”、“P@ssw0rd”、“P@ssword123”、“Pa$$word”、“pass@word1”、“Password!”、“Password1”、“Password22”、“iloveyou!”

有关重置密码的信息,请参阅 如何在 Windows VM 中重置远程桌面服务或其登录密码

有关重置 root 密码的信息,请参阅使用 VMAccess 扩展管理用户、SSH 和检查或修复 Azure Linux VM 上的磁盘
字符串

约束:
敏感值。 作为安全参数传入。
adminUsername 指定管理员帐户的名称。

仅限 Windows 的限制: 不能以“.”结尾

不允许的值: “administrator”, “admin”, “user”, “user1”, “test”, “user2”, “test1”, “user3”, “admin1”, “1”, “123”、“a”、“actuser”、“adm”、“admin2”、“aspnet”、“backup”、“console”、“david”、“guest”、“john”、“owner”、“root”、“server”、“sql”、“support”、“support_388945a0”、“sys”、“test2”、“test3”、“user4”、“user5”。

Linux) (最小长度: 1 个字符

最大长度 (Linux) : 64 个字符

最大长度 (Windows) : 20 个字符
字符串
allowExtensionOperations 指定是否应在虚拟机规模集上允许扩展操作。

仅当虚拟机规模集上不存在任何扩展时,才能将其设置为 False。
bool
computerNamePrefix 指定规模集中所有虚拟机的计算机名称前缀。 计算机名称前缀的长度必须为 1 到 15 个字符。 字符串
customData 指定自定义数据的 Base-64 编码的字符串。 Base-64 编码的字符串将解码为一个二元数组并作为一个文件保存在虚拟机上。 该二元数组的最大长度为 65535 字节。

有关对 VM 使用 cloud-init,请参阅 在创建期间使用 cloud-init 自定义 Linux VM
字符串
linuxConfiguration 指定虚拟机上的 Linux 操作系统设置。

有关支持的 Linux 发行版的列表,请参阅 Linux on Azure-Endorsed Distributions
LinuxConfiguration
机密 指定应安装在规模集中虚拟机上的证书集。 若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展 VaultSecretGroup[]
windowsConfiguration 指定虚拟机上的 Windows 操作系统设置。 WindowsConfiguration

LinuxConfiguration

名称 说明
disablePasswordAuthentication 指定是否应禁用密码身份验证。 bool
patchSettings [预览功能]指定与 Linux 上的 VM 来宾修补相关的设置。 LinuxPatchSettings
provisionVMAgent 指示是否应在虚拟机上设置虚拟机代理。

如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。
bool
ssh 指定 Linux OS 的 SSH 密钥配置。 SshConfiguration

LinuxPatchSettings

名称 说明
assessmentMode 指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值为:

ImageDefault - 控制虚拟机上修补程序评估的时间。

AutomaticByPlatform - 平台将触发定期修补程序评估。 属性 provisionVMAgent 必须为 true。
'AutomaticByPlatform'
“ImageDefault”
automaticByPlatformSettings 指定 Linux 上的 VM 来宾修补中的修补模式 AutomaticByPlatform 的其他设置。 LinuxVMGuestPatchAutomaticByPlatformSettings
patchMode 指定将 VM 来宾修补到 IaaS 虚拟机或与虚拟机规模集关联的虚拟机的模式,业务流程模式为灵活。

可能的值为:

ImageDefault - 使用虚拟机的默认修补配置。

AutomaticByPlatform - 虚拟机将由平台自动更新。 属性 provisionVMAgent 必须为 true
'AutomaticByPlatform'
“ImageDefault”

LinuxVMGuestPatchAutomaticByPlatformSettings

名称 说明
rebootSetting 指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。 “Always”
'IfRequired'
“从不”
“未知”

SshConfiguration

名称 说明
publicKeys 用于在基于 Linux 的 VM 中进行身份验证的 SSH 公钥列表。 SshPublicKey[]

SshPublicKey

名称 说明
keyData 用于通过 ssh 向 VM 进行身份验证的 SSH 公钥证书。 密钥需要至少为 2048 位且采用 ssh-rsa 格式。

若要创建 SSH 密钥,请参阅 [在 Linux 和 Mac 上为 Azure 中的 Linux VM 创建 SSH 密钥]/azure/virtual-machines/linux/create-ssh-keys-detailed) 。
字符串
path 指定所创建的 VM 上存储 ssh 公钥的完整路径。 如果该文件已存在,则指定的密钥将追加到该文件上。 示例:/home/user/.ssh/authorized_keys 字符串

VaultSecretGroup

名称 说明
sourceVault 包含 VaultCertificates 中所有证书的密钥保管库的相对 URL。 SubResource
vaultCertificates SourceVault 中包含证书的密钥保管库引用列表。 VaultCertificate[]

VaultCertificate

名称 说明
certificateStore 对于 Windows VM,指定应向其添加证书的虚拟机上的证书存储。 指定的证书存储隐式位于 LocalMachine 帐户中。

对于 Linux VM,证书文件放置在 /var/lib/waagent 目录下,X509 证书文件的文件名 <为 UppercaseThumbprint.crt>, <私钥文件名为 UppercaseThumbprint.prv>。 这两个文件都采用 .pem 格式。
字符串
certificateUrl 这是已作为机密上传到密钥保管库的证书的 URL。 若要将机密添加到密钥保管库,请参阅将密钥或机密添加到密钥保管库。 在这种情况下,证书必须是以下 JSON 对象的 Base64 编码,该对象以 UTF-8 编码:

{
“data”:“{Base64-encoded-certificate}”,
“dataType”:“pfx”,
“password”:“{pfx-file-password}”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展
字符串

WindowsConfiguration

名称 说明
additionalUnattendContent 指定可包含在 Windows 安装程序使用的 Unattend.xml 文件中的其他 Base-64 编码 XML 格式信息。 AdditionalUnattendContent[]
enableAutomaticUpdates 指示是否为 Windows 虚拟机启用自动汇报。 默认值为 true。

对于虚拟机规模集,可以更新此属性,更新将在 OS 重新预配时生效。
bool
patchSettings [预览功能]指定与 Windows 上的 VM 来宾修补相关的设置。 PatchSettings
provisionVMAgent 指示是否应在虚拟机上设置虚拟机代理。

如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。
bool
timezone 指定虚拟机的时区。 例如“太平洋标准时间”。

可能的值可以是 TimeZoneInfo.GetSystemTimeZones 返回的时区 TimeZoneInfo.Id 值。
字符串
winRM 指定 Windows 远程管理侦听器。 这将启用远程 Windows PowerShell。 WinRMConfiguration

AdditionalUnattendContent

名称 说明
componentName 组件名称。 目前,唯一允许的值是 Microsoft-Windows-Shell-Setup。 “Microsoft-Windows-Shell-Setup”
内容 指定添加到指定路径和组件的 unattend.xml 文件的 XML 格式化内容。 XML 必须小于 4KB,并且必须包含要插入的设置或功能的根元素。 字符串
passName 传递名称。 目前,唯一允许的值为 OobeSystem。 'OobeSystem'
settingName 指定内容适用于的设置的名称。 可能的值为:FirstLogonCommands 和 AutoLogon。 “AutoLogon”
'FirstLogonCommands'

PatchSettings

名称 说明
assessmentMode 指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值为:

ImageDefault - 控制虚拟机上修补程序评估的时间。

AutomaticByPlatform - 平台将触发定期修补程序评估。 属性 provisionVMAgent 必须为 true。
'AutomaticByPlatform'
“ImageDefault”
automaticByPlatformSettings 指定 Windows 上的 VM 来宾修补中的修补模式 AutomaticByPlatform 的其他设置。 WindowsVMGuestPatchAutomaticByPlatformSettings
enableHotpatching 使客户无需重启即可修补其 Azure VM。 对于 enableHotpatching,必须将“provisionVMAgent”设置为 true,“patchMode”必须设置为“AutomaticByPlatform”。 bool
patchMode 指定将 VM 来宾修补到 IaaS 虚拟机或与虚拟机规模集关联的虚拟机的模式,业务流程模式为灵活。

可能的值为:

手动 - 控制将修补程序应用到虚拟机。 为此,请在 VM 中手动应用修补程序。 在此模式下,自动更新被禁用;属性 WindowsConfiguration.enableAutomaticUpdates 必须为 false

AutomaticByOS - 操作系统会自动更新虚拟机。 属性 WindowsConfiguration.enableAutomaticUpdates 必须为 true。

AutomaticByPlatform - 虚拟机将由平台自动更新。 属性 provisionVMAgent 和 WindowsConfiguration.enableAutomaticUpdates 必须为 true
“AutomaticByOS”
“AutomaticByPlatform”
“手动”

WindowsVMGuestPatchAutomaticByPlatformSettings

名称 说明
rebootSetting 指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。 “Always”
“IfRequired”
“从不”
“未知”

WinRMConfiguration

名称 说明
侦听器 Windows 远程管理侦听器的列表 WinRMListener[]

WinRMListener

名称 说明
certificateUrl 这是已作为机密上传到密钥保管库的证书的 URL。 若要向密钥保管库添加机密,请参阅将密钥或机密添加到密钥保管库。 在这种情况下,证书必须是以下 JSON 对象的 Base64 编码,该对象以 UTF-8 编码:

{
“data”:“{Base64-encoded-certificate}”,
“dataType”:“pfx”,
“password”:“{pfx-file-password}”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展
字符串
protocol 指定 WinRM 侦听器的协议。

可能的值为:
http

https
“Http”
“Https”

ScheduledEventsProfile

名称 说明
terminateNotificationProfile 指定“终止计划事件”相关配置。 TerminateNotificationProfile

TerminateNotificationProfile

名称 说明
enable 指定是启用或禁用 Terminate Scheduled 事件。 bool
notBeforeTimeout 在自动批准事件之前,要删除的虚拟机可能需要批准“终止计划事件”的可配置时间长度, () 超时。 必须以 ISO 8601 格式指定配置,默认值为 5 分钟 (PT5M) 字符串

SecurityProfile

名称 说明
encryptionAtHost 用户可以在请求中使用此属性来启用或禁用虚拟机或虚拟机规模集的主机加密。 这将为所有磁盘启用加密,包括主机本身的资源/临时磁盘。

默认值:除非资源的此属性设置为 true,否则将禁用主机加密。
bool
securityType 指定虚拟机的 SecurityType。 必须将其设置为任何指定的值才能启用 UefiSettings。

默认值:除非设置了此属性,否则不会启用 UefiSettings。
“ConfidentialVM”
“TrustedLaunch”
uefiSettings 指定创建虚拟机时使用的安全启动和 vTPM 等安全设置。

最低 API 版本:2020-12-01
UefiSettings

UefiSettings

名称 说明
secureBootEnabled 指定是否应在虚拟机上启用安全启动。

最低 API 版本:2020-12-01
bool
vTpmEnabled 指定是否应在虚拟机上启用 vTPM。

最低 API 版本:2020-12-01
bool

VirtualMachineScaleSetStorageProfile

名称 说明
dataDisks 指定用于将数据磁盘添加到规模集中的虚拟机的参数。

有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD
VirtualMachineScaleSetDataDisk[]
imageReference 指定要使用的映像的相关信息。 可以指定有关平台映像、市场映像或虚拟机映像的信息。 若要使用平台映像、市场映像或虚拟机映像,但未在其他创建操作中使用,则此元素是必需的。 ImageReference
osDisk 指定有关规模集中虚拟机使用的操作系统磁盘的信息。

有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD
VirtualMachineScaleSetOSDisk

VirtualMachineScaleSetDataDisk

名称 说明
缓存 指定缓存要求。

可能的值为:



ReadOnly

ReadWrite

默认值: 对于标准存储,无。适用于高级存储的 ReadOnly
“None”
“ReadOnly”
“ReadWrite”
createOption 创建选项。 “附加”
“空”
“FromImage” (必需)
deleteOption 指定在 VMSS 灵活删除时是应删除还是分离数据磁盘 (此功能仅适用于具有灵活 OrchestrationMode 的 VMSs) 。

可能的值:

删除 如果使用此值,则删除 VMSS Flex VM 时会删除数据磁盘。

分离 如果使用此值,则删除 VMSS Flex VM 后,数据磁盘将保留。

默认值设置为 Delete
“Delete”
“分离”
diskIOPSReadWrite 指定托管磁盘 Read-Write IOPS。 应仅在UltraSSD_LRS StorageAccountType 时才使用。 如果未指定,将根据 diskSizeGB 分配默认值。 int
diskMBpsReadWrite 指定托管磁盘的带宽(以 MB/秒为单位)。 应仅在UltraSSD_LRS StorageAccountType 时才使用。 如果未指定,将根据 diskSizeGB 分配默认值。 int
diskSizeGB 指定空数据磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。

此值不能大于 1023 GB
int
lun 指定数据磁盘的逻辑单元号。 此值用于标识 VM 中的数据磁盘,因此对于附加到 VM 的每个数据磁盘必须是唯一的。 int (必需)
managedDisk 托管磁盘参数。 VirtualMachineScaleSetManagedDiskParameters
name 磁盘名称。 字符串
writeAcceleratorEnabled 指定是在磁盘上启用或禁用 writeAccelerator。 bool

VirtualMachineScaleSetManagedDiskParameters

名称 说明
diskEncryptionSet 指定托管磁盘的客户托管磁盘加密集资源 ID。 DiskEncryptionSetParameters
securityProfile 指定托管磁盘的安全配置文件。 VMDiskSecurityProfile
storageAccountType 指定托管磁盘的存储帐户类型。 注意:UltraSSD_LRS只能与数据磁盘一起使用,它不能与 OS 磁盘一起使用。 “PremiumV2_LRS”
“Premium_LRS”
“Premium_ZRS”
“StandardSSD_LRS”
“StandardSSD_ZRS”
“Standard_LRS”
“UltraSSD_LRS”

DiskEncryptionSetParameters

名称 说明 Value
id 资源 ID 字符串

VMDiskSecurityProfile

名称 说明
diskEncryptionSet 指定用于客户托管密钥加密的机密 VM OS 磁盘和 VMGuest Blob 的托管磁盘的客户托管磁盘加密集资源 ID。 DiskEncryptionSetParameters
securityEncryptionType 指定托管磁盘的 EncryptionType。
它设置为 DiskWithVMGuestState 以加密托管磁盘和 VMGuestState blob,设置为 VMGuestStateOnly,仅加密 VMGuestState blob。

注意:只能为机密 VM 设置它。
“DiskWithVMGuestState”
'VMGuestStateOnly'

ImageReference

名称 说明
communityGalleryImageId 为 vm 部署指定了社区库映像的唯一 ID。 这可以从社区库映像 GET 调用中提取。 string
id 资源 ID 字符串
offer 指定用于创建虚拟机的平台映像或市场映像的套餐。 字符串
发布者 映像发布者。 字符串
sharedGalleryImageId 指定 VM 部署的共享库映像唯一 ID。 这可以从共享库映像 GET 调用中提取。 字符串
sku 映像 SKU。 字符串
版本 指定用于创建虚拟机的平台映像或市场映像的版本。 允许的格式为 Major.Minor.Build 或“latest”。 “主要”、“次要”和“生成”是十进制数。 指定“latest”以使用部署时可用的最新版本的映像。 即使使用“latest”,VM 映像也不会在部署后自动更新,即使新版本可用。 请不要对库映像部署使用字段“版本”,库映像应始终使用“id”字段进行部署,若要使用库映像的“最新”版本,只需在“id”字段中设置“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}”,无需版本输入。 字符串

VirtualMachineScaleSetOSDisk

名称 说明
缓存 指定缓存要求。

可能的值为:



ReadOnly

ReadWrite

默认值: 对于标准存储,无。高级存储的 ReadOnly
“None”
“ReadOnly”
“ReadWrite”
createOption 指定应如何创建规模集中的虚拟机。

唯一允许的值是: FromImage \u2013 在使用映像创建虚拟机时,将使用此值。 如果使用平台映像,则还要使用上述 imageReference 元素。 如果使用市场映像,则还需使用前面所述的计划元素。
“Attach”
“Empty”
“FromImage” (必需)
deleteOption 指定在 VMSS 灵活删除时是应删除还是分离 OS 磁盘 (此功能仅适用于灵活 OrchestrationMode) VMSS。

可能的值:

删除 如果使用此值,则会在删除 VMSS Flex VM 时删除 OS 磁盘。

分离 如果使用此值,则会在删除 VMSS Flex VM 后保留 OS 磁盘。

默认值设置为 Delete。 对于临时 OS 磁盘,默认值设置为 Delete。 用户无法更改临时 OS 磁盘的删除选项。
'Delete'
“分离”
diffDiskSettings 指定虚拟机规模集使用的操作系统磁盘的临时磁盘设置。 DiffDiskSettings
diskSizeGB 指定操作系统磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。

此值不能大于 1023 GB
int
image 指定要基于规模集的非托管用户映像的信息。 VirtualHardDisk
managedDisk 托管磁盘参数。 VirtualMachineScaleSetManagedDiskParameters
name 磁盘名称。 字符串
osType 此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 类型。

可能的值为:

Windows

Linux
'Linux'
“Windows”
vhdContainers 指定用于存储规模集操作系统磁盘的容器 URL。 string[]
writeAcceleratorEnabled 指定是否应在磁盘上启用或禁用 writeAccelerator。 bool

DiffDiskSettings

名称 说明
选项 指定操作系统磁盘的临时磁盘设置。 “Local”
放置 指定操作系统磁盘的临时磁盘放置。

可能的值为:

CacheDisk

ResourceDisk

默认值:如果为 VM 大小配置了 缓存磁盘 ,则使用 ResourceDisk

请参阅 /azure/virtual-machines/windows/size 和 /azure/virtual-machines/linux/size 上的 Windows VM 的 VM 大小文档,检查哪些 VM 大小公开缓存磁盘。
“CacheDisk”
“ResourceDisk”

VirtualHardDisk

名称 说明
uri 指定虚拟硬盘的 URI。 字符串

SKU

名称 说明
容量 指定规模集中的虚拟机数。 int
name SKU 名称。 字符串
指定规模集中虚拟机的层。

可能的值:

标准

基本
字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
使用 LB 探测和自动修复部署 VM 规模集

部署到 Azure
此模板允许在配置了运行状况探测的负载均衡器后面部署 Linux VM 的 VM 规模集。 规模集还启用了自动实例修复策略,宽限期为 30 分钟。
部署将每个 VM 连接到Azure 文件存储共享的 VMSS

部署到 Azure
此模板部署 Ubuntu 虚拟机规模集,并使用自定义脚本扩展将每个 VM 连接到Azure 文件存储共享
使用自定义脚本扩展部署 Windows VM 规模集

部署到 Azure
此模板允许你使用各种 Windows 版本的最新修补版本部署 Windows VM 的 VM 规模集。 这些 VM 具有用于自定义的自定义脚本扩展,并且位于具有用于 rdp 连接的 NAT 规则的负载均衡器后面。
将规模集部署到现有 vnet

部署到 Azure
此模板将 VM 规模集部署到已存在的 vnet 中。
将多个 VM 添加到虚拟机规模集中

部署到 Azure
此模板将创建 N 个具有托管磁盘、公共 IP 和网络接口的 VM。 它将在灵活业务流程模式下的虚拟机规模集中创建 VM。 它们将在虚拟网络中预配,该虚拟网络也将作为部署的一部分创建
VMSS 灵活业务流程模式快速入门 Linux

部署到 Azure
此模板部署一个简单的 VM 规模集,其中实例位于Azure 负载均衡器后面。 VM 规模集处于灵活业务流程模式。 使用 os 参数选择 Linux (Ubuntu) 或 Windows (Windows Server Datacenter 2019) 部署。 注意:此快速入门模板允许从任何 Internet 地址 (SSH、RDP) 对 VM 管理端口进行网络访问,不应用于生产部署。
在 ILB 后面部署具有 Linux VM 的 VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Ubuntu Linux 15.10 或 14.04.4-LTS 部署 Linux VM 的 VM 规模集。 这些 VM 位于具有用于 SSH 连接的 NAT 规则的内部负载均衡器后面。
使用 Linux 自定义映像部署 VM 规模集

部署到 Azure
此模板允许在规模集中部署自定义 VM Linux 映像。 这些 VM 位于负载均衡器后面,默认情况下端口 80) 上的 HTTP 负载均衡 (。 此示例使用自定义脚本执行应用程序部署和更新,可能需要为自己的更新过程提供自定义脚本。 必须在创建 VMSS 的同一订阅和区域中提供 VM 的通用映像。
使用 Linux VM 部署简单的 VM 规模集

部署到 Azure
通过此模板,可以使用 Ubuntu Linux 14.04.4-LTS 或 16.04-LTS 的最新修补版本部署 Linux VM 的简单 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的负载均衡器后面。
在可用区域中部署具有 Linux VM 的 VM 规模集

部署到 Azure
通过此模板,可以使用 Ubuntu Linux 14.04.4-LTS 或 16.04-LTS 的最新修补版本部署 Linux VM 的简单 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的负载均衡器后面。
部署具有主要/辅助体系结构的 Linux VMSS

部署到 Azure
此模板允许在主辅助体系结构中使用自定义脚本扩展部署 Linux VMSS
具有 Linux VM 和公共 IPv4 的简单 VM 规模集(每个 VM)

部署到 Azure
此模板演示如何部署具有负载均衡器、入站 NAT 规则和每个 VM 的公共 IP 的简单规模集。
部署支持受信任启动的 Windows VM 规模集

部署到 Azure
此模板允许使用最新修补版本的 Windows Server 2016、Windows Server 2019 或 Windows Server 2022 Azure Edition 部署支持受信任启动的 Windows VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。 如果启用 Secureboot 和 vTPM,则会在 VMSS 上安装来宾证明扩展。 此扩展将通过云执行远程 证明
使用 Azure 应用程序网关 部署 Ubuntu VM 规模集

部署到 Azure
此模板允许部署与 Azure 应用程序网关 集成的简单 Ubuntu VM 规模集,并且最多支持 1000 个 VM
使用 Linux VM 和自动缩放部署 VM 规模集

部署到 Azure
通过此模板,可以使用 Ubuntu Linux 15.04 或 14.04.4-LTS 的最新修补版本部署 Linux VM 的简单 VM 规模集。 这些 VM 位于具有用于 ssh 连接的 NAT 规则的负载均衡器后面。它们还集成了自动缩放
已启用 SSL 的 VM 规模集

部署到 Azure
使用安全部署的 SSL 证书部署 Web 服务器配置 Azure 密钥保管库
将规模集部署到 Windows 上的现有 vnet

部署到 Azure
此模板将 Windows 2016 Datacenter VM 规模集部署到除名资源组、vnet 和子网中。
使用 Azure 应用程序网关 部署 Windows VM 规模集

部署到 Azure
此模板允许部署与 Azure 应用程序网关 集成的简单 Windows VM 规模集,并且最多支持 1000 个 VM
使用 Windows VM 和自动缩放部署 VM 规模集

部署到 Azure
此模板允许使用 Windows 2008-R2-SP1、2012-Datacenter 或 2012-R2-Datacenter 的最新修补版本部署 Windows VM 的简单 VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。 它们还集成了自动缩放
使用 Windows 自定义映像部署 VM 规模集

部署到 Azure
通过此模板,可以部署简单的 VM 规模集和自定义 Windows 映像。 这些 VM 位于负载均衡器后面,默认情况下端口 80 上的 HTTP 负载均衡 ()
使用 Windows VM 部署简单的 VM 规模集

部署到 Azure
此模板允许你使用各种 Windows 版本的最新修补版本部署 Windows VM 的简单 VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。
在 可用性区域 中使用 Windows VM 部署 VM 规模集

部署到 Azure
此模板允许你使用各种 Windows 版本的最新修补版本部署 Windows VM 的 VM 规模集。 这些 VM 位于具有 RDP 连接的 NAT 规则的负载均衡器后面。
具有公共 IP 前缀的 VMSS

部署到 Azure
用于部署具有公共 IP 前缀的 VMSS 的模板

Terraform (AzAPI 提供程序) 资源定义

virtualMachineScaleSets 资源类型可以通过针对以下操作进行部署:

  • 资源组

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Compute/virtualMachineScaleSets 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/virtualMachineScaleSets@2022-03-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type = "string"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      additionalCapabilities = {
        hibernationEnabled = bool
        ultraSSDEnabled = bool
      }
      automaticRepairsPolicy = {
        enabled = bool
        gracePeriod = "string"
        repairAction = "string"
      }
      doNotRunExtensionsOnOverprovisionedVMs = bool
      hostGroup = {
        id = "string"
      }
      orchestrationMode = "string"
      overprovision = bool
      platformFaultDomainCount = int
      proximityPlacementGroup = {
        id = "string"
      }
      scaleInPolicy = {
        forceDeletion = bool
        rules = [
          "string"
        ]
      }
      singlePlacementGroup = bool
      spotRestorePolicy = {
        enabled = bool
        restoreTimeout = "string"
      }
      upgradePolicy = {
        automaticOSUpgradePolicy = {
          disableAutomaticRollback = bool
          enableAutomaticOSUpgrade = bool
          useRollingUpgradePolicy = bool
        }
        mode = "string"
        rollingUpgradePolicy = {
          enableCrossZoneUpgrade = bool
          maxBatchInstancePercent = int
          maxUnhealthyInstancePercent = int
          maxUnhealthyUpgradedInstancePercent = int
          pauseTimeBetweenBatches = "string"
          prioritizeUnhealthyInstances = bool
        }
      }
      virtualMachineProfile = {
        applicationProfile = {
          galleryApplications = [
            {
              configurationReference = "string"
              enableAutomaticUpgrade = bool
              order = int
              packageReferenceId = "string"
              tags = "string"
              treatFailureAsDeploymentFailure = bool
            }
          ]
        }
        billingProfile = {
          maxPrice = "decimal-as-string"
        }
        capacityReservation = {
          capacityReservationGroup = {
            id = "string"
          }
        }
        diagnosticsProfile = {
          bootDiagnostics = {
            enabled = bool
            storageUri = "string"
          }
        }
        evictionPolicy = "string"
        extensionProfile = {
          extensions = [
            {
              name = "string"
              properties = {
                autoUpgradeMinorVersion = bool
                enableAutomaticUpgrade = bool
                forceUpdateTag = "string"
                protectedSettingsFromKeyVault = {
                  secretUrl = "string"
                  sourceVault = {
                    id = "string"
                  }
                }
                provisionAfterExtensions = [
                  "string"
                ]
                publisher = "string"
                suppressFailures = bool
                type = "string"
                typeHandlerVersion = "string"
              }
            }
          ]
          extensionsTimeBudget = "string"
        }
        hardwareProfile = {
          vmSizeProperties = {
            vCPUsAvailable = int
            vCPUsPerCore = int
          }
        }
        licenseType = "string"
        networkProfile = {
          healthProbe = {
            id = "string"
          }
          networkApiVersion = "2020-11-01"
          networkInterfaceConfigurations = [
            {
              id = "string"
              name = "string"
              properties = {
                deleteOption = "string"
                dnsSettings = {
                  dnsServers = [
                    "string"
                  ]
                }
                enableAcceleratedNetworking = bool
                enableFpga = bool
                enableIPForwarding = bool
                ipConfigurations = [
                  {
                    id = "string"
                    name = "string"
                    properties = {
                      applicationGatewayBackendAddressPools = [
                        {
                          id = "string"
                        }
                      ]
                      applicationSecurityGroups = [
                        {
                          id = "string"
                        }
                      ]
                      loadBalancerBackendAddressPools = [
                        {
                          id = "string"
                        }
                      ]
                      loadBalancerInboundNatPools = [
                        {
                          id = "string"
                        }
                      ]
                      primary = bool
                      privateIPAddressVersion = "string"
                      publicIPAddressConfiguration = {
                        name = "string"
                        properties = {
                          deleteOption = "string"
                          dnsSettings = {
                            domainNameLabel = "string"
                          }
                          idleTimeoutInMinutes = int
                          ipTags = [
                            {
                              ipTagType = "string"
                              tag = "string"
                            }
                          ]
                          publicIPAddressVersion = "string"
                          publicIPPrefix = {
                            id = "string"
                          }
                        }
                        sku = {
                          name = "string"
                          tier = "string"
                        }
                      }
                      subnet = {
                        id = "string"
                      }
                    }
                  }
                ]
                networkSecurityGroup = {
                  id = "string"
                }
                primary = bool
              }
            }
          ]
        }
        osProfile = {
          adminPassword = "string"
          adminUsername = "string"
          allowExtensionOperations = bool
          computerNamePrefix = "string"
          customData = "string"
          linuxConfiguration = {
            disablePasswordAuthentication = bool
            patchSettings = {
              assessmentMode = "string"
              automaticByPlatformSettings = {
                rebootSetting = "string"
              }
              patchMode = "string"
            }
            provisionVMAgent = bool
            ssh = {
              publicKeys = [
                {
                  keyData = "string"
                  path = "string"
                }
              ]
            }
          }
          secrets = [
            {
              sourceVault = {
                id = "string"
              }
              vaultCertificates = [
                {
                  certificateStore = "string"
                  certificateUrl = "string"
                }
              ]
            }
          ]
          windowsConfiguration = {
            additionalUnattendContent = [
              {
                componentName = "Microsoft-Windows-Shell-Setup"
                content = "string"
                passName = "OobeSystem"
                settingName = "string"
              }
            ]
            enableAutomaticUpdates = bool
            patchSettings = {
              assessmentMode = "string"
              automaticByPlatformSettings = {
                rebootSetting = "string"
              }
              enableHotpatching = bool
              patchMode = "string"
            }
            provisionVMAgent = bool
            timeZone = "string"
            winRM = {
              listeners = [
                {
                  certificateUrl = "string"
                  protocol = "string"
                }
              ]
            }
          }
        }
        priority = "string"
        scheduledEventsProfile = {
          terminateNotificationProfile = {
            enable = bool
            notBeforeTimeout = "string"
          }
        }
        securityProfile = {
          encryptionAtHost = bool
          securityType = "string"
          uefiSettings = {
            secureBootEnabled = bool
            vTpmEnabled = bool
          }
        }
        storageProfile = {
          dataDisks = [
            {
              caching = "string"
              createOption = "string"
              deleteOption = "string"
              diskIOPSReadWrite = int
              diskMBpsReadWrite = int
              diskSizeGB = int
              lun = int
              managedDisk = {
                diskEncryptionSet = {
                  id = "string"
                }
                securityProfile = {
                  diskEncryptionSet = {
                    id = "string"
                  }
                  securityEncryptionType = "string"
                }
                storageAccountType = "string"
              }
              name = "string"
              writeAcceleratorEnabled = bool
            }
          ]
          imageReference = {
            communityGalleryImageId = "string"
            id = "string"
            offer = "string"
            publisher = "string"
            sharedGalleryImageId = "string"
            sku = "string"
            version = "string"
          }
          osDisk = {
            caching = "string"
            createOption = "string"
            deleteOption = "string"
            diffDiskSettings = {
              option = "Local"
              placement = "string"
            }
            diskSizeGB = int
            image = {
              uri = "string"
            }
            managedDisk = {
              diskEncryptionSet = {
                id = "string"
              }
              securityProfile = {
                diskEncryptionSet = {
                  id = "string"
                }
                securityEncryptionType = "string"
              }
              storageAccountType = "string"
            }
            name = "string"
            osType = "string"
            vhdContainers = [
              "string"
            ]
            writeAcceleratorEnabled = bool
          }
        }
        userData = "string"
      }
      zoneBalance = bool
    }
    zones = [
      "string"
    ]
    sku = {
      capacity = int
      name = "string"
      tier = "string"
    }
    extendedLocation = {
      name = "string"
      type = "EdgeZone"
    }
    plan = {
      name = "string"
      product = "string"
      promotionCode = "string"
      publisher = "string"
    }
  })
}

属性值

virtualMachineScaleSets

名称 说明 Value
type 资源类型 “Microsoft.Compute/virtualMachineScaleSets@2022-03-01”
name 资源名称 字符串 (必需)

字符限制:1-15 (Windows)
1-64 (Linux)



有效字符:
不得使用空格、控制字符或以下字符:
~ ! @ # $ % ^ & * ( ) = + _ [ ] { } \ | ; : . ' " , < > / ?

不能以下划线开头。 不能以句点或连字符结尾。
location 资源位置 字符串 (必需)
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 资源标记 标记名称和值的字典。
sku 虚拟机规模集 SKU。 Sku
extendedLocation 虚拟机规模集的扩展位置。 ExtendedLocation
标识 虚拟机规模集的标识(如果已配置)。 VirtualMachineScaleSetIdentity
plan 指定有关用于创建虚拟机的市场映像的信息。 此元素仅用于市场映像。 必须先启用映像以供编程使用,然后才能从 API 使用市场映像。 在Azure 门户中,找到要使用的市场映像,然后单击“想要以编程方式部署”“入门”->。 输入任何所需信息,然后单击“ 保存”。 规划
properties 描述虚拟机规模集的属性。 VirtualMachineScaleSetProperties
zones 虚拟机规模集区域。 注意:只能在创建规模集时设置可用性区域 string[]

ExtendedLocation

名称 说明
name 扩展位置的名称。 字符串
type 扩展位置的类型。 “EdgeZone”

VirtualMachineScaleSetIdentity

名称 说明 Value
type 用于虚拟机规模集的标识类型。 类型“SystemAssigned ,UserAssigned”包含隐式创建的标识和一组用户分配的标识。 类型“None”将从虚拟机规模集中删除任何标识。 “SystemAssigned”
“SystemAssigned,UserAssigned”
“UserAssigned”
identity_ids 与虚拟机规模集关联的用户标识列表。 用户标识字典键引用将是 ARM 资源 ID,格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 用户标识 ID 的数组。

UserAssignedIdentities

名称 说明
{customized property} UserAssignedIdentitiesValue
{customized property} UserAssignedIdentitiesValue

UserAssignedIdentitiesValue

此对象不包含部署期间要设置的任何属性。 所有属性均为 ReadOnly。

计划

名称 说明
name 计划 ID。 字符串
product 指定市场中映像的乘积。 此值与 imageReference 元素下的 Offer 值相同。 字符串
promotionCode 促销代码。 字符串
发布者 发布者 ID。 字符串

VirtualMachineScaleSetProperties

名称 说明
additionalCapabilities 指定在虚拟机规模集中的虚拟机上启用或禁用的其他功能。 例如:虚拟机是否能够支持使用UltraSSD_LRS存储帐户类型附加托管数据磁盘。 AdditionalCapabilities
automaticRepairsPolicy 自动修复策略。 AutomaticRepairsPolicy
doNotRunExtensionsOnOverprovisionedVMs 启用过度预配后,扩展仅在最终保留的请求数目的 VM 上启动。 因此,此属性将确保扩展不会在预配过度的额外 VM 上运行。 bool
hostGroup 指定有关虚拟机规模集所在的专用主机组的信息。

最低 API 版本:2020-06-01。
SubResource
orchestrationMode 指定虚拟机规模集的业务流程模式。 “灵活”
“Uniform”
overprovision 指定是否应过度预配虚拟机规模集。 bool
platformFaultDomainCount 每个放置组的容错域计数。 int
proximityPlacementGroup 指定虚拟机规模集应分配到的邻近放置组的相关信息。

最低 API 版本:2018-04-01。
SubResource
scaleInPolicy 指定在虚拟机规模集中缩放虚拟机时应用的策略。 ScaleInPolicy
singlePlacementGroup 如果为 true,则规模集限制为单个放置组,最大大小为 100 个虚拟机。 注意:如果 singlePlacementGroup 为 true,则可能会将其修改为 false。 但是,如果 singlePlacementGroup 为 false,则不可将其修改为 true。 bool
spotRestorePolicy 指定虚拟机规模集的现成还原属性。 SpotRestorePolicy
upgradePolicy 升级策略。 UpgradePolicy
virtualMachineProfile 虚拟机配置文件。 VirtualMachineScaleSetVMProfile
zoneBalance 是否强制在发生区域中断时严格甚至跨 x 区域分发虚拟机。 仅当规模集的 zone 属性包含多个区域时,才能设置 zoneBalance 属性。 如果没有指定区域或仅指定了一个区域,则不应设置 zoneBalance 属性。 bool

AdditionalCapabilities

名称 说明
hibernationEnabled 在 VM 上启用或禁用休眠功能的标志。 bool
ultraSSDEnabled 用于启用或禁用在 VM 或 VMSS 上具有UltraSSD_LRS存储帐户类型的一个或多个托管数据磁盘的功能的标志。 仅当启用此属性时,才能将存储帐户类型UltraSSD_LRS的托管磁盘添加到虚拟机或虚拟机规模集。 bool

AutomaticRepairsPolicy

名称 说明
enabled 指定是否应在虚拟机规模集上启用自动修复。 默认值为 false。 bool
gracePeriod 由于 VM 上的状态更改而暂停自动修复的时间。 宽限时间在状态更改完成后开始。 这有助于避免过早或意外的修复。 持续时间应以 ISO 8601 格式指定。 允许的最小宽限期为 PT10M) (10 分钟,这也是默认值。 允许的最大宽限期为 PT90M) (90 分钟。 字符串
repairAction 修复操作的类型 (替换、重启、重置映像) ,这些操作将用于修复规模集中不正常的虚拟机。 默认值为 replace。 “重置映像”
“Replace”
“Restart”

SubResource

名称 说明 Value
id 资源 ID 字符串

ScaleInPolicy

名称 说明
forceDeletion 此属性允许指定在虚拟机规模集进行横向扩展时是否必须强制删除选择删除的虚拟机。预览版中的 (功能) bool
规则 在虚拟机规模集中缩放时要遵循的规则。

可能的值为:

默认 在虚拟机规模集进行缩放时,如果规模集是区域性规模集,则规模集将首先跨区域进行均衡。 然后,它将尽可能跨容错域进行均衡。 在每个容错域中,选择要删除的虚拟机将是不受横向缩减保护的最新虚拟机。

OldestVM 缩小虚拟机规模集时,将选择删除未受到横向缩减保护的最早虚拟机。 对于区域性虚拟机规模集,规模集将首先跨区域均衡。 在每个区域中,将选择删除未受保护的最早虚拟机。

NewestVM 缩小虚拟机规模集时,将选择删除未受到横向缩减保护的最新虚拟机。 对于区域性虚拟机规模集,规模集将首先跨区域均衡。 在每个区域中,将选择删除未受保护的最新虚拟机。

包含任何一项的字符串数组:
“Default”
“NewestVM”
“OldestVM”

SpotRestorePolicy

名称 说明
enabled 启用现成-试用-还原功能,其中将尝试根据容量可用性和定价约束适时还原已逐出的 VMSS SPOT 实例 bool
restoreTimeout 以 ISO 8601 持续时间表示的超时值,在此持续时间之后,平台不会尝试还原 VMSS SPOT 实例 字符串

UpgradePolicy

名称 说明
automaticOSUpgradePolicy 用于执行自动 OS 升级的配置参数。 AutomaticOSUpgradePolicy
mode 指定升级到规模集中虚拟机的模式。

可能的值为:

手动 - 控制将更新应用到规模集中的虚拟机。 可以使用 manualUpgrade 操作执行此操作。

自动 - 同时自动更新规模集中的所有虚拟机。
“Automatic”
“手动”
“Rolling”
rollingUpgradePolicy 执行滚动升级时使用的配置参数。 RollingUpgradePolicy

AutomaticOSUpgradePolicy

名称 说明
disableAutomaticRollback 是否应禁用 OS 映像回滚功能。 默认值为 false。 bool
enableAutomaticOSUpgrade 指示当较新版本的 OS 映像可用时,是否应以滚动方式自动将 OS 升级应用于规模集实例。 默认值为 false。

如果对于基于 Windows 的规模集,这设置为 true,enableAutomaticUpdates 将自动设置为 false,并且不能设置为 true。
bool
useRollingUpgradePolicy 指示是否应在自动操作系统升级期间使用滚动升级策略。 默认值为 false。 如果未在 VMSS 上定义任何策略,则自动 OS 升级将回退到默认策略。 bool

RollingUpgradePolicy

名称 说明
enableCrossZoneUpgrade 允许 VMSS 在构造升级批处理时忽略 AZ 边界。 请考虑更新域和 maxBatchInstancePercent 来确定批大小。 bool
maxBatchInstancePercent 通过一批滚动升级同时升级的总虚拟机实例的最大百分比。 由于这是最大值,以前或将来的批处理中运行不正常的实例可能会导致批处理中的实例百分比降低,以确保更高的可靠性。 此参数的默认值为 20%。 int

约束:
最小值 = 5
最大值 = 100
maxUnhealthyInstancePercent 规模集中可能同时运行不正常的虚拟机实例总数的最大百分比,可以是升级的结果,或者虚拟机运行状况检查在滚动升级中止之前发现处于不正常状态。 在启动任何批处理之前,将检查此约束。 此参数的默认值为 20%。 int

约束:
最小值 = 5
最大值 = 100
maxUnhealthyUpgradedInstancePercent 可发现处于不正常状态的已升级虚拟机实例的最大百分比。 此检查将在每个批处理升级后发生。 如果超过此百分比,滚动更新将中止。 此参数的默认值为 20%。 int

约束:
最小值 = 0
最大值 = 100
pauseTimeBetweenBatches 完成一批中所有虚拟机的更新到开始下一批之间的等待时间。 持续时间应以 ISO 8601 格式指定。 默认值为 0 秒 (PT0S) 。 字符串
prioritizeUnhealthyInstances 升级规模集中所有不正常的实例,然后再升级任何正常实例。 bool

VirtualMachineScaleSetVMProfile

名称 说明
applicationProfile 指定应提供给 VM/VMSS 的库应用程序 ApplicationProfile
billingProfile 指定 Azure 现成 VMSS 的计费相关详细信息。

最低 API 版本:2019-03-01。
BillingProfile
capacityReservation 指定规模集的容量预留相关详细信息。

最低 API 版本:2021-04-01。
CapacityReservationProfile
diagnosticsProfile 指定启动诊断设置状态。

最低 API 版本:2015-06-15。
DiagnosticsProfile
evictionPolicy 指定 Azure 现成虚拟机和 Azure 现成规模集的逐出策略。

对于 Azure 现成虚拟机,支持“Deallocate”和“Delete”,最低 API 版本为 2019-03-01。

对于 Azure 现成规模集,支持“Deallocate”和“Delete”,最低 API 版本为 2017-10-30-preview。
“Deallocate”
“Delete”
extensionProfile 指定规模集中虚拟机上安装的扩展的设置集合。 VirtualMachineScaleSetExtensionProfile
hardwareProfile 指定规模集的硬件配置文件相关详细信息。

最低 API 版本:2022-03-01。
VirtualMachineScaleSetHardwareProfile
LicenseType 指定正在使用的映像或磁盘已在本地获得许可。

Windows Server 操作系统的可能值为:

Windows_Client

Windows_Server

Linux Server 操作系统的可能值为:

RHEL) 的RHEL_BYOS (

SUSE) SLES_BYOS (

有关详细信息,请参阅 适用于 Windows Server 的 Azure 混合使用权益

适用于 Linux Server 的 Azure 混合使用权益

最低 API 版本:2015-06-15
字符串
networkProfile 指定规模集中虚拟机网络接口的属性。 VirtualMachineScaleSetNetworkProfile
osProfile 指定规模集中虚拟机的操作系统设置。 VirtualMachineScaleSetOSProfile
priority 指定规模集中虚拟机的优先级。

最低 API 版本:2017-10-30-preview
"Low"
“常规”
“Spot”
scheduledEventsProfile 指定与计划事件相关的配置。 ScheduledEventsProfile
securityProfile 指定规模集中虚拟机的安全相关配置文件设置。 SecurityProfile
storageProfile 指定虚拟机磁盘的存储设置。 VirtualMachineScaleSetStorageProfile
userData 规模集中虚拟机的 UserData,必须采用 base-64 编码。 客户不应在此处传递任何机密。

最低 API 版本:2021-03-01
字符串

ApplicationProfile

名称 说明
galleryApplications 指定应提供给 VM/VMSS 的库应用程序 VMGalleryApplication[]

VMGalleryApplication

名称 说明
configurationReference 可选,指定 Azure Blob 的 URI,该 URI 将替换包的默认配置(如果提供) 字符串
enableAutomaticUpgrade 如果设置为 true,则当 PIR/SIG 中提供了新的库应用程序版本时,它将针对 VM/VMSS 自动更新 bool
顺序 可选,指定必须安装包的顺序 int
packageReferenceId 以 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/gallerys/{galleryName}/applications/{application}/versions/{version} 的形式指定 GalleryApplicationVersion 资源 ID 字符串 (必需)
标记 可选,为更通用的上下文指定传递值。 字符串
treatFailureAsDeploymentFailure 可选,如果为 true,则 VmApplication 中任何操作的任何失败都将使部署失败 bool

BillingProfile

名称 说明
maxPrice 指定愿意为 Azure 现成 VM/VMSS 支付的最高价格。 此价格以美元为单位。

此价格将与 VM 大小的当前 Azure 现成价格进行比较。 此外,在创建/更新 Azure 现成 VM/VMSS 时会比较价格,仅当 maxPrice 大于当前 Azure 现成价格时,操作才会成功。

如果创建 VM/VMSS 后当前 Azure 现成价格超出 maxPrice,maxPrice 还将用于逐出 Azure 现成 VM/VMSS。

可能的值为:

- 任何大于零的十进制值。 示例:0.01538

-1 – 指示默认价格是按需的。

可以将 maxPrice 设置为 -1,以指示不应出于价格原因逐出 Azure 现成 VM/VMSS。 此外,如果未提供,则默认最高价格为 -1。

最低 API 版本:2019-03-01。 将十进制值指定为字符串。
int 或 json decimal

CapacityReservationProfile

名称 说明
capacityReservationGroup 指定容量预留组资源 ID,应用于分配虚拟机或规模集 VM 实例(如果已预留足够的容量)。 有关更多详细信息,请参阅 https://aka.ms/CapacityReservation SubResource

DiagnosticsProfile

名称 说明
bootDiagnostics 启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图以诊断 VM 状态。
注意:如果指定 storageUri,请确保存储帐户与 VM 位于同一区域和订阅中。

可以轻松查看控制台日志的输出。

Azure 还使你能够查看虚拟机监控程序中 VM 的屏幕截图。
BootDiagnostics

BootDiagnostics

名称 说明
enabled 是否应在虚拟机上启用启动诊断。 bool
storageUri 用于放置控制台输出和屏幕截图的存储帐户的 URI。

如果在启用启动诊断时未指定 storageUri,则将使用托管存储。
字符串

VirtualMachineScaleSetExtensionProfile

名称 说明
扩展 虚拟机规模集子扩展资源。 VirtualMachineScaleSetExtension[]
extensionsTimeBudget 指定分配的所有扩展的开始时间。 持续时间应介于 15 分钟到 120 分钟之间, (含) ,应以 ISO 8601 格式指定。 默认值为 90 分钟 (PT1H30M) 。

最低 API 版本:2020-06-01
字符串

VirtualMachineScaleSetExtension

名称 说明
name 扩展插件的名称。 string
properties 介绍虚拟机规模集扩展的属性。 VirtualMachineScaleSetExtensionProperties

VirtualMachineScaleSetExtensionProperties

名称 说明
autoUpgradeMinorVersion 指示如果扩展在部署时可用,则是否应使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。 bool
enableAutomaticUpgrade 指示如果有较新版本的可用扩展,则平台是否应自动升级扩展。 bool
forceUpdateTag 如果提供的值与以前的值不同,则即使扩展配置未更改,扩展处理程序也将被迫更新。 字符串
protectedSettings 该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。
protectedSettingsFromKeyVault 扩展保护的设置,这些设置通过引用传递,并从密钥保管库使用 KeyVaultSecretReference
provisionAfterExtensions 扩展名称的集合,之后需要预配此扩展。 string[]
发布者 扩展处理程序发布者的名称。 字符串
设置 扩展的 Json 格式公共设置。
suppressFailures 指示是否将禁止从扩展引发的故障, (操作故障(如未连接到 VM)将不会被禁止,而不考虑此值) 。 默认值为 false。 bool
类型 指定扩展的类型;例如“CustomScriptExtension”。 字符串
typeHandlerVersion 指定脚本处理程序的版本。 字符串

KeyVaultSecretReference

名称 说明
secretUrl 引用密钥保管库中的机密的 URL。 字符串 (必需)
sourceVault 包含机密的密钥保管库的相对 URL。 需要 SubResource ()

VirtualMachineScaleSetHardwareProfile

名称 说明
vmSizeProperties 指定用于自定义虚拟机大小的属性。 最低 API 版本:2022-03-01。

有关更多详细信息,请按照 VM 自定义 中的说明进行操作。
VMSizeProperties

VMSizeProperties

名称 说明
vCPUsAvailable 指定可用于 VM 的 vCPU 数。

如果未在请求正文中指定此属性,则默认行为是将其设置为可用于该 VM 大小的 vCPU 的值,该 VM 大小在 API 响应中公开, 即列出区域中的所有可用虚拟机大小
int
vCPUsPerCore 指定 vCPU 与物理核心的比率。

如果未在请求正文中指定此属性,则对于列出区域中所有可用虚拟机大小的 API 响应中公开的 VM 大小,默认行为设置为 vCPUsPerCore 的值

将此属性设置为 1 还意味着禁用超线程。
int

VirtualMachineScaleSetNetworkProfile

名称 说明
healthProbe 对负载均衡器探测的引用,用于确定虚拟机规模集中实例的运行状况。 引用的格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}”。 ApiEntityReference
networkApiVersion 指定在业务流程模式为“灵活”的虚拟机规模集的网络接口配置中创建网络资源时使用的 Microsoft.Network API 版本 "2020-11-01"
networkInterfaceConfigurations 网络配置列表。 VirtualMachineScaleSetNetworkConfiguration[]

ApiEntityReference

名称 说明 Value
id 采用 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 格式的 ARM 资源 ID。 字符串

VirtualMachineScaleSetNetworkConfiguration

名称 说明 Value
id 资源 ID 字符串
name 网络配置名称。 字符串 (必需)
properties 介绍虚拟机规模集网络配置文件的 IP 配置。 VirtualMachineScaleSetNetworkConfigurationProperties

VirtualMachineScaleSetNetworkConfigurationProperties

名称 说明
deleteOption 指定删除 VM 时网络接口会发生什么情况 “Delete”
“分离”
dnsSettings 要应用于网络接口的 dns 设置。 VirtualMachineScaleSetNetworkConfigurationDnsSetting...
enableAcceleratedNetworking 指定网络接口是否已启用加速网络。 bool
enableFpga 指定网络接口是否已启用 FPGA 网络。 bool
enableIPForwarding 是否在此 NIC 上启用了 IP 转发。 bool
ipConfigurations 指定网络接口的 IP 配置。 VirtualMachineScaleSetIPConfiguration[] (必需的)
networkSecurityGroup 网络安全组。 SubResource
角色实体 指定主网络接口,以防虚拟机具有 1 个以上的网络接口。 bool

VirtualMachineScaleSetNetworkConfigurationDnsSetting...

名称 说明
dnsServers DNS 服务器 IP 地址列表 string[]

VirtualMachineScaleSetIPConfiguration

名称 说明 Value
id 资源 ID 字符串
name IP 配置名称。 字符串 (必需)
properties 介绍虚拟机规模集网络配置文件的 IP 配置属性。 VirtualMachineScaleSetIPConfigurationProperties

VirtualMachineScaleSetIPConfigurationProperties

名称 说明
applicationGatewayBackendAddressPools 指定对应用程序网关的后端地址池的引用数组。 规模集可以引用多个应用程序网关的后端地址池。 多个规模集不能使用相同的应用程序网关。 SubResource[]
applicationSecurityGroups 指定对应用程序安全组的引用数组。 SubResource[]
loadBalancerBackendAddressPools 指定对负载均衡器的后端地址池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的后端地址池。 多个规模集不能使用相同的基本 SKU 负载均衡器。 SubResource[]
loadBalancerInboundNatPools 指定对负载均衡器的入站 Nat 池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的入站 nat 池。 多个规模集不能使用相同的基本 SKU 负载均衡器。 SubResource[]
角色实体 指定主网络接口,以防虚拟机具有 1 个以上的网络接口。 bool
privateIPAddressVersion 从 Api-Version 2017-03-30 开始提供,它表示特定的 ip 配置是 IPv4 还是 IPv6。 默认值为 IPv4。 可能的值为:“IPv4”和“IPv6”。 “IPv4”
“IPv6”
publicIPAddressConfiguration publicIPAddressConfiguration。 VirtualMachineScaleSetPublicIPAddressConfiguration
子网 指定子网的标识符。 ApiEntityReference

VirtualMachineScaleSetPublicIPAddressConfiguration

名称 说明
name publicIP 地址配置名称。 字符串 (必需)
properties 介绍虚拟机规模集 IP 配置的 PublicIPAddress 配置 VirtualMachineScaleSetPublicIPAddressConfigurationPr...
sku 介绍公共 IP SKU。 只能将 OrchestrationMode 设置为灵活。 PublicIPAddressSku

VirtualMachineScaleSetPublicIPAddressConfigurationPr...

名称 说明
deleteOption 指定删除 VM 时公共 IP 会发生什么情况 “Delete”
“分离”
dnsSettings 要应用于 publicIP 地址 的 dns 设置。 VirtualMachineScaleSetPublicIPAddressConfigurationDn...
idleTimeoutInMinutes 公共 IP 地址的空闲超时。 int
ipTags 与公共 IP 地址关联的 IP 标记列表。 VirtualMachineScaleSetIpTag[]
publicIPAddressVersion 从 Api-Version 2019-07-01 开始提供,它表示特定的 ip 配置是 IPv4 还是 IPv6。 默认值为 IPv4。 可能的值为:“IPv4”和“IPv6”。 “IPv4”
“IPv6”
publicIPPrefix 要从中分配 publicIP 地址的 PublicIPPrefix。 SubResource

VirtualMachineScaleSetPublicIPAddressConfigurationDn...

名称 说明
domainNameLabel 域名标签。域名标签和 vm 索引的串联将是将创建的 PublicIPAddress 资源的域名标签 字符串 (必需)

VirtualMachineScaleSetIpTag

名称 说明
ipTagType IP 标记类型。 示例:FirstPartyUsage。 字符串
标记 与公共 IP 关联的 IP 标记。 示例:SQL、存储等 字符串

PublicIPAddressSku

名称 说明
name 指定公共 IP SKU 名称 "Basic"
“Standard”
指定公共 IP SKU 层 “Global”
“区域”

VirtualMachineScaleSetOSProfile

名称 说明
adminPassword 指定管理员帐户的密码。

Windows) 最小长度 (: 8 个字符

Linux) 最小长度 (: 6 个字符

最大长度 (Windows) : 123 个字符

Linux) 最大 (长度: 72 个字符

复杂性要求: 需要满足以下 4 个条件中的 3 个
包含较低的字符
包含大写字符
具有数字
具有特殊字符 (正则表达式匹配 [\W_])

不允许的值: “abc@123”、“P@$$w 0rd”、“P@ssw0rd”、“P@ssword123”、“Pa$$word”、“pass@word1”、“Password!”、“Password1”、“Password22”、“iloveyou!”

有关重置密码的信息,请参阅 如何在 Windows VM 中重置远程桌面服务或其登录密码

有关重置根密码,请参阅使用 VMAccess 扩展管理 Azure Linux VM 上的用户、SSH 和检查或修复磁盘
字符串

约束:
敏感值。 作为安全参数传入。
adminUsername 指定管理员帐户的名称。

仅限 Windows 的限制: 不能以“.”结尾

不允许的值: “administrator”、“admin”、“user”、“user1”、“test”、“user2”、“test1”、“user3”、“admin1”、“1”, “123”、“a”、“actuser”、“adm”、“admin2”、“aspnet”、“backup”、“console”、“david”、“guest”、“john”、“owner”、“root”、“server”、“support”、“support_388945a0”、“sys”、“test2”、“test3”、“user4”、“user5”。

Linux) (最小长度: 1 个字符

最大长度 (Linux) : 64 个字符

Windows) 最大 (长度: 20 个字符
字符串
allowExtensionOperations 指定是否应在虚拟机规模集上允许扩展操作。

仅当虚拟机规模集上没有扩展时,才能将其设置为 False。
bool
computerNamePrefix 指定规模集中所有虚拟机的计算机名称前缀。 计算机名称前缀的长度必须为 1 到 15 个字符。 字符串
customData 指定自定义数据的 Base-64 编码的字符串。 Base-64 编码的字符串将解码为一个二元数组并作为一个文件保存在虚拟机上。 该二元数组的最大长度为 65535 字节。

有关对 VM 使用 cloud-init,请参阅 在创建期间使用 cloud-init 自定义 Linux VM
字符串
linuxConfiguration 指定虚拟机上的 Linux 操作系统设置。

有关支持的 Linux 分发版的列表,请参阅 Linux on Azure-Endorsed Distributions
LinuxConfiguration
机密 指定应安装在规模集中虚拟机上的证书集。 若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展 VaultSecretGroup[]
windowsConfiguration 指定虚拟机上的 Windows 操作系统设置。 WindowsConfiguration

LinuxConfiguration

名称 说明
disablePasswordAuthentication 指定是否应禁用密码身份验证。 bool
patchSettings [预览功能]指定与 Linux 上的 VM 来宾修补相关的设置。 LinuxPatchSettings
provisionVMAgent 指示是否应在虚拟机上设置虚拟机代理。

如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。
bool
ssh 指定 Linux OS 的 SSH 密钥配置。 SshConfiguration

LinuxPatchSettings

名称 说明
assessmentMode 指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值为:

ImageDefault - 控制虚拟机上修补程序评估的时间安排。

AutomaticByPlatform - 平台将触发定期修补程序评估。 属性 provisionVMAgent 必须为 true。
“AutomaticByPlatform”
“ImageDefault”
automaticByPlatformSettings 指定 Linux 上的 VM 来宾修补中的修补模式 AutomaticByPlatform 的其他设置。 LinuxVMGuestPatchAutomaticByPlatformSettings
patchMode 指定将 VM 来宾修补到 IaaS 虚拟机或与虚拟机规模集关联的虚拟机的模式,其中 OrchestrationMode 为灵活。

可能的值为:

ImageDefault - 使用虚拟机的默认修补配置。

AutomaticByPlatform - 虚拟机将由平台自动更新。 属性 provisionVMAgent 必须为 true
“AutomaticByPlatform”
“ImageDefault”

LinuxVMGuestPatchAutomaticByPlatformSettings

名称 说明
rebootSetting 指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。 “Always”
“IfRequired”
“从不”
"Unknown"

SshConfiguration

名称 说明
publicKeys 用于对基于 Linux 的 VM 进行身份验证的 SSH 公钥列表。 SshPublicKey[]

SshPublicKey

名称 说明
keyData 用于通过 ssh 向 VM 进行身份验证的 SSH 公钥证书。 密钥需要至少为 2048 位且采用 ssh-rsa 格式。

有关创建 ssh 密钥,请参阅 [在 Linux 和 Mac 上为 Azure 中的 Linux VM 创建 SSH 密钥]/azure/virtual-machines/linux/create-ssh-keys-detailed) 。
字符串
path 指定所创建的 VM 上存储 ssh 公钥的完整路径。 如果该文件已存在,则指定的密钥将追加到该文件上。 示例:/home/user/.ssh/authorized_keys 字符串

VaultSecretGroup

名称 说明
sourceVault 包含 VaultCertificates 中所有证书的密钥保管库的相对 URL。 SubResource
vaultCertificates SourceVault 中包含证书的密钥保管库引用列表。 VaultCertificate[]

VaultCertificate

名称 说明
certificateStore 对于 Windows VM,指定应向其添加证书的虚拟机上的证书存储。 指定的证书存储隐式位于 LocalMachine 帐户中。

对于 Linux VM,证书文件放置在 /var/lib/waagent 目录下,X509 证书文件的文件名 <为 UppercaseThumbprint.crt>, <私钥文件名为 UppercaseThumbprint.prv>。 这两个文件都采用 .pem 格式。
字符串
certificateUrl 这是已作为机密上传到密钥保管库的证书的 URL。 若要将机密添加到密钥保管库,请参阅将密钥或机密添加到密钥保管库。 在这种情况下,证书必须是以下 JSON 对象的 Base64 编码,该对象以 UTF-8 编码:

{
“data”:“{Base64-encoded-certificate}”,
“dataType”:“pfx”,
“password”:“{pfx-file-password}”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展
字符串

WindowsConfiguration

名称 说明
additionalUnattendContent 指定可包含在 Windows 安装程序使用的 Unattend.xml 文件中的其他 Base-64 编码 XML 格式信息。 AdditionalUnattendContent[]
enableAutomaticUpdates 指示是否为 Windows 虚拟机启用自动汇报。 默认值为 true。

对于虚拟机规模集,可以更新此属性,更新将在 OS 重新预配时生效。
bool
patchSettings [预览功能]指定与 Windows 上的 VM 来宾修补相关的设置。 PatchSettings
provisionVMAgent 指示是否应在虚拟机上设置虚拟机代理。

如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。
bool
timezone 指定虚拟机的时区。 例如“太平洋标准时间”。

可能的值可以是 TimeZoneInfo.GetSystemTimeZones 返回的时区 TimeZoneInfo.Id 值。
字符串
winRM 指定 Windows 远程管理侦听器。 这将启用远程 Windows PowerShell。 WinRMConfiguration

AdditionalUnattendContent

名称 说明
componentName 组件名称。 目前,唯一允许的值是 Microsoft-Windows-Shell-Setup。 “Microsoft-Windows-Shell-Setup”
内容 指定添加到指定路径和组件的 unattend.xml 文件的 XML 格式化内容。 XML 必须小于 4KB,并且必须包含要插入的设置或功能的根元素。 字符串
passName 传递名称。 目前,唯一允许的值为 OobeSystem。 “OobeSystem”
settingName 指定内容适用于的设置的名称。 可能的值为:FirstLogonCommands 和 AutoLogon。 “AutoLogon”
“FirstLogonCommands”

PatchSettings

名称 说明
assessmentMode 指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值为:

ImageDefault - 控制虚拟机上修补程序评估的时间。

AutomaticByPlatform - 平台将触发定期修补程序评估。 属性 provisionVMAgent 必须为 true。
“AutomaticByPlatform”
“ImageDefault”
automaticByPlatformSettings 指定 Windows 上的 VM 来宾修补中的修补模式 AutomaticByPlatform 的其他设置。 WindowsVMGuestPatchAutomaticByPlatformSettings
enableHotpatching 使客户无需重启即可修补其 Azure VM。 对于 enableHotpatching,必须将“provisionVMAgent”设置为 true,“patchMode”必须设置为“AutomaticByPlatform”。 bool
patchMode 指定将 VM 来宾修补到 IaaS 虚拟机或与虚拟机规模集关联的虚拟机的模式,其中 OrchestrationMode 为灵活。

可能的值为:

手动 - 控制将修补程序应用到虚拟机。 为此,可以在 VM 中手动应用修补程序。 在此模式下,自动更新处于禁用状态;属性 WindowsConfiguration.enableAutomaticUpdates 必须为 false

AutomaticByOS - 操作系统会自动更新虚拟机。 属性 WindowsConfiguration.enableAutomaticUpdates 必须为 true。

AutomaticByPlatform - 虚拟机将由平台自动更新。 属性 provisionVMAgent 和 WindowsConfiguration.enableAutomaticUpdates 必须为 true
“AutomaticByOS”
“AutomaticByPlatform”
“手动”

WindowsVMGuestPatchAutomaticByPlatformSettings

名称 说明
rebootSetting 指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。 “Always”
“IfRequired”
“从不”
"Unknown"

WinRMConfiguration

名称 说明
侦听器 Windows 远程管理侦听器的列表 WinRMListener[]

WinRMListener

名称 说明
certificateUrl 这是已作为机密上传到密钥保管库的证书的 URL。 若要向密钥保管库添加机密,请参阅将密钥或机密添加到密钥保管库。 在这种情况下,证书必须是以下 JSON 对象的 Base64 编码,该对象以 UTF-8 编码:

{
“data”:“{Base64-encoded-certificate}”,
“dataType”:“pfx”,
“password”:“{pfx-file-password}”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure 密钥保管库 虚拟机扩展适用于 Windows 的 Azure 密钥保管库 虚拟机扩展
字符串
protocol 指定 WinRM 侦听器的协议。

可能的值为:
http

https
“Http”
“Https”

ScheduledEventsProfile

名称 说明
terminateNotificationProfile 指定“终止计划事件”相关配置。 TerminateNotificationProfile

TerminateNotificationProfile

名称 说明
enable 指定是启用或禁用 Terminate Scheduled 事件。 bool
notBeforeTimeout 在自动批准事件之前,要删除的虚拟机可能需要批准“终止计划事件”的可配置时间长度, () 超时。 必须以 ISO 8601 格式指定配置,默认值为 5 分钟 (PT5M) 字符串

SecurityProfile

名称 说明
encryptionAtHost 用户可以在请求中使用此属性来启用或禁用虚拟机或虚拟机规模集的主机加密。 这将为所有磁盘启用加密,包括主机本身的资源/临时磁盘。

默认值:除非资源的此属性设置为 true,否则将禁用主机加密。
bool
securityType 指定虚拟机的 SecurityType。 必须将其设置为任何指定的值才能启用 UefiSettings。

默认值:除非设置了此属性,否则不会启用 UefiSettings。
“ConfidentialVM”
“TrustedLaunch”
uefiSettings 指定创建虚拟机时使用的安全启动和 vTPM 等安全设置。

最低 API 版本:2020-12-01
UefiSettings

UefiSettings

名称 说明
secureBootEnabled 指定是否应在虚拟机上启用安全启动。

最低 API 版本:2020-12-01
bool
vTpmEnabled 指定是否应在虚拟机上启用 vTPM。

最低 API 版本:2020-12-01
bool

VirtualMachineScaleSetStorageProfile

名称 说明
dataDisks 指定用于将数据磁盘添加到规模集中的虚拟机的参数。

有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD
VirtualMachineScaleSetDataDisk[]
imageReference 指定有关要使用的映像的信息。 可以指定有关平台映像、市场映像或虚拟机映像的信息。 若要使用平台映像、市场映像或虚拟机映像,但未在其他创建操作中使用,则此元素是必需的。 ImageReference
osDisk 指定有关规模集中虚拟机使用的操作系统磁盘的信息。

有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD
VirtualMachineScaleSetOSDisk

VirtualMachineScaleSetDataDisk

名称 说明
缓存 指定缓存要求。

可能的值为:



ReadOnly

ReadWrite

默认值: 对于标准存储,无。高级存储的 ReadOnly
"None"
“ReadOnly”
“ReadWrite”
createOption 创建选项。 “附加”
“Empty”
“FromImage” (必需)
deleteOption 指定在 VMSS 灵活删除时是否应删除或分离数据磁盘 (此功能仅适用于灵活 OrchestrationMode) VMSS。

可能的值:

删除 如果使用此值,则会在删除 VMSS Flex VM 时删除数据磁盘。

分离 如果使用此值,则删除 VMSS Flex VM 后,将保留数据磁盘。

默认值设置为 Delete
“Delete”
“分离”
diskIOPSReadWrite 指定托管磁盘 Read-Write IOPS。 应仅在UltraSSD_LRS StorageAccountType 时使用。 如果未指定,则会根据 diskSizeGB 分配默认值。 int
diskMBpsReadWrite 指定托管磁盘的带宽(以 MB/秒为单位)。 应仅在UltraSSD_LRS StorageAccountType 时使用。 如果未指定,则会根据 diskSizeGB 分配默认值。 int
diskSizeGB 指定空数据磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。

此值不能大于 1023 GB
int
lun 指定数据磁盘的逻辑单元号。 此值用于标识 VM 中的数据磁盘,因此对于附加到 VM 的每个数据磁盘必须是唯一的。 int (必需)
managedDisk 托管磁盘参数。 VirtualMachineScaleSetManagedDiskParameters
name 磁盘名称。 字符串
writeAcceleratorEnabled 指定是否应在磁盘上启用或禁用 writeAccelerator。 bool

VirtualMachineScaleSetManagedDiskParameters

名称 说明
diskEncryptionSet 指定托管磁盘的客户托管磁盘加密集资源 ID。 DiskEncryptionSetParameters
securityProfile 指定托管磁盘的安全配置文件。 VMDiskSecurityProfile
storageAccountType 指定托管磁盘的存储帐户类型。 注意:UltraSSD_LRS只能与数据磁盘一起使用,不能与 OS 磁盘一起使用。 “PremiumV2_LRS”
“Premium_LRS”
“Premium_ZRS”
“StandardSSD_LRS”
“StandardSSD_ZRS”
“Standard_LRS”
“UltraSSD_LRS”

DiskEncryptionSetParameters

名称 说明 Value
id 资源 ID 字符串

VMDiskSecurityProfile

名称 说明
diskEncryptionSet 指定用于客户托管密钥加密的机密 VM OS 磁盘和 VMGuest Blob 的托管磁盘的客户托管磁盘加密集资源 ID。 DiskEncryptionSetParameters
securityEncryptionType 指定托管磁盘的 EncryptionType。
它设置为 DiskWithVMGuestState 以加密托管磁盘以及 VMGuestState blob,将 VMGuestStateOnly 设置为仅加密 VMGuestState blob。

注意:只能为机密 VM 设置它。
“DiskWithVMGuestState”
“VMGuestStateOnly”

ImageReference

名称 说明
communityGalleryImageId 指定了 vm 部署的社区库映像唯一 ID。 这可以从社区库映像 GET 调用中提取。 string
id 资源 ID 字符串
offer 指定用于创建虚拟机的平台映像或市场映像的套餐。 字符串
发布者 映像发布者。 字符串
sharedGalleryImageId 指定 VM 部署的共享库映像唯一 ID。 这可以从共享库映像 GET 调用中提取。 字符串
sku 映像 SKU。 字符串
版本 指定用于创建虚拟机的平台映像或市场映像的版本。 允许的格式为 Major.Minor.Build 或“latest”。 主要、次要和内部版本是十进制数。 指定“latest”以使用部署时可用的最新版本的映像。 即使使用“最新”,VM 映像也不会在部署后自动更新,即使新版本可用。 请不要对库映像部署使用字段“version”,库映像应始终使用“id”字段进行部署,若要使用库映像的“最新”版本,只需在“id”字段中设置“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleryName}/images/{imageName}”。 字符串

VirtualMachineScaleSetOSDisk

名称 说明
缓存 指定缓存要求。

可能的值为:



ReadOnly

ReadWrite

默认值: 对于标准存储,无。适用于高级存储的 ReadOnly
"None"
“ReadOnly”
“ReadWrite”
createOption 指定应如何创建规模集中的虚拟机。

唯一允许的值是: FromImage \u2013 使用映像创建虚拟机时使用此值。 如果使用平台映像,则还需要使用上述 imageReference 元素。 如果使用的是市场映像,则还需要使用前面所述的 plan 元素。
“附加”
“Empty”
“FromImage” (必需)
deleteOption 指定在 VMSS Flex 删除时是应删除还是分离 OS 磁盘, (此功能仅适用于仅) 灵活 OrchestrationMode 的 VMSS。

可能的值:

删除 如果使用此值,则会在删除 VMSS Flex VM 时删除 OS 磁盘。

分离 如果使用此值,则删除 VMSS Flex VM 后,OS 磁盘将保留。

默认值设置为 Delete。 对于临时 OS 磁盘,默认值设置为 Delete。 用户无法更改临时 OS 磁盘的删除选项。
“Delete”
“分离”
diffDiskSettings 指定虚拟机规模集使用的操作系统磁盘的临时磁盘设置。 DiffDiskSettings
diskSizeGB 指定操作系统磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。

此值不能大于 1023 GB
int
image 指定要基于规模集的非托管用户映像的信息。 VirtualHardDisk
managedDisk 托管磁盘参数。 VirtualMachineScaleSetManagedDiskParameters
name 磁盘名称。 字符串
osType 此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 的类型。

可能的值为:

Windows

Linux
“Linux”
“Windows”
vhdContainers 指定用于存储规模集操作系统磁盘的容器 URL。 string[]
writeAcceleratorEnabled 指定是在磁盘上启用或禁用 writeAccelerator。 bool

DiffDiskSettings

名称 说明
选项 指定操作系统磁盘的临时磁盘设置。 “Local”
放置 指定操作系统磁盘的临时磁盘放置。

可能的值为:

CacheDisk

ResourceDisk

默认值:如果为 VM 大小配置了 缓存磁盘 ,则使用 ResourceDisk

请参阅 /azure/virtual-machines/windows/size 和 /azure/virtual-machines/linux/size 上的 Windows VM 的 VM 大小文档,检查哪些 VM 大小公开缓存磁盘。
“CacheDisk”
“ResourceDisk”

VirtualHardDisk

名称 说明
uri 指定虚拟硬盘的 URI。 字符串

SKU

名称 说明
容量 指定规模集中的虚拟机数。 int
name SKU 名称。 字符串
指定规模集中虚拟机的层。

可能的值:

标准

基本
字符串