【问题标题】:How to automate installation of software onto Azure VMs using VSTS DSC configurations如何使用 VSTS DSC 配置自动将软件安装到 Azure VM
【发布时间】:2018-07-11 16:35:44
【问题描述】:

全部,

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

谢谢

【问题讨论】:

  • 使用 Trendmicro 扩展

标签: azure automation installation azure-devops dsc


【解决方案1】:

要通过 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

【讨论】:

    猜你喜欢
    • 2020-09-01
    • 1970-01-01
    • 2017-09-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-21
    • 2021-01-11
    • 2018-10-24
    • 1970-01-01
    相关资源
    最近更新 更多