在使用DSC扩展在Azure门户中validation新VM时, value for the template parameter 'modulesUrl' at line '11' and column '20' is not provided的原因value for the template parameter 'modulesUrl' at line '11' and column '20' is not provided任何提示。 知道一些潜在的模板有错误是没有帮助的。
DSCconfiguration剥离到最低testing版本是
configuration WebServer { Node localhost { WindowsFeature IIS { Ensure = 'Present' Name = 'Web-Server' } WindowsFeature DotNet { Ensure = 'Present' Name = 'Web-Asp-Net45' DependsOn = '[WindowsFeature]IIS' } File Namer { DependsOn = '[WindowsFeature]DotNet' DestinationPath = 'C:\InetPub\wwwroot\name.aspx' Type = 'File' Contents = '<h1>My Name is: <%=Environment.MachineName %></h1><hr />' } } }
我以为愚蠢的aspx线可能会令人困扰,但即使我用“马”replace,它仍然会抛出这个错误。 我使用dsc.ps1\WebServer作为模块限定的名称,并尝试了Publish-AzureRMVMDscConfiguration -OutputArchivePath和普通的ps1文件中的zip。 尝试版本2.15,2.21(根据文件中的一个例子 – 它不清楚这是指Dsc版本)。 这是在西欧地区,创build一个DSv2 Windows Server 2016核心图像。
更新 :该DSC脚本在本地Hyper-V 2016核心虚拟机上工作,并正确部署name.aspx所以我不认为问题在那里。
我刚在Azure中运行一个类似的脚本,它的工作原理是:
我认为问题在于使用Publish-AzureRMVMDscConfiguration CMDLet时部署的DSC扩展版本。
我使用自动化帐户刀片导入configuration,编译configuration,然后注册我的虚拟机。 如果需要,我可以在明天发布更多细节。