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

Virtual Machine Scale Sets - Create Or Update

创建或更新 VM 规模集。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}?api-version=2024-03-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。

subscriptionId
path True

string

唯一标识 azure 订阅Microsoft的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。

vmScaleSetName
path True

string

要创建或更新的 VM 规模集的名称。

api-version
query True

string

客户端 API 版本。

请求头

名称 必需 类型 说明
If-Match

string

转换的 ETag。 省略此值以始终覆盖当前资源。 指定最后一次看到的 ETag 值,以防止意外覆盖并发更改。

If-None-Match

string

设置为“*”以允许创建新记录集,但要防止更新现有记录集。 其他值将导致服务器出错,因为它们不受支持。

请求正文

名称 必需 类型 说明
location True

string

资源位置

extendedLocation

ExtendedLocation

虚拟机规模集的扩展位置。

identity

VirtualMachineScaleSetIdentity

虚拟机规模集的标识(如果已配置)。

plan

Plan

指定有关用于创建虚拟机的市场映像的信息。 此元素仅用于市场映像。 必须先启用映像以编程方式使用映像,然后才能从 API 使用市场映像。 在 Azure 门户中,找到要使用的市场映像,然后单击 想要以编程方式部署,开始使用 ->。 输入任何必需的信息,然后单击“保存

properties.additionalCapabilities

AdditionalCapabilities

指定在虚拟机规模集中的虚拟机上启用或禁用的其他功能。 例如:虚拟机是否能够支持使用 UltraSSD_LRS 存储帐户类型附加托管数据磁盘。

properties.automaticRepairsPolicy

AutomaticRepairsPolicy

自动修复的策略。

properties.constrainedMaximumCapacity

boolean

必须设置为 True 或省略的可选属性。

properties.doNotRunExtensionsOnOverprovisionedVMs

boolean

启用过度预配后,仅在请求的 VM 数量上启动扩展,这些 VM 最终会保留。 因此,此属性将确保扩展不会在额外的过度预配的 VM 上运行。

properties.hostGroup

SubResource

指定虚拟机规模集所在的专用主机组的信息。 最低 API 版本:2020-06-01。

properties.orchestrationMode

OrchestrationMode

指定虚拟机规模集的业务流程模式。

properties.overprovision

boolean

指定是否应过度预配虚拟机规模集。

properties.platformFaultDomainCount

integer

每个放置组的容错域计数。

properties.priorityMixPolicy

PriorityMixPolicy

指定用于在同一 VMSS Flex 实例中混合现成和常规优先级 VM 的所需目标。

properties.proximityPlacementGroup

SubResource

指定应向其分配虚拟机规模集的邻近放置组的相关信息。 最低 api 版本:2018-04-01。

properties.resiliencyPolicy

ResiliencyPolicy

复原策略

properties.scaleInPolicy

ScaleInPolicy

指定在虚拟机规模集中的虚拟机中缩放时应用的策略。

properties.scheduledEventsPolicy

ScheduledEventsPolicy

ScheduledEventsPolicy。

properties.singlePlacementGroup

boolean

如果为 true,则规模集限制为单个放置组,最大大小为 100 个虚拟机。 注意:如果 singlePlacementGroup 为 true,则可能会将其修改为 false。 但是,如果 singlePlacementGroup 为 false,则可能不会将其修改为 true。

properties.spotRestorePolicy

SpotRestorePolicy

指定虚拟机规模集的现成还原属性。

properties.upgradePolicy

UpgradePolicy

升级策略。

properties.virtualMachineProfile

VirtualMachineScaleSetVMProfile

虚拟机配置文件。

properties.zoneBalance

boolean

如果发生区域中断,是否强制甚至跨 x 区域进行虚拟机分发。 仅当规模集的区域属性包含多个区域时,才能设置 zoneBalance 属性。 如果没有区域或仅指定一个区域,则不应设置 zoneBalance 属性。

sku

Sku

虚拟机规模集 SKU。

tags

object

资源标记

zones

string[]

虚拟机规模集区域。 注意:只能在创建规模集时设置可用性区域

响应

名称 类型 说明
200 OK

VirtualMachineScaleSet

还行

201 Created

VirtualMachineScaleSet

创建

Other Status Codes

CloudError

描述操作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create a custom-image scale set from an unmanaged generalized os image.
Create a platform-image scale set with unmanaged os disks.
Create a scale set from a custom image.
Create a scale set from a generalized shared image.
Create a scale set from a specialized shared image.
Create a scale set where nic config has DisableTcpStateTracking property
Create a scale set with a marketplace image plan.
Create a scale set with an azure application gateway.
Create a scale set with an azure load balancer.
Create a scale set with Application Profile
Create a scale set with automatic repairs enabled
Create a scale set with boot diagnostics.
Create a scale set with Disk Controller Type
Create a scale set with DiskEncryptionSet resource in os disk and data disk.
Create a scale set with empty data disks on each vm.
Create a scale set with ephemeral os disk provisioning in Nvme disk using placement property.
Create a scale set with ephemeral os disks using placement property.
Create a scale set with ephemeral os disks.
Create a scale set with extension time budget.
Create a scale set with Fpga Network Interfaces.
Create a scale set with Host Encryption using encryptionAtHost property.
Create a scale set with managed boot diagnostics.
Create a scale set with Network Interfaces with public ip address dns settings.
Create a scale set with OS image scheduled events enabled.
Create a scale set with password authentication.
Create a scale set with premium storage.
Create a scale set with priority mix policy
Create a scale set with ProxyAgent Settings of enabled and mode.
Create a scale set with Resilient VM Creation enabled
Create a scale set with Resilient VM Deletion enabled
Create a scale set with scaleInPolicy.
Create a scale set with Security Posture Reference
Create a scale set with SecurityType as ConfidentialVM
Create a scale set with SecurityType as ConfidentialVM and NonPersistedTPM securityEncryptionType
Create a scale set with Service Artifact Reference
Create a scale set with spot restore policy
Create a scale set with ssh authentication.
Create a scale set with terminate scheduled events enabled.
Create a scale set with Uefi Settings of secureBoot and vTPM.
Create a scale set with userData.
Create a scale set with virtual machines in different zones.
Create a scale set with vm size properties
Create a VMSS with an extension that has suppressFailures enabled
Create a VMSS with an extension with protectedSettingsFromKeyVault
Create or update a scale set with capacity reservation.

Create a custom-image scale set from an unmanaged generalized os image.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "osDisk": {
          "caching": "ReadWrite",
          "image": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"
          },
          "createOption": "FromImage",
          "name": "osDisk"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d6e9ab29-f8c9-4792-978c-ae2c07b98f17",
    "virtualMachineProfile": {
      "storageProfile": {
        "osDisk": {
          "osType": "Windows",
          "caching": "ReadWrite",
          "image": {
            "uri": "https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"
          },
          "createOption": "FromImage",
          "name": "osDisk"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d6e9ab29-f8c9-4792-978c-ae2c07b98f17",
    "virtualMachineProfile": {
      "storageProfile": {
        "osDisk": {
          "osType": "Windows",
          "caching": "ReadWrite",
          "image": {
            "uri": "https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"
          },
          "createOption": "FromImage",
          "name": "osDisk"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a platform-image scale set with unmanaged os disks.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "createOption": "FromImage",
          "name": "osDisk",
          "vhdContainers": [
            "http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer",
            "http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer",
            "http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer",
            "http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer",
            "http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer"
          ]
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "77b7df9a-32fe-45e3-8911-60ac9c9b9c64",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "vhdContainers": [
            "http://{existing-storage-account-name}.blob.core.windows.net/vhds"
          ],
          "name": "osDisk",
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "77b7df9a-32fe-45e3-8911-60ac9c9b9c64",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "vhdContainers": [
            "http://{existing-storage-account-name}.blob.core.windows.net/vhds"
          ],
          "name": "osDisk",
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set from a custom image.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set from a generalized shared image.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set from a specialized shared image.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set where nic config has DisableTcpStateTracking property

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{nicConfig1-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "disableTcpStateTracking": true,
              "enableAcceleratedNetworking": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          },
          {
            "name": "{nicConfig2-name}",
            "properties": {
              "primary": false,
              "enableAcceleratedNetworking": false,
              "enableIPForwarding": false,
              "disableTcpStateTracking": false,
              "ipConfigurations": [
                {
                  "name": "{nicConfig2-name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{nicConfig1-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "disableTcpStateTracking": true,
              "ipConfigurations": [
                {
                  "name": "{nicConfig1-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": true
            }
          },
          {
            "name": "{nicConfig2-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": false,
              "enableFpga": false,
              "disableTcpStateTracking": false,
              "ipConfigurations": [
                {
                  "name": "{nicConfig2-name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{nicConfig1-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "disableTcpStateTracking": true,
              "ipConfigurations": [
                {
                  "name": "{nicConfig1-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": true
            }
          },
          {
            "name": "{nicConfig2-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": false,
              "enableFpga": false,
              "disableTcpStateTracking": false,
              "ipConfigurations": [
                {
                  "name": "{nicConfig2-name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with a marketplace image plan.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows2016",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "windows-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with an azure application gateway.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "applicationGatewayBackendAddressPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}"
                      }
                    ],
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "a0134477-b9d9-484b-b0e3-205c1c089ffa",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "applicationGatewayBackendAddressPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/nsgExistingAppGw/backendAddressPools/appGatewayBackendPool"
                      }
                    ],
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "a0134477-b9d9-484b-b0e3-205c1c089ffa",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "applicationGatewayBackendAddressPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/nsgExistingAppGw/backendAddressPools/appGatewayBackendPool"
                      }
                    ],
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with an azure load balancer.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    },
                    "publicIPAddressConfiguration": {
                      "name": "{vmss-name}",
                      "properties": {
                        "publicIPAddressVersion": "IPv4"
                      }
                    },
                    "loadBalancerInboundNatPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}"
                      }
                    ],
                    "loadBalancerBackendAddressPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}"
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "ec0b21ca-51ec-414b-9323-f236ffc21479",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "loadBalancerInboundNatPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/inboundNatPools/lbNatPool"
                      }
                    ],
                    "loadBalancerBackendAddressPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/backendAddressPools/lbBackendPool"
                      }
                    ],
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "ec0b21ca-51ec-414b-9323-f236ffc21479",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "loadBalancerInboundNatPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/inboundNatPools/lbNatPool"
                      }
                    ],
                    "loadBalancerBackendAddressPools": [
                      {
                        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/backendAddressPools/lbBackendPool"
                      }
                    ],
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Application Profile

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "applicationProfile": {
        "galleryApplications": [
          {
            "tags": "myTag1",
            "order": 1,
            "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0",
            "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config",
            "treatFailureAsDeploymentFailure": true,
            "enableAutomaticUpgrade": false
          },
          {
            "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "ffb27c5c-39a5-4d4e-b307-b32598689813",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "applicationProfile": {
        "galleryApplications": [
          {
            "tags": "myTag1",
            "order": 1,
            "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0",
            "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"
          },
          {
            "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "ffb27c5c-39a5-4d4e-b307-b32598689813",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "applicationProfile": {
        "galleryApplications": [
          {
            "tags": "myTag1",
            "order": 1,
            "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0",
            "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"
          },
          {
            "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with automatic repairs enabled

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "automaticRepairsPolicy": {
      "enabled": true,
      "gracePeriod": "PT10M"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "automaticRepairsPolicy": {
      "enabled": true,
      "gracePeriod": "PT10M"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "automaticRepairsPolicy": {
      "enabled": true,
      "gracePeriod": "PT10M"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with boot diagnostics.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Disk Controller Type

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        },
        "diskControllerType": "NVMe"
      },
      "userData": "RXhhbXBsZSBVc2VyRGF0YQ==",
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": 1,
          "vCPUsPerCore": 1
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        },
        "diskControllerType": "NVMe"
      },
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": 1,
          "vCPUsPerCore": 1
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        },
        "diskControllerType": "SCSI"
      },
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": 1,
          "vCPUsPerCore": 1
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with DiskEncryptionSet resource in os disk and data disk.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "createOption": "FromImage"
        },
        "dataDisks": [
          {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS",
              "diskEncryptionSet": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
              }
            },
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 0
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "createOption": "FromImage"
        },
        "dataDisks": [
          {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS",
              "diskEncryptionSet": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
              }
            },
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 0
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "createOption": "FromImage"
        },
        "dataDisks": [
          {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS",
              "diskEncryptionSet": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
              }
            },
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 0
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with empty data disks on each vm.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage",
          "diskSizeGB": 512
        },
        "dataDisks": [
          {
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 0
          },
          {
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 1
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "8042c376-4690-4c47-9fa2-fbdad70e32fa",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage",
          "diskSizeGB": 512
        },
        "dataDisks": [
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 0,
            "diskSizeGB": 1023
          },
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 1,
            "diskSizeGB": 1023
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Succeeded"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "8042c376-4690-4c47-9fa2-fbdad70e32fa",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage",
          "diskSizeGB": 512
        },
        "dataDisks": [
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 0,
            "diskSizeGB": 1023
          },
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 1,
            "diskSizeGB": 1023
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with ephemeral os disk provisioning in Nvme disk using placement property.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows2016",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "windows-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "NvmeDisk"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "NvmeDisk"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "NvmeDisk"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with ephemeral os disks using placement property.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows2016",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "windows-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "ResourceDisk"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "ResourceDisk"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local",
            "placement": "ResourceDisk"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with ephemeral os disks.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows2016",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "windows-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "diffDiskSettings": {
            "option": "Local"
          },
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with extension time budget.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {}
            }
          }
        ],
        "extensionsTimeBudget": "PT1H20M"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {}
            }
          }
        ],
        "extensionsTimeBudget": "PT1H20M"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {}
            }
          }
        ],
        "extensionsTimeBudget": "PT1H20M"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Fpga Network Interfaces.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          },
          {
            "name": "{fpgaNic-Name}",
            "properties": {
              "primary": false,
              "enableAcceleratedNetworking": false,
              "enableIPForwarding": false,
              "enableFpga": true,
              "ipConfigurations": [
                {
                  "name": "{fpgaNic-Name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          },
          {
            "name": "{fpgaNic-Name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": false,
              "enableFpga": true,
              "ipConfigurations": [
                {
                  "name": "{fpgaNic-Name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          },
          {
            "name": "{fpgaNic-Name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": false,
              "enableFpga": true,
              "ipConfigurations": [
                {
                  "name": "{fpgaNic-Name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Host Encryption using encryptionAtHost property.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows2016",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "windows-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "encryptionAtHost": true
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "encryptionAtHost": true
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "standard-data-science-vm",
          "publisher": "microsoft-ads",
          "version": "latest",
          "offer": "standard-data-science-vm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "encryptionAtHost": true
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with managed boot diagnostics.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Network Interfaces with public ip address dns settings.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{nicConfig1-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "disableTcpStateTracking": true,
              "enableAcceleratedNetworking": true,
              "auxiliaryMode": "AcceleratedConnections",
              "auxiliarySku": "A1",
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          },
          {
            "name": "{nicConfig2-name}",
            "properties": {
              "primary": false,
              "enableAcceleratedNetworking": false,
              "enableIPForwarding": false,
              "disableTcpStateTracking": false,
              "ipConfigurations": [
                {
                  "name": "{nicConfig2-name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"
                    },
                    "privateIPAddressVersion": "IPv4",
                    "publicIPAddressConfiguration": {
                      "name": "publicip",
                      "properties": {
                        "idleTimeoutInMinutes": 10,
                        "dnsSettings": {
                          "domainNameLabel": "vmsstestlabel01",
                          "domainNameLabelScope": "NoReuse"
                        }
                      }
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{nicConfig1-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "disableTcpStateTracking": true,
              "ipConfigurations": [
                {
                  "name": "{nicConfig1-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4",
                    "publicIPAddressConfiguration": {
                      "name": "publicip",
                      "properties": {
                        "idleTimeoutInMinutes": 10,
                        "dnsSettings": {
                          "domainNameLabel": "vmsstestlabel01",
                          "domainNameLabelScope": "TenantReuse"
                        }
                      }
                    }
                  }
                }
              ],
              "enableAcceleratedNetworking": true,
              "auxiliaryMode": "AcceleratedConnections",
              "auxiliarySku": "A1"
            }
          },
          {
            "name": "{nicConfig2-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": false,
              "enableFpga": false,
              "disableTcpStateTracking": false,
              "ipConfigurations": [
                {
                  "name": "{nicConfig2-name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "afa2afa8-9e49-48fb-9d18-c86323b5d064",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "disablePasswordAuthentication": false
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{nicConfig1-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "disableTcpStateTracking": true,
              "ipConfigurations": [
                {
                  "name": "{nicConfig1-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": true,
              "auxiliaryMode": "AcceleratedConnections",
              "auxiliarySku": "A1"
            }
          },
          {
            "name": "{nicConfig2-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": false,
              "enableFpga": false,
              "disableTcpStateTracking": false,
              "ipConfigurations": [
                {
                  "name": "{nicConfig2-name}",
                  "properties": {
                    "primary": true,
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with OS image scheduled events enabled.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "scheduledEventsProfile": {
        "osImageNotificationProfile": {
          "enable": true,
          "notBeforeTimeout": "PT15M"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "scheduledEventsProfile": {
        "osImageNotificationProfile": {
          "enable": true,
          "notBeforeTimeout": "PT15M"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "scheduledEventsProfile": {
        "osImageNotificationProfile": {
          "enable": true,
          "notBeforeTimeout": "PT15M"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with password authentication.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "ffb27c5c-39a5-4d4e-b307-b32598689813",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "ffb27c5c-39a5-4d4e-b307-b32598689813",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with premium storage.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Premium_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "19fd38a2-f50a-42c6-9dc7-3f9cf3791225",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Premium_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "19fd38a2-f50a-42c6-9dc7-3f9cf3791225",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Premium_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with priority mix policy

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 10,
    "name": "Standard_A8m_v2"
  },
  "location": "westus",
  "properties": {
    "singlePlacementGroup": false,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "priority": "Spot",
      "evictionPolicy": "Deallocate",
      "billingProfile": {
        "maxPrice": -1
      }
    },
    "orchestrationMode": "Flexible",
    "priorityMixPolicy": {
      "baseRegularPriorityCount": 4,
      "regularPriorityPercentageAboveBase": 50
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 10,
    "name": "Standard_A8m_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": false,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "priority": "Spot",
      "evictionPolicy": "Deallocate",
      "billingProfile": {
        "maxPrice": -1
      }
    },
    "orchestrationMode": "Flexible",
    "priorityMixPolicy": {
      "baseRegularPriorityCount": 4,
      "regularPriorityPercentageAboveBase": 50
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 10,
    "name": "Standard_A8m_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": false,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "priority": "Spot",
      "evictionPolicy": "Deallocate",
      "billingProfile": {
        "maxPrice": -1
      }
    },
    "orchestrationMode": "Flexible",
    "priorityMixPolicy": {
      "baseRegularPriorityCount": 4,
      "regularPriorityPercentageAboveBase": 50
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with ProxyAgent Settings of enabled and mode.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2s_v3"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "publisher": "MicrosoftWindowsServer",
          "offer": "WindowsServer",
          "sku": "2019-Datacenter",
          "version": "latest"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "proxyAgentSettings": {
          "enabled": true,
          "mode": "Enforce"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2s_v3"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "publisher": "MicrosoftWindowsServer",
          "offer": "WindowsServer",
          "sku": "2019-Datacenter",
          "version": "latest"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "proxyAgentSettings": {
          "enabled": true,
          "mode": "Enforce"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2s_v3"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "publisher": "MicrosoftWindowsServer",
          "offer": "WindowsServer",
          "sku": "2019-Datacenter",
          "version": "latest"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "proxyAgentSettings": {
          "enabled": true,
          "mode": "Enforce"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with Resilient VM Creation enabled

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": false,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "resiliencyPolicy": {
      "resilientVMCreationPolicy": {
        "enabled": true
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": false,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "resiliencyPolicy": {
      "resilientVMCreationPolicy": {
        "enabled": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": false,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "resiliencyPolicy": {
      "resilientVMCreationPolicy": {
        "enabled": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Resilient VM Deletion enabled

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": false,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "resiliencyPolicy": {
      "resilientVMDeletionPolicy": {
        "enabled": true
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": false,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "resiliencyPolicy": {
      "resilientVMDeletionPolicy": {
        "enabled": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": false,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "resiliencyPolicy": {
      "resilientVMDeletionPolicy": {
        "enabled": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with scaleInPolicy.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scaleInPolicy": {
      "rules": [
        "OldestVM"
      ],
      "forceDeletion": true
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scaleInPolicy": {
      "rules": [
        "OldestVM"
      ],
      "forceDeletion": true
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "scaleInPolicy": {
      "rules": [
        "OldestVM"
      ],
      "forceDeletion": true
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Security Posture Reference

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_A1"
  },
  "location": "eastus2euap",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "securityPostureReference": {
        "id": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest",
        "excludeExtensions": [
          "{securityPostureVMExtensionName}"
        ],
        "isOverridable": true
      },
      "storageProfile": {
        "imageReference": {
          "sku": "2022-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "createOption": "FromImage",
          "name": "osDisk"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic",
      "automaticOSUpgradePolicy": {
        "enableAutomaticOSUpgrade": true
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_A1"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d12ccb3d-ab15-4794-9836-c4196392e9f2",
    "virtualMachineProfile": {
      "securityPostureReference": {
        "id": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest",
        "excludeExtensions": [
          "{securityPostureVMExtensionName}"
        ],
        "isOverridable": true
      },
      "storageProfile": {
        "imageReference": {
          "sku": "2022-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "name": "osDisk",
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic",
      "automaticOSUpgradePolicy": {
        "enableAutomaticOSUpgrade": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "eastus2euap",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_A1"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d12ccb3d-ab15-4794-9836-c4196392e9f2",
    "virtualMachineProfile": {
      "securityPostureReference": {
        "id": "/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest",
        "excludeExtensions": [
          "{securityPostureVMExtensionName}"
        ],
        "isOverridable": true
      },
      "storageProfile": {
        "imageReference": {
          "sku": "2022-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "name": "osDisk",
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic",
      "automaticOSUpgradePolicy": {
        "enableAutomaticOSUpgrade": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "eastus2euap",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with SecurityType as ConfidentialVM

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DC2as_v5"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows-cvm",
          "publisher": "MicrosoftWindowsServer",
          "version": "17763.2183.2109130127",
          "offer": "2019-datacenter-cvm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS",
            "securityProfile": {
              "securityEncryptionType": "VMGuestStateOnly"
            }
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": true,
          "vTpmEnabled": true
        },
        "securityType": "ConfidentialVM"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DC2as_v5"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows-cvm",
          "publisher": "MicrosoftWindowsServer",
          "version": "17763.2183.2109130127",
          "offer": "2019-datacenter-cvm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS",
            "securityProfile": {
              "securityEncryptionType": "VMGuestStateOnly"
            }
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": true,
          "vTpmEnabled": true
        },
        "securityType": "ConfidentialVM"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DC2as_v5"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows-cvm",
          "publisher": "MicrosoftWindowsServer",
          "version": "17763.2183.2109130127",
          "offer": "2019-datacenter-cvm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS",
            "securityProfile": {
              "securityEncryptionType": "VMGuestStateOnly"
            }
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": true,
          "vTpmEnabled": true
        },
        "securityType": "ConfidentialVM"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with SecurityType as ConfidentialVM and NonPersistedTPM securityEncryptionType

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DC2es_v5"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "linux-cvm",
          "publisher": "UbuntuServer",
          "version": "17763.2183.2109130127",
          "offer": "2022-datacenter-cvm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS",
            "securityProfile": {
              "securityEncryptionType": "NonPersistedTPM"
            }
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": false,
          "vTpmEnabled": true
        },
        "securityType": "ConfidentialVM"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DC2es_v5"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "linux-cvm",
          "publisher": "UbuntuServer",
          "version": "17763.2183.2109130127",
          "offer": "2022-datacenter-cvm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS",
            "securityProfile": {
              "securityEncryptionType": "NonPersistedTPM"
            }
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": false,
          "vTpmEnabled": true
        },
        "securityType": "ConfidentialVM"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DC2es_v5"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "linux-cvm",
          "publisher": "UbuntuServer",
          "version": "17763.2183.2109130127",
          "offer": "2022-datacenter-cvm"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS",
            "securityProfile": {
              "securityEncryptionType": "NonPersistedTPM"
            }
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": false,
          "vTpmEnabled": true
        },
        "securityType": "ConfidentialVM"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with Service Artifact Reference

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_A1"
  },
  "location": "eastus2euap",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "serviceArtifactReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"
      },
      "storageProfile": {
        "imageReference": {
          "sku": "2022-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "createOption": "FromImage",
          "name": "osDisk"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic",
      "automaticOSUpgradePolicy": {
        "enableAutomaticOSUpgrade": true
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_A1"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "77b7df9a-32fe-45e3-8911-60ac9c9b9c64",
    "virtualMachineProfile": {
      "serviceArtifactReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"
      },
      "storageProfile": {
        "imageReference": {
          "sku": "2022-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "name": "osDisk",
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic",
      "automaticOSUpgradePolicy": {
        "enableAutomaticOSUpgrade": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "eastus2euap",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_A1"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "77b7df9a-32fe-45e3-8911-60ac9c9b9c64",
    "virtualMachineProfile": {
      "serviceArtifactReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"
      },
      "storageProfile": {
        "imageReference": {
          "sku": "2022-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "name": "osDisk",
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic",
      "automaticOSUpgradePolicy": {
        "enableAutomaticOSUpgrade": true
      }
    },
    "provisioningState": "Creating"
  },
  "location": "eastus2euap",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with spot restore policy

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 2,
    "name": "Standard_A8m_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "priority": "Spot",
      "evictionPolicy": "Deallocate",
      "billingProfile": {
        "maxPrice": -1
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "spotRestorePolicy": {
      "enabled": true,
      "restoreTimeout": "PT1H"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 2,
    "name": "Standard_A8m_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "priority": "Spot",
      "evictionPolicy": "Deallocate",
      "billingProfile": {
        "maxPrice": -1
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "spotRestorePolicy": {
      "enabled": true,
      "restoreTimeout": "PT1H"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 2,
    "name": "Standard_A8m_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "priority": "Spot",
      "evictionPolicy": "Deallocate",
      "billingProfile": {
        "maxPrice": -1
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "spotRestorePolicy": {
      "enabled": true,
      "restoreTimeout": "PT1H"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with ssh authentication.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "linuxConfiguration": {
          "ssh": {
            "publicKeys": [
              {
                "path": "/home/{your-username}/.ssh/authorized_keys",
                "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
              }
            ]
          },
          "disablePasswordAuthentication": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "fb73af19-0090-467c-9ced-b00bceab1c45",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "16.04-LTS",
          "publisher": "Canonical",
          "version": "latest",
          "offer": "UbuntuServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "ssh": {
            "publicKeys": [
              {
                "path": "/home/{your-username}/.ssh/authorized_keys",
                "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
              }
            ]
          },
          "disablePasswordAuthentication": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "fb73af19-0090-467c-9ced-b00bceab1c45",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "16.04-LTS",
          "publisher": "Canonical",
          "version": "latest",
          "offer": "UbuntuServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "linuxConfiguration": {
          "ssh": {
            "publicKeys": [
              {
                "path": "/home/{your-username}/.ssh/authorized_keys",
                "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
              }
            ]
          },
          "disablePasswordAuthentication": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with terminate scheduled events enabled.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "scheduledEventsProfile": {
        "terminateNotificationProfile": {
          "enable": true,
          "notBeforeTimeout": "PT5M"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "scheduledEventsProfile": {
        "terminateNotificationProfile": {
          "enable": true,
          "notBeforeTimeout": "PT5M"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "scheduledEventsProfile": {
        "terminateNotificationProfile": {
          "enable": true,
          "notBeforeTimeout": "PT5M"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with Uefi Settings of secureBoot and vTPM.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2s_v3"
  },
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows10-tvm",
          "publisher": "MicrosoftWindowsServer",
          "version": "18363.592.2001092016",
          "offer": "windowsserver-gen2preview-preview"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": true,
          "vTpmEnabled": true
        },
        "securityType": "TrustedLaunch"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  },
  "location": "westus"
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2s_v3"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows10-tvm",
          "publisher": "MicrosoftWindowsServer",
          "version": "18363.592.2001092016",
          "offer": "windowsserver-gen2preview-preview"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": true,
          "vTpmEnabled": true
        },
        "securityType": "TrustedLaunch"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D2s_v3"
  },
  "name": "{vmss-name}",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "b9e23088-6ffc-46e0-9e02-b0a6eeef47db",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "windows10-tvm",
          "publisher": "MicrosoftWindowsServer",
          "version": "18363.592.2001092016",
          "offer": "windowsserver-gen2preview-preview"
        },
        "osDisk": {
          "caching": "ReadOnly",
          "managedDisk": {
            "storageAccountType": "StandardSSD_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "securityProfile": {
        "uefiSettings": {
          "secureBootEnabled": true,
          "vTpmEnabled": true
        },
        "securityType": "TrustedLaunch"
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus"
}

Create a scale set with userData.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "upgradePolicy": {
      "mode": "Manual"
    },
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "userData": "RXhhbXBsZSBVc2VyRGF0YQ==",
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with virtual machines in different zones.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 2,
    "name": "Standard_A1_v2"
  },
  "location": "centralus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage",
          "diskSizeGB": 512
        },
        "dataDisks": [
          {
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 0
          },
          {
            "diskSizeGB": 1023,
            "createOption": "Empty",
            "lun": 1
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic"
    }
  },
  "zones": [
    "1",
    "3"
  ]
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 2,
    "name": "Standard_A1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": false,
    "overprovision": true,
    "uniqueId": "8042c376-4690-4c47-9fa2-fbdad70e32fa",
    "zoneBalance": false,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage",
          "diskSizeGB": 512
        },
        "dataDisks": [
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 0,
            "diskSizeGB": 1023
          },
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 1,
            "diskSizeGB": 1023
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic"
    },
    "provisioningState": "Succeeded"
  },
  "zones": [
    "1",
    "3"
  ],
  "location": "centralus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 2,
    "name": "Standard_A1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": false,
    "overprovision": true,
    "uniqueId": "8042c376-4690-4c47-9fa2-fbdad70e32fa",
    "zoneBalance": false,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage",
          "diskSizeGB": 512
        },
        "dataDisks": [
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 0,
            "diskSizeGB": 1023
          },
          {
            "caching": "None",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "Empty",
            "lun": 1,
            "diskSizeGB": 1023
          }
        ]
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Automatic"
    },
    "provisioningState": "Creating"
  },
  "zones": [
    "1",
    "3"
  ],
  "location": "centralus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a scale set with vm size properties

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "upgradePolicy": {
      "mode": "Manual"
    },
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "userData": "RXhhbXBsZSBVc2VyRGF0YQ==",
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": 1,
          "vCPUsPerCore": 1
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": 1,
          "vCPUsPerCore": 1
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "hardwareProfile": {
        "vmSizeProperties": {
          "vCPUsAvailable": 1,
          "vCPUsPerCore": 1
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a VMSS with an extension that has suppressFailures enabled

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {},
              "suppressFailures": true
            }
          }
        ]
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {},
              "suppressFailures": true
            }
          }
        ]
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {},
              "suppressFailures": true
            }
          }
        ]
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create a VMSS with an extension with protectedSettingsFromKeyVault

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {},
              "protectedSettingsFromKeyVault": {
                "sourceVault": {
                  "id": "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"
                },
                "secretUrl": "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"
              }
            }
          }
        ]
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {},
              "protectedSettingsFromKeyVault": {
                "sourceVault": {
                  "id": "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"
                },
                "secretUrl": "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"
              }
            }
          }
        ]
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_D1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "diagnosticsProfile": {
        "bootDiagnostics": {
          "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
          "enabled": true
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "extensionProfile": {
        "extensions": [
          {
            "name": "{extension-name}",
            "properties": {
              "autoUpgradeMinorVersion": false,
              "publisher": "{extension-Publisher}",
              "type": "{extension-Type}",
              "typeHandlerVersion": "{handler-version}",
              "settings": {},
              "protectedSettingsFromKeyVault": {
                "sourceVault": {
                  "id": "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"
                },
                "secretUrl": "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"
              }
            }
          }
        ]
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

Create or update a scale set with capacity reservation.

示例请求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}?api-version=2024-03-01

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "location": "westus",
  "properties": {
    "overprovision": true,
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "adminPassword": "{your-password}"
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"
                    }
                  }
                }
              ]
            }
          }
        ]
      },
      "capacityReservation": {
        "capacityReservationGroup": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    }
  }
}

示例响应

{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "capacityReservation": {
        "capacityReservationGroup": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}
{
  "sku": {
    "tier": "Standard",
    "capacity": 3,
    "name": "Standard_DS1_v2"
  },
  "name": "{vmss-name}",
  "properties": {
    "singlePlacementGroup": true,
    "overprovision": true,
    "uniqueId": "d053ec5a-8da6-495f-ab13-38216503c6d7",
    "virtualMachineProfile": {
      "storageProfile": {
        "imageReference": {
          "sku": "2016-Datacenter",
          "publisher": "MicrosoftWindowsServer",
          "version": "latest",
          "offer": "WindowsServer"
        },
        "osDisk": {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "FromImage"
        }
      },
      "osProfile": {
        "computerNamePrefix": "{vmss-name}",
        "adminUsername": "{your-username}",
        "secrets": [],
        "windowsConfiguration": {
          "provisionVMAgent": true,
          "enableAutomaticUpdates": true
        }
      },
      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "{vmss-name}",
            "properties": {
              "dnsSettings": {
                "dnsServers": []
              },
              "primary": true,
              "enableIPForwarding": true,
              "ipConfigurations": [
                {
                  "name": "{vmss-name}",
                  "properties": {
                    "subnet": {
                      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"
                    },
                    "privateIPAddressVersion": "IPv4"
                  }
                }
              ],
              "enableAcceleratedNetworking": false
            }
          }
        ]
      },
      "capacityReservation": {
        "capacityReservationGroup": {
          "id": "subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
        }
      }
    },
    "upgradePolicy": {
      "mode": "Manual"
    },
    "provisioningState": "Creating"
  },
  "location": "westus",
  "type": "Microsoft.Compute/virtualMachineScaleSets",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"
}

定义

名称 说明
AdditionalCapabilities

启用或禁用虚拟机或虚拟机规模集上的功能。

AdditionalUnattendContent

指定 Windows 安装程序使用的 Unattend.xml 文件中可以包含的其他 XML 格式化信息。 内容通过设置名称、组件名称和应用内容的传递来定义。

ApiEntityReference

API 实体引用。

ApiError

Api 错误。

ApiErrorBase

Api 错误基数。

ApplicationProfile

包含应提供给 VM/VMSS 的库应用程序列表

AutomaticOSUpgradePolicy

用于执行自动 OS 升级的配置参数。

AutomaticRepairsPolicy

指定虚拟机规模集上自动修复的配置参数。

BillingProfile

指定 Azure 现成 VM 或 VMSS 的计费相关详细信息。 最低 API 版本:2019-03-01。

BootDiagnostics

启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图来诊断 VM 状态。 可以轻松查看控制台日志的输出。 通过 Azure,还可以从虚拟机监控程序查看 VM 的屏幕截图。

CachingTypes

指定缓存要求。 可能的值为:None、ReadOnly、ReadWrite。 默认值为:标准存储的 None。高级存储的 ReadOnly。

CapacityReservationProfile

容量预留配置文件的参数。

CloudError

来自计算服务的错误响应。

ComponentNames

组件名称。 目前,唯一允许的值是Microsoft-Windows-Shell-Setup。

DeleteOptions

指定删除 VM 时公共 IP 会发生什么情况

DiagnosticsProfile

指定启动诊断设置状态。 最低 API 版本:2015-06-15。

DiffDiskOptions

指定操作系统磁盘的临时磁盘设置。

DiffDiskPlacement

指定操作系统磁盘的临时磁盘放置。 用户可以在请求中使用此属性来选择用于临时 OS 磁盘预配的位置,例如缓存磁盘、资源磁盘或 nvme 磁盘空间。 有关临时 OS 磁盘大小要求的详细信息,请参阅 windows VM 的临时 OS 磁盘大小要求,https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements,Linux VM https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements。 NvmeDisk 的最低 API 版本:2024-03-01。

DiffDiskSettings

描述可为操作系统磁盘指定的临时磁盘设置的参数。 注意: 临时磁盘设置只能为托管磁盘指定。

DiskControllerTypes
DiskCreateOptionTypes

指定应如何创建规模集中的虚拟机。 唯一允许的值是:FromImage。 使用映像创建虚拟机时使用此值。 如果使用平台映像,则还使用上述 imageReference 元素。 如果使用市场映像,则还会使用前面所述的计划元素。

DiskDeleteOptionTypes

指定在 VMSS Flex 删除时是否应删除或分离 OS 磁盘(此功能仅适用于具有灵活 OrchestrationMode 的 VMSS)。

可能的值:

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

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

默认值设置为 Delete。 对于临时 OS 磁盘,默认值设置为 删除。 用户无法更改临时 OS 磁盘的删除选项。

DiskEncryptionSetParameters

描述可为磁盘指定的客户托管磁盘加密集资源 ID 的参数。 注意: 只能为托管磁盘指定磁盘加密集资源 ID。 有关详细信息,请参阅 https://aka.ms/mdssewithcmkoverview

DomainNameLabelScopeTypes

域名标签范围。根据域名标签范围和 vm 索引的策略生成的哈希域名标签的串联将是将创建的 PublicIPAddress 资源的域名标签

EncryptionIdentity

指定 ADE 用于获取 keyvault 操作的访问令牌的托管标识。

EventGridAndResourceGraph

指定 eventGridAndResourceGraph 相关的计划事件相关配置。

ExtendedLocation

扩展位置的复杂类型。

ExtendedLocationTypes

扩展位置的类型。

ImageReference

指定要使用的图像的信息。 可以指定有关平台映像、市场映像或虚拟机映像的信息。 若要使用平台映像、市场映像或虚拟机映像,但不在其他创建操作中使用,则需要此元素。 注意:只能在创建规模集时设置映像引用发布者和产品/服务。

InnerError

内部错误详细信息。

IPVersion

从 Api-Version 2019-07-01 开始提供,它表示特定 ipconfiguration 是 IPv4 还是 IPv6。 默认值被视为 IPv4。 可能的值为:“IPv4”和“IPv6”。

KeyVaultSecretReference

描述对 Key Vault 机密的引用

LinuxConfiguration

指定虚拟机上的 Linux 操作系统设置。 有关受支持的 Linux 分发版的列表,请参阅 Azure-Endorsed 分发版上的 Linux

LinuxPatchAssessmentMode

指定 IaaS 虚拟机的 VM 来宾修补评估模式。

可能的值包括:

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

AutomaticByPlatform - 平台将触发定期修补评估。 属性 provisionVMAgent 必须为 true。

LinuxPatchSettings

指定与 Linux 上的 VM 来宾修补相关的设置。

LinuxVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。

LinuxVMGuestPatchAutomaticByPlatformSettings

指定在 Linux 修补程序设置中选择修补程序模式 AutomaticByPlatform 时要应用的其他设置。

LinuxVMGuestPatchMode

指定 VM 来宾修补到 IaaS 虚拟机的模式,或与将 OrchestrationMode 作为灵活业务流程模式的虚拟机规模集关联的虚拟机。

可能的值包括:

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

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

Mode

指定在启用该功能时 ProxyAgent 将执行的模式。 ProxyAgent 将开始审核或监视,但不强制对审核模式下主机终结点的请求实施访问控制,而在“强制”模式下,将强制实施访问控制。 默认值为“强制”模式。

NetworkApiVersion

指定使用业务流程模式“灵活”在虚拟机规模集的网络接口配置中创建网络资源时使用的 Microsoft.Network API 版本

NetworkInterfaceAuxiliaryMode

指定是否为网络接口资源启用辅助模式。

NetworkInterfaceAuxiliarySku

指定是否为网络接口资源启用辅助 SKU。

OperatingSystemTypes

此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 类型。 可能的值包括:Windows、Linux。

OrchestrationMode

指定虚拟机规模集的业务流程模式。

OSImageNotificationProfile
PassNames

传递名称。 目前,唯一允许的值是 OobeSystem。

PatchSettings

指定与 Windows 上的 VM 来宾修补相关的设置。

Plan

指定有关用于创建虚拟机的市场映像的信息。 此元素仅用于市场映像。 必须先启用映像以编程方式使用映像,然后才能从 API 使用市场映像。 在 Azure 门户中,找到要使用的市场映像,然后单击 想要以编程方式部署,开始使用 ->。 输入任何必需的信息,然后单击“保存

PriorityMixPolicy

指定具有灵活业务流程模式的规模集中的现成和常规优先级 VM 的目标拆分。 使用此属性,客户能够指定在达到此基本目标后,创建为 VMSS 弹性实例的常规优先级 VM 的基数和拆分。

ProtocolTypes

指定 WinRM 侦听器的协议。 可能的值为:http、https。

ProxyAgentSettings

在创建虚拟机时指定 ProxyAgent 设置。 最低 api 版本:2024-03-01。

PublicIPAddressSku

描述公共 IP Sku。 只能将 OrchestrationMode 设置为灵活。

PublicIPAddressSkuName

指定公共 IP SKU 名称

PublicIPAddressSkuTier

指定公共 IP SKU 层

RepairAction

用于修复规模集中运行不正常的虚拟机的修复操作类型(替换、重启、重置映像)。 默认值将被替换。

ResiliencyPolicy

描述复原策略 - resiliencVMCreationPolicy 和/或 resiliencVMDeletionPolicy。

ResilientVMCreationPolicy

执行可复原 VM 创建时使用的配置参数。

ResilientVMDeletionPolicy

执行弹性 VM 删除时使用的配置参数。

ResourceIdentityType

用于虚拟机规模集的标识类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将从虚拟机规模集中删除任何标识。

RollingUpgradePolicy

执行滚动升级时使用的配置参数。

ScaleInPolicy

描述虚拟机规模集的横向缩减策略。

ScheduledEventsAdditionalPublishingTargets
ScheduledEventsPolicy

指定重新部署、重新启动和 ScheduledEventsAdditionalPublishingTargets Scheduled 事件相关配置。

ScheduledEventsProfile
securityEncryptionTypes

指定托管磁盘的 EncryptionType。 它设置为 DiskWithVMGuestState,用于加密托管磁盘以及 VMGuestState blob、VMGuestStateOnly 以仅加密 VMGuestState blob,并将 NonPersistedTPM 设置为不保留 VMGuestState blob 中的固件状态。 注意: 只能为机密 VM 设置它。

SecurityPostureReference

指定要在规模集中使用的安全状况。 最低 API 版本:2023-03-01

SecurityProfile

指定虚拟机或虚拟机规模集的安全配置文件设置。

SecurityTypes

指定虚拟机的 SecurityType。 必须将其设置为任何指定值才能启用 UefiSettings。 默认行为为:除非设置了此属性,否则不会启用 UefiSettings。

ServiceArtifactReference

指定使用“latest”映像版本时,用于为规模集中的所有虚拟机设置相同映像版本的服务项目引用 ID。 最低 API 版本:2022-11-01

SettingNames

指定内容应用到的设置的名称。 可能的值包括:FirstLogonCommands 和 AutoLogon。

Sku

描述虚拟机规模集 SKU。 注意:如果规模集当前在硬件上不支持新的 VM SKU,则需要在修改 SKU 名称之前解除分配规模集中的 VM。

SpotRestorePolicy

指定虚拟机规模集的现成Try-Restore 属性。 使用此属性,客户可以根据容量可用性和定价约束,启用或禁用逐出的现成 VMSS VM 实例的自动还原。

SshConfiguration

Azure 上运行的基于 Linux 的 VM 的 SSH 配置

SshPublicKey

包含有关 SSH 证书公钥的信息以及放置公钥的 Linux VM 上的路径。

StorageAccountTypes

指定托管磁盘的存储帐户类型。 注意:UltraSSD_LRS只能与数据磁盘一起使用,它不能与 OS 磁盘一起使用。

SubResource
TerminateNotificationProfile
UefiSettings

指定在创建虚拟机时使用的安全启动和 vTPM 等安全设置。 最低 api 版本:2020-12-01。

UpgradeMode

指定升级到规模集中虚拟机的模式。

可能的值包括:

手动 - 控制对规模集中虚拟机的更新的应用程序。 使用 manualUpgrade 操作执行此操作。

自动 - 规模集中的所有虚拟机同时自动更新。

UpgradePolicy

描述升级策略 - 自动、手动或滚动。

UserAssignedIdentities

与虚拟机关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。

UserInitiatedReboot

指定重启相关的计划事件相关配置。

UserInitiatedRedeploy

指定重新部署相关的计划事件相关配置。

VaultCertificate

介绍 Key Vault 中的单个证书引用,以及证书应驻留在 VM 上的位置。

VaultSecretGroup

描述一组证书,这些证书都位于同一 Key Vault 中。

VirtualHardDisk

描述磁盘的 URI。

VirtualMachineEvictionPolicyTypes

指定 Azure 现成虚拟机和 Azure Spot 规模集的逐出策略。 对于 Azure 现成虚拟机,支持“解除分配”和“删除”,最低 API 版本为 2019-03-01。 对于 Azure Spot 规模集,支持“Deallocate”和“Delete”,最低 API 版本为 2017-10-30-preview。

VirtualMachinePriorityTypes

指定规模集中虚拟机的优先级。 最低 api 版本:2017-10-30-preview。

VirtualMachineScaleSet

描述虚拟机规模集。

VirtualMachineScaleSetDataDisk

描述虚拟机规模集数据磁盘。

VirtualMachineScaleSetExtension

描述虚拟机规模集扩展。

VirtualMachineScaleSetExtensionProfile

描述虚拟机规模集扩展配置文件。

VirtualMachineScaleSetHardwareProfile

指定虚拟机规模集的硬件设置。

VirtualMachineScaleSetIdentity

虚拟机规模集的标识。

VirtualMachineScaleSetIPConfiguration

介绍虚拟机规模集网络配置文件的 IP 配置。

VirtualMachineScaleSetIpTag

包含与公共 IP 地址关联的 IP 标记。

VirtualMachineScaleSetManagedDiskParameters

描述 ScaleSet 托管磁盘的参数。

VirtualMachineScaleSetNetworkConfiguration

介绍虚拟机规模集网络配置文件的网络配置。

VirtualMachineScaleSetNetworkConfigurationDnsSettings

描述虚拟机规模集网络配置的 DNS 设置。

VirtualMachineScaleSetNetworkProfile

描述虚拟机规模集网络配置文件。

VirtualMachineScaleSetOSDisk

描述虚拟机规模集操作系统磁盘。

VirtualMachineScaleSetOSProfile

描述虚拟机规模集 OS 配置文件。

VirtualMachineScaleSetPublicIPAddressConfiguration

介绍虚拟机规模集 IP 配置的公共 IPAddress 配置

VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings

描述虚拟机规模集网络配置的 DNS 设置。

VirtualMachineScaleSetScaleInRules

在虚拟机规模集中进行缩放时要遵循的规则。

可能的值包括:

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

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

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

VirtualMachineScaleSetStorageProfile

描述虚拟机规模集存储配置文件。

VirtualMachineScaleSetVMProfile

描述虚拟机规模集虚拟机配置文件。

VMDiskSecurityProfile

指定托管磁盘的安全配置文件设置。 注意: 只能为机密 VM 设置它。

VMGalleryApplication

指定引用计算库应用程序版本所需的信息

VMSizeProperties

指定虚拟机上的 VM 大小属性设置。

WindowsConfiguration

指定虚拟机上的 Windows 操作系统设置。

WindowsPatchAssessmentMode

指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值包括:

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

AutomaticByPlatform - 平台将触发定期修补评估。 属性 provisionVMAgent 必须为 true。

WindowsVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。

WindowsVMGuestPatchAutomaticByPlatformSettings

指定在 Windows 修补程序设置中选择修补程序模式 AutomaticByPlatform 时要应用的其他设置。

WindowsVMGuestPatchMode

指定 VM 来宾修补到 IaaS 虚拟机的模式,或与将 OrchestrationMode 作为灵活业务流程模式的虚拟机规模集关联的虚拟机。

可能的值包括:

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

AutomaticByOS - 虚拟机将由 OS 自动更新。 属性 WindowsConfiguration.enableAutomaticUpdates 必须为 true。

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

WinRMConfiguration

介绍 VM 的 Windows 远程管理配置

WinRMListener

介绍 Windows 远程管理侦听器的协议和指纹

AdditionalCapabilities

启用或禁用虚拟机或虚拟机规模集上的功能。

名称 类型 说明
hibernationEnabled

boolean

在 VM 上启用或禁用休眠功能的标志。

ultraSSDEnabled

boolean

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

AdditionalUnattendContent

指定 Windows 安装程序使用的 Unattend.xml 文件中可以包含的其他 XML 格式化信息。 内容通过设置名称、组件名称和应用内容的传递来定义。

名称 类型 说明
componentName

ComponentNames

组件名称。 目前,唯一允许的值是Microsoft-Windows-Shell-Setup。

content

string

指定为指定路径和组件添加到 unattend.xml 文件的 XML 格式化内容。 XML 必须小于 4KB,并且必须包含要插入的设置或功能的根元素。

passName

PassNames

传递名称。 目前,唯一允许的值是 OobeSystem。

settingName

SettingNames

指定内容应用到的设置的名称。 可能的值包括:FirstLogonCommands 和 AutoLogon。

ApiEntityReference

API 实体引用。

名称 类型 说明
id

string

/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 形式的 ARM 资源 ID

ApiError

Api 错误。

名称 类型 说明
code

string

错误代码。

details

ApiErrorBase[]

API 错误详细信息

innererror

InnerError

Api 内部错误

message

string

错误消息。

target

string

特定错误的目标。

ApiErrorBase

Api 错误基数。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

target

string

特定错误的目标。

ApplicationProfile

包含应提供给 VM/VMSS 的库应用程序列表

名称 类型 说明
galleryApplications

VMGalleryApplication[]

指定应提供给 VM/VMSS 的库应用程序

AutomaticOSUpgradePolicy

用于执行自动 OS 升级的配置参数。

名称 类型 说明
disableAutomaticRollback

boolean

是否应禁用 OS 映像回滚功能。 默认值为 false。

enableAutomaticOSUpgrade

boolean

指示当较新版本的 OS 映像可用时,是否应以滚动方式自动将 OS 升级应用于规模集实例。 默认值为 false。 如果此选项设置为基于 Windows 的规模集,enableAutomaticUpdates 将自动设置为 false,并且不能设置为 true。

osRollingUpgradeDeferral

boolean

指示自动 OS 升级是否应延迟。 延迟的 OS 升级将根据每个 VM 发送高级通知,即通过 IMDS 标记“Platform.PendingOSUpgrade”从滚动升级进行 OS 升级。 然后,升级会延迟,直到通过 ApprovRollingUpgrade 调用批准升级。

useRollingUpgradePolicy

boolean

指示是否应在自动 OS 升级期间使用滚动升级策略。 默认值为 false。 如果未在 VMSS 上定义任何策略,则自动 OS 升级将回退到默认策略。

AutomaticRepairsPolicy

指定虚拟机规模集上自动修复的配置参数。

名称 类型 说明
enabled

boolean

指定是否应在虚拟机规模集上启用自动修复。 默认值为 false。

gracePeriod

string

由于 VM 上的状态更改,自动修复暂停的时间。 状态更改完成后的宽限时间开始。 这有助于避免过早或意外修复。 持续时间应采用 ISO 8601 格式指定。 允许的最小宽限期为 10 分钟(PT10M),这也是默认值。 允许的最大宽限期为 90 分钟(PT90M)。

repairAction

RepairAction

用于修复规模集中运行不正常的虚拟机的修复操作类型(替换、重启、重置映像)。 默认值将被替换。

BillingProfile

指定 Azure 现成 VM 或 VMSS 的计费相关详细信息。 最低 API 版本:2019-03-01。

名称 类型 说明
maxPrice

number

指定愿意为 Azure 现成 VM/VMSS 付费的最高价格。 这个价格是美元。

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

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

可能的值包括:

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

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

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

最低 API 版本:2019-03-01。

BootDiagnostics

启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图来诊断 VM 状态。 可以轻松查看控制台日志的输出。 通过 Azure,还可以从虚拟机监控程序查看 VM 的屏幕截图。

名称 类型 说明
enabled

boolean

是否应在虚拟机上启用启动诊断。

storageUri

string

用于放置控制台输出和屏幕截图的存储帐户的 URI。 如果在启用启动诊断时未指定 storageUri,则会使用托管存储。

CachingTypes

指定缓存要求。 可能的值为:None、ReadOnly、ReadWrite。 默认值为:标准存储的 None。高级存储的 ReadOnly。

名称 类型 说明
None

string

ReadOnly

string

ReadWrite

string

CapacityReservationProfile

容量预留配置文件的参数。

名称 类型 说明
capacityReservationGroup

SubResource

指定容量预留组资源 ID,该 ID 应用于分配已保留足够容量的虚拟机或规模集 VM 实例。 有关详细信息,请参阅 https://aka.ms/CapacityReservation

CloudError

来自计算服务的错误响应。

名称 类型 说明
error

ApiError

Api 错误。

ComponentNames

组件名称。 目前,唯一允许的值是Microsoft-Windows-Shell-Setup。

名称 类型 说明
Microsoft-Windows-Shell-Setup

string

DeleteOptions

指定删除 VM 时公共 IP 会发生什么情况

名称 类型 说明
Delete

string

Detach

string

DiagnosticsProfile

指定启动诊断设置状态。 最低 API 版本:2015-06-15。

名称 类型 说明
bootDiagnostics

BootDiagnostics

启动诊断是一项调试功能,可用于查看控制台输出和屏幕截图来诊断 VM 状态。 注意:如果指定 storageUri,请确保存储帐户与 VM 位于同一区域和订阅中。 可以轻松查看控制台日志的输出。 通过 Azure,还可以从虚拟机监控程序查看 VM 的屏幕截图。

DiffDiskOptions

指定操作系统磁盘的临时磁盘设置。

名称 类型 说明
Local

string

DiffDiskPlacement

指定操作系统磁盘的临时磁盘放置。 用户可以在请求中使用此属性来选择用于临时 OS 磁盘预配的位置,例如缓存磁盘、资源磁盘或 nvme 磁盘空间。 有关临时 OS 磁盘大小要求的详细信息,请参阅 windows VM 的临时 OS 磁盘大小要求,https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements,Linux VM https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements。 NvmeDisk 的最低 API 版本:2024-03-01。

名称 类型 说明
CacheDisk

string

NvmeDisk

string

ResourceDisk

string

DiffDiskSettings

描述可为操作系统磁盘指定的临时磁盘设置的参数。 注意: 临时磁盘设置只能为托管磁盘指定。

名称 类型 说明
option

DiffDiskOptions

指定操作系统磁盘的临时磁盘设置。

placement

DiffDiskPlacement

指定操作系统磁盘的临时磁盘放置。 可能的值为:CacheDisk、ResourceDisk、NvmeDisk。 默认行为为:如果为 VM 大小配置了一个,则 CacheDisk;否则,ResourceDisk 或使用 NvmeDisk。 请参阅 https://docs.microsoft.com/azure/virtual-machines/linux/sizeshttps://docs.microsoft.com/azure/virtual-machines/windows/sizes 上的 Windows VM 和 Linux VM 的 VM 大小文档,以检查哪些 VM 大小公开了缓存磁盘。 NvmeDisk 的最低 API 版本:2024-03-01。

DiskControllerTypes

名称 类型 说明
NVMe

string

SCSI

string

DiskCreateOptionTypes

指定应如何创建规模集中的虚拟机。 唯一允许的值是:FromImage。 使用映像创建虚拟机时使用此值。 如果使用平台映像,则还使用上述 imageReference 元素。 如果使用市场映像,则还会使用前面所述的计划元素。

名称 类型 说明
Attach

string

Copy

string

Empty

string

FromImage

string

Restore

string

DiskDeleteOptionTypes

指定在 VMSS Flex 删除时是否应删除或分离 OS 磁盘(此功能仅适用于具有灵活 OrchestrationMode 的 VMSS)。

可能的值:

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

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

默认值设置为 Delete。 对于临时 OS 磁盘,默认值设置为 删除。 用户无法更改临时 OS 磁盘的删除选项。

名称 类型 说明
Delete

string

Detach

string

DiskEncryptionSetParameters

描述可为磁盘指定的客户托管磁盘加密集资源 ID 的参数。 注意: 只能为托管磁盘指定磁盘加密集资源 ID。 有关详细信息,请参阅 https://aka.ms/mdssewithcmkoverview

名称 类型 说明
id

string

资源 ID

DomainNameLabelScopeTypes

域名标签范围。根据域名标签范围和 vm 索引的策略生成的哈希域名标签的串联将是将创建的 PublicIPAddress 资源的域名标签

名称 类型 说明
NoReuse

string

ResourceGroupReuse

string

SubscriptionReuse

string

TenantReuse

string

EncryptionIdentity

指定 ADE 用于获取 keyvault 操作的访问令牌的托管标识。

名称 类型 说明
userAssignedIdentityResourceId

string

指定与 VM 关联的用户标识之一的 ARM 资源 ID。

EventGridAndResourceGraph

指定 eventGridAndResourceGraph 相关的计划事件相关配置。

名称 类型 说明
enable

boolean

指定是否为计划事件相关配置启用了事件网格和资源图。

ExtendedLocation

扩展位置的复杂类型。

名称 类型 说明
name

string

扩展位置的名称。

type

ExtendedLocationTypes

扩展位置的类型。

ExtendedLocationTypes

扩展位置的类型。

名称 类型 说明
EdgeZone

string

ImageReference

指定要使用的图像的信息。 可以指定有关平台映像、市场映像或虚拟机映像的信息。 若要使用平台映像、市场映像或虚拟机映像,但不在其他创建操作中使用,则需要此元素。 注意:只能在创建规模集时设置映像引用发布者和产品/服务。

名称 类型 说明
communityGalleryImageId

string

为 vm 部署指定社区库映像唯一 ID。 这可以从社区库映像 GET 调用中提取。

exactVersion

string

以十进制数字指定用于创建虚拟机的平台映像或市场映像的版本。 仅当“version”字段中指定的值为“latest”时,此只读字段与“version”不同。

id

string

资源 ID

offer

string

指定用于创建虚拟机的平台映像或市场映像的产品/服务。

publisher

string

映像发布者。

sharedGalleryImageId

string

为 vm 部署指定共享库映像唯一 ID。 这可以从共享库映像 GET 调用中提取。

sku

string

映像 SKU。

version

string

指定用于创建虚拟机的平台映像或市场映像的版本。 允许的格式为 Major.Minor.Build 或“latest”。 主要、次要和生成是十进制数。 指定“latest”以在部署时使用可用映像的最新版本。 即使使用“最新”,即使新版本可用,VM 映像也不会在部署后自动更新。 请不要对库映像部署使用字段“version”,库映像应始终使用“id”字段进行部署,若要使用库映像的“latest”版本,只需在“id”字段中设置“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/gallerys/{galleryName}/images/{imageName}”,而不输入版本。

InnerError

内部错误详细信息。

名称 类型 说明
errordetail

string

内部错误消息或异常转储。

exceptiontype

string

异常类型。

IPVersion

从 Api-Version 2019-07-01 开始提供,它表示特定 ipconfiguration 是 IPv4 还是 IPv6。 默认值被视为 IPv4。 可能的值为:“IPv4”和“IPv6”。

名称 类型 说明
IPv4

string

IPv6

string

KeyVaultSecretReference

描述对 Key Vault 机密的引用

名称 类型 说明
secretUrl

string

引用 Key Vault 中的机密的 URL。

sourceVault

SubResource

包含机密的 Key Vault 的相对 URL。

LinuxConfiguration

指定虚拟机上的 Linux 操作系统设置。 有关受支持的 Linux 分发版的列表,请参阅 Azure-Endorsed 分发版上的 Linux

名称 类型 说明
disablePasswordAuthentication

boolean

指定是否应禁用密码身份验证。

enableVMAgentPlatformUpdates

boolean

指示是否为 Linux 虚拟机启用了 VMAgent 平台更新。 默认值为 false。

patchSettings

LinuxPatchSettings

[预览功能]指定与 Linux 上的 VM 来宾修补相关的设置。

provisionVMAgent

boolean

指示是否应在虚拟机上预配虚拟机代理。 如果未在请求正文中指定此属性,则默认行为是将其设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。

ssh

SshConfiguration

指定 Linux OS 的 ssh 密钥配置。

LinuxPatchAssessmentMode

指定 IaaS 虚拟机的 VM 来宾修补评估模式。

可能的值包括:

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

AutomaticByPlatform - 平台将触发定期修补评估。 属性 provisionVMAgent 必须为 true。

名称 类型 说明
AutomaticByPlatform

string

ImageDefault

string

LinuxPatchSettings

指定与 Linux 上的 VM 来宾修补相关的设置。

名称 类型 说明
assessmentMode

LinuxPatchAssessmentMode

指定 IaaS 虚拟机的 VM 来宾修补评估模式。

可能的值包括:

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

AutomaticByPlatform - 平台将触发定期修补评估。 属性 provisionVMAgent 必须为 true。

automaticByPlatformSettings

LinuxVMGuestPatchAutomaticByPlatformSettings

指定 Linux 上的 VM 来宾修补中修补程序模式 AutomaticByPlatform 的其他设置。

patchMode

LinuxVMGuestPatchMode

指定 VM 来宾修补到 IaaS 虚拟机的模式,或与将 OrchestrationMode 作为灵活业务流程模式的虚拟机规模集关联的虚拟机。

可能的值包括:

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

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

LinuxVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。

名称 类型 说明
Always

string

IfRequired

string

Never

string

Unknown

string

LinuxVMGuestPatchAutomaticByPlatformSettings

指定在 Linux 修补程序设置中选择修补程序模式 AutomaticByPlatform 时要应用的其他设置。

名称 类型 说明
bypassPlatformSafetyChecksOnUserSchedule

boolean

使客户能够在不意外升级的情况下计划修补

rebootSetting

LinuxVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。

LinuxVMGuestPatchMode

指定 VM 来宾修补到 IaaS 虚拟机的模式,或与将 OrchestrationMode 作为灵活业务流程模式的虚拟机规模集关联的虚拟机。

可能的值包括:

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

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

名称 类型 说明
AutomaticByPlatform

string

ImageDefault

string

Mode

指定在启用该功能时 ProxyAgent 将执行的模式。 ProxyAgent 将开始审核或监视,但不强制对审核模式下主机终结点的请求实施访问控制,而在“强制”模式下,将强制实施访问控制。 默认值为“强制”模式。

名称 类型 说明
Audit

string

Enforce

string

NetworkApiVersion

指定使用业务流程模式“灵活”在虚拟机规模集的网络接口配置中创建网络资源时使用的 Microsoft.Network API 版本

名称 类型 说明
2020-11-01

string

NetworkInterfaceAuxiliaryMode

指定是否为网络接口资源启用辅助模式。

名称 类型 说明
AcceleratedConnections

string

Floating

string

None

string

NetworkInterfaceAuxiliarySku

指定是否为网络接口资源启用辅助 SKU。

名称 类型 说明
A1

string

A2

string

A4

string

A8

string

None

string

OperatingSystemTypes

此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 类型。 可能的值包括:Windows、Linux。

名称 类型 说明
Linux

string

Windows

string

OrchestrationMode

指定虚拟机规模集的业务流程模式。

名称 类型 说明
Flexible

string

Uniform

string

OSImageNotificationProfile

名称 类型 说明
enable

boolean

指定是启用或禁用 OS 映像计划事件。

notBeforeTimeout

string

虚拟机重新映像或升级其 OS 的时间长度将不得不在事件自动批准(超时)之前批准 OS 映像计划事件。 配置以 ISO 8601 格式指定,该值必须为 15 分钟(PT15M)

PassNames

传递名称。 目前,唯一允许的值是 OobeSystem。

名称 类型 说明
OobeSystem

string

PatchSettings

指定与 Windows 上的 VM 来宾修补相关的设置。

名称 类型 说明
assessmentMode

WindowsPatchAssessmentMode

指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值包括:

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

AutomaticByPlatform - 平台将触发定期修补评估。 属性 provisionVMAgent 必须为 true。

automaticByPlatformSettings

WindowsVMGuestPatchAutomaticByPlatformSettings

指定 Windows 上的 VM 来宾修补中修补程序模式 AutomaticByPlatform 的其他设置。

enableHotpatching

boolean

使客户无需重新启动即可修补其 Azure VM。 对于 enableHotpatching,必须将“provisionVMAgent”设置为 true,并且“patchMode”必须设置为“AutomaticByPlatform”。

patchMode

WindowsVMGuestPatchMode

指定 VM 来宾修补到 IaaS 虚拟机的模式,或与将 OrchestrationMode 作为灵活业务流程模式的虚拟机规模集关联的虚拟机。

可能的值包括:

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

AutomaticByOS - 虚拟机将由 OS 自动更新。 属性 WindowsConfiguration.enableAutomaticUpdates 必须为 true。

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

Plan

指定有关用于创建虚拟机的市场映像的信息。 此元素仅用于市场映像。 必须先启用映像以编程方式使用映像,然后才能从 API 使用市场映像。 在 Azure 门户中,找到要使用的市场映像,然后单击 想要以编程方式部署,开始使用 ->。 输入任何必需的信息,然后单击“保存

名称 类型 说明
name

string

计划 ID。

product

string

指定来自市场的映像的产品。 此值与 imageReference 元素下的 Offer 相同。

promotionCode

string

促销代码。

publisher

string

发布者 ID。

PriorityMixPolicy

指定具有灵活业务流程模式的规模集中的现成和常规优先级 VM 的目标拆分。 使用此属性,客户能够指定在达到此基本目标后,创建为 VMSS 弹性实例的常规优先级 VM 的基数和拆分。

名称 类型 说明
baseRegularPriorityCount

integer

将在横向扩展时在此规模集中创建的常规优先级 VM 的基数。

regularPriorityPercentageAboveBase

integer

达到基本常规优先级计数后,VM 实例的百分比应使用常规优先级。

ProtocolTypes

指定 WinRM 侦听器的协议。 可能的值为:http、https。

名称 类型 说明
Http

string

Https

string

ProxyAgentSettings

在创建虚拟机时指定 ProxyAgent 设置。 最低 api 版本:2024-03-01。

名称 类型 说明
enabled

boolean

指定是否应在虚拟机或虚拟机规模集上启用 ProxyAgent 功能。

keyIncarnationId

integer

增加此属性的值允许用户重置用于保护来宾和主机之间的通信通道的密钥。

mode

Mode

指定在启用该功能时 ProxyAgent 将执行的模式。 ProxyAgent 将开始审核或监视,但不强制对审核模式下主机终结点的请求实施访问控制,而在“强制”模式下,将强制实施访问控制。 默认值为“强制”模式。

PublicIPAddressSku

描述公共 IP Sku。 只能将 OrchestrationMode 设置为灵活。

名称 类型 说明
name

PublicIPAddressSkuName

指定公共 IP SKU 名称

tier

PublicIPAddressSkuTier

指定公共 IP SKU 层

PublicIPAddressSkuName

指定公共 IP SKU 名称

名称 类型 说明
Basic

string

Standard

string

PublicIPAddressSkuTier

指定公共 IP SKU 层

名称 类型 说明
Global

string

Regional

string

RepairAction

用于修复规模集中运行不正常的虚拟机的修复操作类型(替换、重启、重置映像)。 默认值将被替换。

名称 类型 说明
Reimage

string

Replace

string

Restart

string

ResiliencyPolicy

描述复原策略 - resiliencVMCreationPolicy 和/或 resiliencVMDeletionPolicy。

名称 类型 说明
resilientVMCreationPolicy

ResilientVMCreationPolicy

执行可复原 VM 创建时使用的配置参数。

resilientVMDeletionPolicy

ResilientVMDeletionPolicy

执行弹性 VM 删除时使用的配置参数。

ResilientVMCreationPolicy

执行可复原 VM 创建时使用的配置参数。

名称 类型 说明
enabled

boolean

指定是否应在虚拟机规模集上启用可复原的 VM 创建。 默认值为 false。

ResilientVMDeletionPolicy

执行弹性 VM 删除时使用的配置参数。

名称 类型 说明
enabled

boolean

指定是否应在虚拟机规模集上启用可复原的 VM 删除。 默认值为 false。

ResourceIdentityType

用于虚拟机规模集的标识类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将从虚拟机规模集中删除任何标识。

名称 类型 说明
None

string

SystemAssigned

string

SystemAssigned, UserAssigned

string

UserAssigned

string

RollingUpgradePolicy

执行滚动升级时使用的配置参数。

名称 类型 说明
enableCrossZoneUpgrade

boolean

允许 VMSS 在构造升级批处理时忽略 AZ 边界。 考虑 Update 域和 maxBatchInstancePercent 以确定批大小。

maxBatchInstancePercent

integer

一批滚动升级同时升级的总虚拟机实例的最大百分比。 由于这是一个最大值,因此以前的或将来的批中的不正常实例可能会导致批处理中的实例百分比降低,以确保更高的可靠性。 此参数的默认值为 20%。

maxSurge

boolean

创建新的虚拟机来升级规模集,而不是更新现有虚拟机。 为每个批创建新虚拟机后,将删除现有虚拟机。

maxUnhealthyInstancePercent

integer

规模集中可能同时运行不正常的虚拟机实例的最大百分比,无论是由于升级,还是虚拟机运行状况检查在滚动升级中止之前处于不正常状态。 在启动任何批处理之前,将检查此约束。 此参数的默认值为 20%。

maxUnhealthyUpgradedInstancePercent

integer

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

pauseTimeBetweenBatches

string

完成一批中所有虚拟机的更新和开始下一批之间的等待时间。 持续时间应采用 ISO 8601 格式指定。 默认值为 0 秒(PT0S)。

prioritizeUnhealthyInstances

boolean

在任何正常运行的实例之前,升级规模集中的所有不正常实例。

rollbackFailedInstancesOnPolicyBreach

boolean

如果违反滚动升级策略,回滚失败实例到以前的模型。

ScaleInPolicy

描述虚拟机规模集的横向缩减策略。

名称 类型 说明
forceDeletion

boolean

此属性允许指定在虚拟机规模集进行缩减时,是否必须强制删除选择删除的虚拟机。(预览版中的功能)

rules

VirtualMachineScaleSetScaleInRules[]

在虚拟机规模集中进行缩放时要遵循的规则。

可能的值包括:

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

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

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

ScheduledEventsAdditionalPublishingTargets

名称 类型 说明
eventGridAndResourceGraph

EventGridAndResourceGraph

创建 eventGridAndResourceGraph Scheduled 事件设置时使用的配置参数。

ScheduledEventsPolicy

指定重新部署、重新启动和 ScheduledEventsAdditionalPublishingTargets Scheduled 事件相关配置。

名称 类型 说明
scheduledEventsAdditionalPublishingTargets

ScheduledEventsAdditionalPublishingTargets

发布 scheduledEventsAdditionalPublishingTargets 时使用的配置参数。

userInitiatedReboot

UserInitiatedReboot

创建 userInitiatedReboot 计划事件设置创建时使用的配置参数。

userInitiatedRedeploy

UserInitiatedRedeploy

创建 userInitiatedRedeploy 计划事件设置创建时使用的配置参数。

ScheduledEventsProfile

名称 类型 说明
osImageNotificationProfile

OSImageNotificationProfile

指定 OS 映像计划事件相关配置。

terminateNotificationProfile

TerminateNotificationProfile

指定终止计划事件相关配置。

securityEncryptionTypes

指定托管磁盘的 EncryptionType。 它设置为 DiskWithVMGuestState,用于加密托管磁盘以及 VMGuestState blob、VMGuestStateOnly 以仅加密 VMGuestState blob,并将 NonPersistedTPM 设置为不保留 VMGuestState blob 中的固件状态。 注意: 只能为机密 VM 设置它。

名称 类型 说明
DiskWithVMGuestState

string

NonPersistedTPM

string

VMGuestStateOnly

string

SecurityPostureReference

指定要在规模集中使用的安全状况。 最低 API 版本:2023-03-01

名称 类型 说明
excludeExtensions

string[]

应用安全状况时要排除的虚拟机扩展名称列表。

id

string

/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest 形式的安全状况引用 ID

isOverridable

boolean

用户是否可以覆盖安全状况。

SecurityProfile

指定虚拟机或虚拟机规模集的安全配置文件设置。

名称 类型 说明
encryptionAtHost

boolean

用户可以在请求中使用此属性来启用或禁用虚拟机或虚拟机规模集的主机加密。 这将为所有磁盘启用加密,包括主机本身的资源/临时磁盘。 默认行为为:除非将此属性设置为 true,否则将禁用主机上的加密。

encryptionIdentity

EncryptionIdentity

指定 ADE 用于获取 keyvault 操作的访问令牌的托管标识。

proxyAgentSettings

ProxyAgentSettings

在创建虚拟机时指定 ProxyAgent 设置。 最低 api 版本:2024-03-01。

securityType

SecurityTypes

指定虚拟机的 SecurityType。 必须将其设置为任何指定值才能启用 UefiSettings。 默认行为为:除非设置了此属性,否则不会启用 UefiSettings。

uefiSettings

UefiSettings

指定在创建虚拟机时使用的安全启动和 vTPM 等安全设置。 最低 api 版本:2020-12-01。

SecurityTypes

指定虚拟机的 SecurityType。 必须将其设置为任何指定值才能启用 UefiSettings。 默认行为为:除非设置了此属性,否则不会启用 UefiSettings。

名称 类型 说明
ConfidentialVM

string

TrustedLaunch

string

ServiceArtifactReference

指定使用“latest”映像版本时,用于为规模集中的所有虚拟机设置相同映像版本的服务项目引用 ID。 最低 API 版本:2022-11-01

名称 类型 说明
id

string

以 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/gallerys/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} 的形式的服务项目引用 ID

SettingNames

指定内容应用到的设置的名称。 可能的值包括:FirstLogonCommands 和 AutoLogon。

名称 类型 说明
AutoLogon

string

FirstLogonCommands

string

Sku

描述虚拟机规模集 SKU。 注意:如果规模集当前在硬件上不支持新的 VM SKU,则需要在修改 SKU 名称之前解除分配规模集中的 VM。

名称 类型 说明
capacity

integer

指定规模集中的虚拟机数。

name

string

SKU 名称。

tier

string

指定规模集中的虚拟机层。

可能的值:

标准

基本

SpotRestorePolicy

指定虚拟机规模集的现成Try-Restore 属性。 使用此属性,客户可以根据容量可用性和定价约束,启用或禁用逐出的现成 VMSS VM 实例的自动还原。

名称 类型 说明
enabled

boolean

启用现成Try-Restore 功能,其中将尝试根据容量可用性和定价约束以机会方式还原逐出的 VMSS SPOT 实例

restoreTimeout

string

超时值表示为 ISO 8601 持续时间,之后平台不会尝试还原 VMSS SPOT 实例

SshConfiguration

Azure 上运行的基于 Linux 的 VM 的 SSH 配置

名称 类型 说明
publicKeys

SshPublicKey[]

用于通过基于 Linux 的 VM 进行身份验证的 SSH 公钥列表。

SshPublicKey

包含有关 SSH 证书公钥的信息以及放置公钥的 Linux VM 上的路径。

名称 类型 说明
keyData

string

用于通过 ssh 向 VM 进行身份验证的 SSH 公钥证书。 密钥必须至少为 2048 位且采用 ssh-rsa 格式。 有关创建 ssh 密钥,请参阅 [在 Azure 中的 Linux 和 Mac 上为 Linux VM 创建 SSH 密钥]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).

path

string

指定存储 ssh 公钥的已创建 VM 上的完整路径。 如果文件已存在,则指定的键将追加到该文件中。 示例:/home/user/.ssh/authorized_keys

StorageAccountTypes

指定托管磁盘的存储帐户类型。 注意:UltraSSD_LRS只能与数据磁盘一起使用,它不能与 OS 磁盘一起使用。

名称 类型 说明
PremiumV2_LRS

string

Premium_LRS

string

Premium_ZRS

string

StandardSSD_LRS

string

StandardSSD_ZRS

string

Standard_LRS

string

UltraSSD_LRS

string

SubResource

名称 类型 说明
id

string

资源 ID

TerminateNotificationProfile

名称 类型 说明
enable

boolean

指定是启用或禁用终止计划事件。

notBeforeTimeout

string

删除虚拟机的可配置时间长度可能需要在事件自动批准(超时)之前批准终止计划事件。 必须以 ISO 8601 格式指定配置,默认值为 5 分钟(PT5M)

UefiSettings

指定在创建虚拟机时使用的安全启动和 vTPM 等安全设置。 最低 api 版本:2020-12-01。

名称 类型 说明
secureBootEnabled

boolean

指定是否应在虚拟机上启用安全启动。 最低 api 版本:2020-12-01。

vTpmEnabled

boolean

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

UpgradeMode

指定升级到规模集中虚拟机的模式。

可能的值包括:

手动 - 控制对规模集中虚拟机的更新的应用程序。 使用 manualUpgrade 操作执行此操作。

自动 - 规模集中的所有虚拟机同时自动更新。

名称 类型 说明
Automatic

string

Manual

string

Rolling

string

UpgradePolicy

描述升级策略 - 自动、手动或滚动。

名称 类型 说明
automaticOSUpgradePolicy

AutomaticOSUpgradePolicy

用于执行自动 OS 升级的配置参数。

mode

UpgradeMode

指定升级到规模集中虚拟机的模式。

可能的值包括:

手动 - 控制对规模集中虚拟机的更新的应用程序。 使用 manualUpgrade 操作执行此操作。

自动 - 规模集中的所有虚拟机同时自动更新。

rollingUpgradePolicy

RollingUpgradePolicy

执行滚动升级时使用的配置参数。

UserAssignedIdentities

与虚拟机关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。

名称 类型 说明

UserInitiatedReboot

指定重启相关的计划事件相关配置。

名称 类型 说明
automaticallyApprove

boolean

指定重新启动计划事件相关配置。

UserInitiatedRedeploy

指定重新部署相关的计划事件相关配置。

名称 类型 说明
automaticallyApprove

boolean

指定重新部署计划事件相关配置。

VaultCertificate

介绍 Key Vault 中的单个证书引用,以及证书应驻留在 VM 上的位置。

名称 类型 说明
certificateStore

string

对于 Windows VM,指定应向其添加证书的虚拟机上的证书存储。 指定的证书存储隐式位于 LocalMachine 帐户中。 对于 Linux VM,证书文件位于 /var/lib/waagent 目录下,文件名为 X509 证书文件 <大写Thumbprint>.crt,<用于私钥的 uppercaseThumbprint>.prv。 这两个文件都是 .pem 格式的。

certificateUrl

string

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

{
“data”:“,
“dataType”:“pfx”,
“password”:“”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure Key Vault 虚拟机扩展或适用于 Windows的 Azure Key Vault 虚拟机扩展。

VaultSecretGroup

描述一组证书,这些证书都位于同一 Key Vault 中。

名称 类型 说明
sourceVault

SubResource

Key Vault 的相对 URL,其中包含 VaultCertificates 中的所有证书。

vaultCertificates

VaultCertificate[]

SourceVault 中包含证书的密钥保管库引用列表。

VirtualHardDisk

描述磁盘的 URI。

名称 类型 说明
uri

string

指定虚拟硬盘的 URI。

VirtualMachineEvictionPolicyTypes

指定 Azure 现成虚拟机和 Azure Spot 规模集的逐出策略。 对于 Azure 现成虚拟机,支持“解除分配”和“删除”,最低 API 版本为 2019-03-01。 对于 Azure Spot 规模集,支持“Deallocate”和“Delete”,最低 API 版本为 2017-10-30-preview。

名称 类型 说明
Deallocate

string

Delete

string

VirtualMachinePriorityTypes

指定规模集中虚拟机的优先级。 最低 api 版本:2017-10-30-preview。

名称 类型 说明
Low

string

Regular

string

Spot

string

VirtualMachineScaleSet

描述虚拟机规模集。

名称 类型 说明
etag

string

Etag 是在 VMSS 的 Create/Update/Get 响应中返回的属性,以便客户可以在标头中提供它,以确保乐观更新

extendedLocation

ExtendedLocation

虚拟机规模集的扩展位置。

id

string

资源 ID

identity

VirtualMachineScaleSetIdentity

虚拟机规模集的标识(如果已配置)。

location

string

资源位置

name

string

资源名称

plan

Plan

指定有关用于创建虚拟机的市场映像的信息。 此元素仅用于市场映像。 必须先启用映像以编程方式使用映像,然后才能从 API 使用市场映像。 在 Azure 门户中,找到要使用的市场映像,然后单击 想要以编程方式部署,开始使用 ->。 输入任何必需的信息,然后单击“保存

properties.additionalCapabilities

AdditionalCapabilities

指定在虚拟机规模集中的虚拟机上启用或禁用的其他功能。 例如:虚拟机是否能够支持使用 UltraSSD_LRS 存储帐户类型附加托管数据磁盘。

properties.automaticRepairsPolicy

AutomaticRepairsPolicy

自动修复的策略。

properties.constrainedMaximumCapacity

boolean

必须设置为 True 或省略的可选属性。

properties.doNotRunExtensionsOnOverprovisionedVMs

boolean

启用过度预配后,仅在请求的 VM 数量上启动扩展,这些 VM 最终会保留。 因此,此属性将确保扩展不会在额外的过度预配的 VM 上运行。

properties.hostGroup

SubResource

指定虚拟机规模集所在的专用主机组的信息。 最低 API 版本:2020-06-01。

properties.orchestrationMode

OrchestrationMode

指定虚拟机规模集的业务流程模式。

properties.overprovision

boolean

指定是否应过度预配虚拟机规模集。

properties.platformFaultDomainCount

integer

每个放置组的容错域计数。

properties.priorityMixPolicy

PriorityMixPolicy

指定用于在同一 VMSS Flex 实例中混合现成和常规优先级 VM 的所需目标。

properties.provisioningState

string

预配状态,仅出现在响应中。

properties.proximityPlacementGroup

SubResource

指定应向其分配虚拟机规模集的邻近放置组的相关信息。 最低 api 版本:2018-04-01。

properties.resiliencyPolicy

ResiliencyPolicy

复原策略

properties.scaleInPolicy

ScaleInPolicy

指定在虚拟机规模集中的虚拟机中缩放时应用的策略。

properties.scheduledEventsPolicy

ScheduledEventsPolicy

ScheduledEventsPolicy。

properties.singlePlacementGroup

boolean

如果为 true,则规模集限制为单个放置组,最大大小为 100 个虚拟机。 注意:如果 singlePlacementGroup 为 true,则可能会将其修改为 false。 但是,如果 singlePlacementGroup 为 false,则可能不会将其修改为 true。

properties.spotRestorePolicy

SpotRestorePolicy

指定虚拟机规模集的现成还原属性。

properties.timeCreated

string

指定创建虚拟机规模集资源的时间。 最低 api 版本:2021-11-01。

properties.uniqueId

string

指定唯一标识虚拟机规模集的 ID。

properties.upgradePolicy

UpgradePolicy

升级策略。

properties.virtualMachineProfile

VirtualMachineScaleSetVMProfile

虚拟机配置文件。

properties.zoneBalance

boolean

如果发生区域中断,是否强制甚至跨 x 区域进行虚拟机分发。 仅当规模集的区域属性包含多个区域时,才能设置 zoneBalance 属性。 如果没有区域或仅指定一个区域,则不应设置 zoneBalance 属性。

sku

Sku

虚拟机规模集 SKU。

tags

object

资源标记

type

string

资源类型

zones

string[]

虚拟机规模集区域。 注意:只能在创建规模集时设置可用性区域

VirtualMachineScaleSetDataDisk

描述虚拟机规模集数据磁盘。

名称 类型 说明
caching

CachingTypes

指定缓存要求。 可能的值为:None、ReadOnly、ReadWrite。 默认值为:标准存储的 None。高级存储的 ReadOnly。

createOption

DiskCreateOptionTypes

创建选项。

deleteOption

DiskDeleteOptionTypes

指定在 VMSS Flex 删除时是否应删除或分离数据磁盘(此功能仅适用于具有灵活 OrchestrationMode 的 VMSS)。

可能的值:

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

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

默认值设置为 Delete

diskIOPSReadWrite

integer

指定托管磁盘的 Read-Write IOPS。 仅当 StorageAccountType UltraSSD_LRS时才应使用。 如果未指定,则会根据 diskSizeGB 分配默认值。

diskMBpsReadWrite

integer

指定托管磁盘的带宽(以 MB/秒为单位)。 仅当 StorageAccountType UltraSSD_LRS时才应使用。 如果未指定,则会根据 diskSizeGB 分配默认值。

diskSizeGB

integer

指定空数据磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。 属性 diskSizeGB 是磁盘的字节数 x 1024^3,该值不能大于 1023。

lun

integer

指定数据磁盘的逻辑单元号。 此值用于标识 VM 中的数据磁盘,因此对于附加到 VM 的每个数据磁盘必须是唯一的。

managedDisk

VirtualMachineScaleSetManagedDiskParameters

托管磁盘参数。

name

string

磁盘名称。

writeAcceleratorEnabled

boolean

指定是应在磁盘上启用或禁用 writeAccelerator。

VirtualMachineScaleSetExtension

描述虚拟机规模集扩展。

名称 类型 说明
id

string

资源 ID

name

string

扩展的名称。

properties.autoUpgradeMinorVersion

boolean

指示扩展是否应在部署时使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。

properties.enableAutomaticUpgrade

boolean

指示如果有较新版本的扩展可用,平台是否应自动升级扩展。

properties.forceUpdateTag

string

如果提供值并且与上一个值不同,则即使扩展配置未更改,扩展处理程序也会强制更新。

properties.protectedSettings

object

该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。

properties.protectedSettingsFromKeyVault

KeyVaultSecretReference

由引用传递的扩展保护的设置,并从密钥保管库使用

properties.provisionAfterExtensions

string[]

需要预配此扩展的扩展名称的集合。

properties.provisioningState

string

预配状态,仅出现在响应中。

properties.publisher

string

扩展处理程序发布者的名称。

properties.settings

object

扩展的 Json 格式公共设置。

properties.suppressFailures

boolean

指示是否取消来自扩展的故障(不连接到 VM 等操作故障不会取消,而不管此值如何)。 默认值为 false。

properties.type

string

指定扩展的类型;例如“CustomScriptExtension”。

properties.typeHandlerVersion

string

指定脚本处理程序的版本。

type

string

资源类型

VirtualMachineScaleSetExtensionProfile

描述虚拟机规模集扩展配置文件。

名称 类型 说明
extensions

VirtualMachineScaleSetExtension[]

虚拟机规模集子扩展资源。

extensionsTimeBudget

string

指定分配所有扩展开始的时间。 持续时间应介于 15 分钟到 120 分钟(含)之间,应采用 ISO 8601 格式指定。 默认值为 90 分钟(PT1H30M)。 最低 API 版本:2020-06-01。

VirtualMachineScaleSetHardwareProfile

指定虚拟机规模集的硬件设置。

名称 类型 说明
vmSizeProperties

VMSizeProperties

指定用于自定义虚拟机大小的属性。 最低 api 版本:2021-11-01。 有关详细信息,请按照 VM 自定义 中的说明进行操作。

VirtualMachineScaleSetIdentity

虚拟机规模集的标识。

名称 类型 说明
principalId

string

虚拟机规模集标识的主体 ID。 此属性仅针对系统分配的标识提供。

tenantId

string

与虚拟机规模集关联的租户 ID。 此属性仅针对系统分配的标识提供。

type

ResourceIdentityType

用于虚拟机规模集的标识类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将从虚拟机规模集中删除任何标识。

userAssignedIdentities

UserAssignedIdentities

与虚拟机规模集关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。

VirtualMachineScaleSetIPConfiguration

介绍虚拟机规模集网络配置文件的 IP 配置。

名称 类型 说明
name

string

IP 配置名称。

properties.applicationGatewayBackendAddressPools

SubResource[]

指定对应用程序网关后端地址池的引用数组。 规模集可以引用多个应用程序网关的后端地址池。 多个规模集不能使用相同的应用程序网关。

properties.applicationSecurityGroups

SubResource[]

指定对应用程序安全组的引用数组。

properties.loadBalancerBackendAddressPools

SubResource[]

指定对负载均衡器后端地址池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的后端地址池。 多个规模集不能使用相同的基本 SKU 负载均衡器。

properties.loadBalancerInboundNatPools

SubResource[]

指定对负载均衡器的入站 Nat 池的引用数组。 规模集可以引用一个公共负载均衡器和一个内部负载均衡器的入站 NAT 池。 多个规模集不能使用相同的基本 SKU 负载均衡器。

properties.primary

boolean

指定主网络接口,以防虚拟机具有 1 个以上的网络接口。

properties.privateIPAddressVersion

IPVersion

从 Api-Version 2017-03-30 开始提供,它表示特定 ipconfiguration 是 IPv4 还是 IPv6。 默认值被视为 IPv4。 可能的值为:“IPv4”和“IPv6”。

properties.publicIPAddressConfiguration

VirtualMachineScaleSetPublicIPAddressConfiguration

publicIPAddressConfiguration。

properties.subnet

ApiEntityReference

指定子网的标识符。

VirtualMachineScaleSetIpTag

包含与公共 IP 地址关联的 IP 标记。

名称 类型 说明
ipTagType

string

IP 标记类型。 示例:FirstPartyUsage。

tag

string

与公共 IP 关联的 IP 标记。 示例:SQL、存储等。

VirtualMachineScaleSetManagedDiskParameters

描述 ScaleSet 托管磁盘的参数。

名称 类型 说明
diskEncryptionSet

DiskEncryptionSetParameters

指定托管磁盘的客户托管磁盘加密集资源 ID。

securityProfile

VMDiskSecurityProfile

指定托管磁盘的安全配置文件。

storageAccountType

StorageAccountTypes

指定托管磁盘的存储帐户类型。 注意:UltraSSD_LRS只能与数据磁盘一起使用,它不能与 OS 磁盘一起使用。

VirtualMachineScaleSetNetworkConfiguration

介绍虚拟机规模集网络配置文件的网络配置。

名称 类型 说明
name

string

网络配置名称。

properties.auxiliaryMode

NetworkInterfaceAuxiliaryMode

指定是否为网络接口资源启用辅助模式。

properties.auxiliarySku

NetworkInterfaceAuxiliarySku

指定是否为网络接口资源启用辅助 SKU。

properties.deleteOption

DeleteOptions

指定删除 VM 时网络接口发生的情况

properties.disableTcpStateTracking

boolean

指定是否为 tcp 状态跟踪禁用网络接口。

properties.dnsSettings

VirtualMachineScaleSetNetworkConfigurationDnsSettings

要应用于网络接口的 dns 设置。

properties.enableAcceleratedNetworking

boolean

指定网络接口是否已启用加速网络。

properties.enableFpga

boolean

指定网络接口是否已启用 FPGA 网络。

properties.enableIPForwarding

boolean

是否在此 NIC 上启用了 IP 转发。

properties.ipConfigurations

VirtualMachineScaleSetIPConfiguration[]

指定网络接口的 IP 配置。

properties.networkSecurityGroup

SubResource

网络安全组。

properties.primary

boolean

指定主网络接口,以防虚拟机具有 1 个以上的网络接口。

VirtualMachineScaleSetNetworkConfigurationDnsSettings

描述虚拟机规模集网络配置的 DNS 设置。

名称 类型 说明
dnsServers

string[]

DNS 服务器 IP 地址列表

VirtualMachineScaleSetNetworkProfile

描述虚拟机规模集网络配置文件。

名称 类型 说明
healthProbe

ApiEntityReference

对负载均衡器探测的引用,用于确定虚拟机规模集中实例的运行状况。 引用的格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}”。

networkApiVersion

NetworkApiVersion

指定使用业务流程模式“灵活”在虚拟机规模集的网络接口配置中创建网络资源时使用的 Microsoft.Network API 版本

networkInterfaceConfigurations

VirtualMachineScaleSetNetworkConfiguration[]

网络配置列表。

VirtualMachineScaleSetOSDisk

描述虚拟机规模集操作系统磁盘。

名称 类型 说明
caching

CachingTypes

指定缓存要求。 可能的值为:None、ReadOnly、ReadWrite。 默认值为:标准存储的 None。高级存储的 ReadOnly。

createOption

DiskCreateOptionTypes

指定应如何创建规模集中的虚拟机。 唯一允许的值是:FromImage。 使用映像创建虚拟机时使用此值。 如果使用平台映像,则还使用上述 imageReference 元素。 如果使用市场映像,则还会使用前面所述的计划元素。

deleteOption

DiskDeleteOptionTypes

指定在 VMSS Flex 删除时是否应删除或分离 OS 磁盘(此功能仅适用于具有灵活 OrchestrationMode 的 VMSS)。

可能的值:

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

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

默认值设置为 Delete。 对于临时 OS 磁盘,默认值设置为 删除。 用户无法更改临时 OS 磁盘的删除选项。

diffDiskSettings

DiffDiskSettings

指定虚拟机规模集使用的操作系统磁盘的临时磁盘设置。

diskSizeGB

integer

指定空数据磁盘的大小(以 GB 为单位)。 此元素可用于覆盖虚拟机映像中的磁盘大小。 属性“diskSizeGB”是磁盘的字节数 x 1024^3,该值不能大于 1023。

image

VirtualHardDisk

指定要基于规模集的非托管用户映像的信息。

managedDisk

VirtualMachineScaleSetManagedDiskParameters

托管磁盘参数。

name

string

磁盘名称。

osType

OperatingSystemTypes

此属性允许指定从用户映像或专用 VHD 创建 VM 时磁盘中包含的 OS 类型。 可能的值包括:Windows、Linux。

vhdContainers

string[]

指定用于存储规模集操作系统磁盘的容器 URL。

writeAcceleratorEnabled

boolean

指定是应在磁盘上启用或禁用 writeAccelerator。

VirtualMachineScaleSetOSProfile

描述虚拟机规模集 OS 配置文件。

名称 类型 说明
adminPassword

string

指定管理员帐户的密码。

最小长度(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 扩展 管理用户、SSH 并检查或修复 Azure Linux VM 上的磁盘

adminUsername

string

指定管理员帐户的名称。

仅限 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

boolean

指定是否应在虚拟机规模集上允许扩展操作。 仅当虚拟机规模集上没有扩展时,此选项才可设置为 False。

computerNamePrefix

string

指定规模集中所有虚拟机的计算机名称前缀。 计算机名称前缀长度必须为 1 到 15 个字符。

customData

string

指定自定义数据的 base-64 编码字符串。 base-64 编码字符串将解码为作为虚拟机上的文件保存的二进制数组。 二进制数组的最大长度为 65535 字节。 有关为 VM 使用 cloud-init,请参阅 使用 cloud-init 在创建期间自定义 Linux VM

linuxConfiguration

LinuxConfiguration

指定虚拟机上的 Linux 操作系统设置。 有关受支持的 Linux 分发版的列表,请参阅 Azure-Endorsed 分发版上的 Linux

requireGuestProvisionSignal

boolean

必须设置为 True 或省略的可选属性。

secrets

VaultSecretGroup[]

指定应在规模集中的虚拟机上安装的证书集。 若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure Key Vault 虚拟机扩展或适用于 Windows的 Azure Key Vault 虚拟机扩展。

windowsConfiguration

WindowsConfiguration

指定虚拟机上的 Windows 操作系统设置。

VirtualMachineScaleSetPublicIPAddressConfiguration

介绍虚拟机规模集 IP 配置的公共 IPAddress 配置

名称 类型 说明
name

string

publicIP 地址配置名称。

properties.deleteOption

DeleteOptions

指定删除 VM 时公共 IP 会发生什么情况

properties.dnsSettings

VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings

要应用于 publicIP 地址的 dns 设置。

properties.idleTimeoutInMinutes

integer

公共 IP 地址的空闲超时。

properties.ipTags

VirtualMachineScaleSetIpTag[]

与公共 IP 地址关联的 IP 标记列表。

properties.publicIPAddressVersion

IPVersion

从 Api-Version 2019-07-01 开始提供,它表示特定 ipconfiguration 是 IPv4 还是 IPv6。 默认值被视为 IPv4。 可能的值为:“IPv4”和“IPv6”。

properties.publicIPPrefix

SubResource

要从中分配 publicIP 地址的 PublicIPPrefix。

sku

PublicIPAddressSku

描述公共 IP Sku。 只能将 OrchestrationMode 设置为灵活。

VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings

描述虚拟机规模集网络配置的 DNS 设置。

名称 类型 说明
domainNameLabel

string

域名标签。域名标签和 vm 索引的串联将是将创建的 PublicIPAddress 资源的域名标签

domainNameLabelScope

DomainNameLabelScopeTypes

域名标签范围。根据域名标签范围和 vm 索引的策略生成的哈希域名标签的串联将是将创建的 PublicIPAddress 资源的域名标签

VirtualMachineScaleSetScaleInRules

在虚拟机规模集中进行缩放时要遵循的规则。

可能的值包括:

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

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

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

名称 类型 说明
Default

string

NewestVM

string

OldestVM

string

VirtualMachineScaleSetStorageProfile

描述虚拟机规模集存储配置文件。

名称 类型 说明
dataDisks

VirtualMachineScaleSetDataDisk[]

指定用于向规模集中的虚拟机添加数据磁盘的参数。 有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD

diskControllerType

DiskControllerTypes[]

指定为规模集中的虚拟机配置的磁盘控制器类型。 最低 API 版本:2022-08-01

imageReference

ImageReference

指定要使用的图像的信息。 可以指定有关平台映像、市场映像或虚拟机映像的信息。 若要使用平台映像、市场映像或虚拟机映像,但不在其他创建操作中使用,则需要此元素。

osDisk

VirtualMachineScaleSetOSDisk

指定有关规模集中虚拟机使用的操作系统磁盘的信息。 有关磁盘的详细信息,请参阅 关于 Azure 虚拟机的磁盘和 VHD

VirtualMachineScaleSetVMProfile

描述虚拟机规模集虚拟机配置文件。

名称 类型 说明
applicationProfile

ApplicationProfile

指定应提供给 VM/VMSS 的库应用程序

billingProfile

BillingProfile

指定 Azure 现成 VMSS 的计费相关详细信息。 最低 API 版本:2019-03-01。

capacityReservation

CapacityReservationProfile

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

diagnosticsProfile

DiagnosticsProfile

指定启动诊断设置状态。 最低 API 版本:2015-06-15。

evictionPolicy

VirtualMachineEvictionPolicyTypes

指定 Azure 现成虚拟机和 Azure Spot 规模集的逐出策略。 对于 Azure 现成虚拟机,支持“解除分配”和“删除”,最低 API 版本为 2019-03-01。 对于 Azure Spot 规模集,支持“Deallocate”和“Delete”,最低 API 版本为 2017-10-30-preview。

extensionProfile

VirtualMachineScaleSetExtensionProfile

指定规模集中虚拟机上安装的扩展的设置集合。

hardwareProfile

VirtualMachineScaleSetHardwareProfile

指定规模集的硬件配置文件相关详细信息。 最低 api 版本:2021-11-01。

licenseType

string

指定正在使用的映像或磁盘在本地获得许可。

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

Windows_Client

Windows_Server

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

RHEL_BYOS(适用于 RHEL)

SLES_BYOS(对于 SUSE)

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

Linux Server 的 Azure 混合使用权益

最低 API 版本:2015-06-15

networkProfile

VirtualMachineScaleSetNetworkProfile

指定规模集中虚拟机网络接口的属性。

osProfile

VirtualMachineScaleSetOSProfile

指定规模集中虚拟机的操作系统设置。

priority

VirtualMachinePriorityTypes

指定规模集中虚拟机的优先级。 最低 api 版本:2017-10-30-preview。

scheduledEventsProfile

ScheduledEventsProfile

指定与计划事件相关的配置。

securityPostureReference

SecurityPostureReference

指定要在规模集中使用的安全状况。 最低 API 版本:2023-03-01

securityProfile

SecurityProfile

指定规模集中虚拟机的安全相关配置文件设置。

serviceArtifactReference

ServiceArtifactReference

指定使用“latest”映像版本时,用于为规模集中的所有虚拟机设置相同映像版本的服务项目引用 ID。 最低 API 版本:2022-11-01

storageProfile

VirtualMachineScaleSetStorageProfile

指定虚拟机磁盘的存储设置。

timeCreated

string

指定创建虚拟机规模集的此 VM 配置文件的时间。 此属性的最低 API 版本为 2024-03-01。 在创建/更新具有最低 API 版本 2024-03-01 的 VMSS VM 配置文件时,此值将添加到 VMSS Flex VM 标记。

userData

string

规模集中虚拟机的 UserData,必须进行 base-64 编码。 客户不应在此处传递任何机密。 最低 API 版本:2021-03-01。

VMDiskSecurityProfile

指定托管磁盘的安全配置文件设置。 注意: 只能为机密 VM 设置它。

名称 类型 说明
diskEncryptionSet

DiskEncryptionSetParameters

指定用于客户托管密钥加密的 ConfidentialVM OS 磁盘和 VMGuest Blob 的托管磁盘的客户托管磁盘加密集资源 ID。

securityEncryptionType

securityEncryptionTypes

指定托管磁盘的 EncryptionType。 它设置为 DiskWithVMGuestState,用于加密托管磁盘以及 VMGuestState blob、VMGuestStateOnly 以仅加密 VMGuestState blob,并将 NonPersistedTPM 设置为不保留 VMGuestState blob 中的固件状态。 注意: 只能为机密 VM 设置它。

VMGalleryApplication

指定引用计算库应用程序版本所需的信息

名称 类型 说明
configurationReference

string

可选,指定 Azure Blob 的 URI,该 URI 将替换包的默认配置(如果提供)

enableAutomaticUpgrade

boolean

如果设置为 true,当 PIR/SIG 中提供了新的库应用程序版本时,它将自动更新 VM/VMSS

order

integer

可选,指定包必须安装的顺序

packageReferenceId

string

指定 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/gallerys/{galleryName}/applications/{application}/versions/{version} 形式的 GalleryApplicationVersion 资源 ID

tags

string

可选,指定更多泛型上下文的传递值。

treatFailureAsDeploymentFailure

boolean

可选,如果为 true,则 VmApplication 中任何操作的任何失败都会使部署失败

VMSizeProperties

指定虚拟机上的 VM 大小属性设置。

名称 类型 说明
vCPUsAvailable

integer

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

vCPUsPerCore

integer

指定 vCPU 与物理核心比率。 如果未在请求正文中指定此属性,则默认行为设置为 api 响应中公开的 vm 大小的 vCPUUsPerCore 值,列出区域中的所有可用虚拟机大小。 将此属性设置为 1 也意味着禁用了超线程处理。

WindowsConfiguration

指定虚拟机上的 Windows 操作系统设置。

名称 类型 说明
additionalUnattendContent

AdditionalUnattendContent[]

指定其他 base-64 编码的 XML 格式信息,这些信息可以包含在 Windows 安装程序使用的 Unattend.xml 文件中。

enableAutomaticUpdates

boolean

指示是否为 Windows 虚拟机启用自动更新。 默认值为 true。 对于虚拟机规模集,可以更新此属性,更新将对 OS 重新预配生效。

enableVMAgentPlatformUpdates

boolean

指示是否为 Windows 虚拟机启用了 VMAgent 平台更新。 默认值为 false。

patchSettings

PatchSettings

[预览功能]指定与 Windows 上的 VM 来宾修补相关的设置。

provisionVMAgent

boolean

指示是否应在虚拟机上预配虚拟机代理。 如果未在请求正文中指定此属性,则默认情况下此属性设置为 true。 这将确保 VM 代理安装在 VM 上,以便以后可以向 VM 添加扩展。

timeZone

string

指定虚拟机的时区。 例如“太平洋标准时间”。 可能的值可以从 TimeZoneInfo.GetSystemTimeZones返回的时区 TimeZoneInfo.Id 值。

winRM

WinRMConfiguration

指定 Windows 远程管理侦听器。 这将启用远程 Windows PowerShell。

WindowsPatchAssessmentMode

指定 IaaS 虚拟机的 VM 来宾修补程序评估模式。

可能的值包括:

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

AutomaticByPlatform - 平台将触发定期修补评估。 属性 provisionVMAgent 必须为 true。

名称 类型 说明
AutomaticByPlatform

string

ImageDefault

string

WindowsVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。

名称 类型 说明
Always

string

IfRequired

string

Never

string

Unknown

string

WindowsVMGuestPatchAutomaticByPlatformSettings

指定在 Windows 修补程序设置中选择修补程序模式 AutomaticByPlatform 时要应用的其他设置。

名称 类型 说明
bypassPlatformSafetyChecksOnUserSchedule

boolean

使客户能够在不意外升级的情况下计划修补

rebootSetting

WindowsVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修补程序安装操作的重新启动设置。

WindowsVMGuestPatchMode

指定 VM 来宾修补到 IaaS 虚拟机的模式,或与将 OrchestrationMode 作为灵活业务流程模式的虚拟机规模集关联的虚拟机。

可能的值包括:

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

AutomaticByOS - 虚拟机将由 OS 自动更新。 属性 WindowsConfiguration.enableAutomaticUpdates 必须为 true。

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

名称 类型 说明
AutomaticByOS

string

AutomaticByPlatform

string

Manual

string

WinRMConfiguration

介绍 VM 的 Windows 远程管理配置

名称 类型 说明
listeners

WinRMListener[]

Windows 远程管理侦听器列表

WinRMListener

介绍 Windows 远程管理侦听器的协议和指纹

名称 类型 说明
certificateUrl

string

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

{
“data”:“,
“dataType”:“pfx”,
“password”:“”
}
若要在虚拟机上安装证书,建议使用适用于 Linux 的 Azure Key Vault 虚拟机扩展或适用于 Windows的 Azure Key Vault 虚拟机扩展。

protocol

ProtocolTypes

指定 WinRM 侦听器的协议。 可能的值为:http、https。