【发布时间】:2018-07-11 16:35:44
【问题描述】:
全部,
我试图弄清楚如何使用 VSTS DSC 配置将软件专门安装到 Azure VM 上。我所需要的只是指出如何完成此任务或提出建议的正确方向。我在这方面的经验很少,因此我们将不胜感激。
谢谢
【问题讨论】:
-
使用 Trendmicro 扩展
标签: azure automation installation azure-devops dsc
全部,
我试图弄清楚如何使用 VSTS DSC 配置将软件专门安装到 Azure VM 上。我所需要的只是指出如何完成此任务或提出建议的正确方向。我在这方面的经验很少,因此我们将不胜感激。
谢谢
【问题讨论】:
标签: azure automation installation azure-devops dsc
要通过 PowerShell DSC 将软件安装到 Azure VM,您可以参考文档 Deploy 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
【讨论】: