Azure虚拟机ScaleSet上的自定义数据

Azure虚拟机ScaleSet上的自定义数据,azure,custom-data-attribute,azure-vm-scale-set,Azure,Custom Data Attribute,Azure Vm Scale Set,需要azure虚拟机scaleset(Windows)中的自定义数据来安装IIS服务器并替换默认IIS页面,以回显服务器的主机名。非常感谢您在这方面的指导,根据您的要求,我建议您在虚拟机规模集上使用Azure自定义脚本扩展 这是官方的样品。这将安装IIS web服务器并输出scale set VM实例的主机名。自定义脚本扩展定义从GitHub下载一个示例脚本,安装所需的包,然后将VM实例主机名写入基本HTML页面 $customConfig = @{ "fileUris"

需要azure虚拟机scaleset(Windows)中的自定义数据来安装IIS服务器并替换默认IIS页面,以回显服务器的主机名。非常感谢您在这方面的指导,

根据您的要求,我建议您在虚拟机规模集上使用Azure自定义脚本扩展

这是官方的样品。这将安装IIS web服务器并输出scale set VM实例的主机名。自定义脚本扩展定义从GitHub下载一个示例脚本,安装所需的包,然后将VM实例主机名写入基本HTML页面

$customConfig = @{
  "fileUris" = (,"https://raw.githubusercontent.com/Azure-Samples/compute-automation-configurations/master/automate-iis.ps1");
  "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File automate-iis.ps1"
}

# Get information about the scale set
$vmss = Get-AzVmss `
          -ResourceGroupName "myResourceGroup" `
          -VMScaleSetName "myScaleSet"

# Add the Custom Script Extension to install IIS and configure basic website
$vmss = Add-AzVmssExtension `
  -VirtualMachineScaleSet $vmss `
  -Name "customScript" `
  -Publisher "Microsoft.Compute" `
  -Type "CustomScriptExtension" `
  -TypeHandlerVersion 1.9 `
  -Setting $customConfig

# Update the scale set and apply the Custom Script Extension to the VM instances
Update-AzVmss `
  -ResourceGroupName "myResourceGroup" `
  -Name "myScaleSet" `
  -VirtualMachineScaleSet $vmss

非常感谢你。它创造了奇迹。“非常感谢你的帮助,@PawanModi很高兴听到我的回复有所帮助。你介意接受这个答案吗?SO中的其他成员也将受益于这一答案。