Runbook中的Azure DSC配置

时间:2015-06-15 12:00:05

标签: powershell azure dsc azure-automation

我的Azure自动化帐户上有以下Workflow脚本作为Runbook:

workflow Configure-VM
{
    $DSCConfigPath = "C:\DSCConfigs\TestConfiguration"
    inlinescript
    {
        Import-Module PSDesiredStateConfiguration
        Configuration TestConfiguration
        {
            Node "ak-testvm-001" {
                WindowsFeature IIS {
                    Ensure = "Present"
                    Name = "Web-Server"
                }
            }
        }

        Write-Output "INFO: Creating the DSC Configuration"
        TestConfiguration -NodeName "ak-testvm-001" -OutputPath $Using:DSCConfigPath

        Write-Output "INFO: Deploying DSC Configuration"
        Start-DscConfiguration -Path $Using:DSCConfigPath -Force -Wait -Verbose
        Write-Output "INFO: DSC Configuration Finished"

        Write-Output "INFO: END OF RUNBOOK"
    }
}

运行此RunBook时出现以下错误:

Import-Module: The specified module 'PSDesiredStateConfiguration' was not loaded because it was not found in any module directory.

如何从Azure Runbook运行DSC配置?它是否可能,或者我是否绝对需要使用Windows PowerShell?

1 个答案:

答案 0 :(得分:0)

PowerShell所需的状态配置支持已在5月份的有限预览中添加到Azure自动化。您可以阅读有关如何使用Azure自动化here管理DSC节点的更多信息。