gpt4 book ai didi

azure - 如何使用 VSTS DSC 配置自动将软件安装到 Azure VM 上

转载 作者:行者123 更新时间:2023-12-03 01:04:58 24 4
gpt4 key购买 nike

全部,

我正在尝试弄清楚如何使用 VSTS DSC 配置将专门的 TrendMicro 软件安装到 Azure VM 上。我所需要的只是指出如何实现这一目标或建议的正确方向。我在这方面的经验很少,因此我们将不胜感激任何帮助。

谢谢

最佳答案

通过PowerShell DSC将软件安装到Azure VM,可以引用文档D eploy your application on virtual machine scale sets .

例如Install an app to a Windows VM with PowerShell DSC ,示例 powershell 脚本为:

# Define the script for your Desired Configuration to download and run
$dscConfig = @{
"wmfVersion" = "latest";
"configuration" = @{
"url" = "https://github.com/Azure-Samples/compute-automation-configurations/raw/master/dsc.zip";
"script" = "configure-http.ps1";
"function" = "WebsiteTest";
};
}

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

# Add the Desired State Configuration extension to install IIS and configure basic website
$vmss = Add-AzureRmVmssExtension `
-VirtualMachineScaleSet $vmss `
-Publisher Microsoft.Powershell `
-Type DSC `
-TypeHandlerVersion 2.24 `
-Name "DSC" `
-Setting $dscConfig

# Update the scale set and apply the Desired State Configuration extension to the VM instances
Update-AzureRmVmss `
-ResourceGroupName "myResourceGroup" `
-Name "myScaleSet" `
-VirtualMachineScaleSet $vmss

关于azure - 如何使用 VSTS DSC 配置自动将软件安装到 Azure VM 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51290434/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com