[英]Azure. How to deploy custom file referenced by DSC
我正在构建一个Azure RM模板,它将在目标VM上安装DSC。 DSC必须使用.bacpac文件。 如何将该文件上传到目标VM? 如何使目标VM从GitHub下载并放置在特定文件夹中? DSC配置如下所示: https : //github.com/PowerShell/xDatabase/blob/dev/Examples/Sample_xDatabase.ps1
像这样:
Import-DscResource -ModuleName PSDesiredStateConfiguration,xPSDesiredStateConfiguration,xDatabase
Node $nodeName
{
LocalConfigurationManager
{
RebootNodeIfNeeded = $true
}
xRemoteFile BacPacPackage
{
Uri = "https://github.com/url_to_your_bacpac"
DestinationPath = "c:\where_to_put_it"
MatchSource = $false
}
xDatabase DeployBacPac
{
Ensure = "Present"
SqlServer = $nodeName
SqlServerVersion = $SqlServerVersion
DatabaseName = $DatabaseName
Credentials = $credential # credentials to access SQL
BacPacPath = "c:\path_from_previous command"
DependsOn = "[xRemoteFile]BacPacPackage"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.