【问题标题】:Azure. How to deploy custom file referenced by DSC天蓝色。如何部署 DSC 引用的自定义文件
【发布时间】:2017-03-10 19:22:58
【问题描述】:

我正在构建一个 Azure RM 模板,它将在目标 VM 上安装 DSC。 DSC 必须使用 .bacpac 文件。如何将该文件上传到目标 VM?如何让它从 GitHub 由目标 VM 下载并放置在特定文件夹中? DSC 配置如下所示: https://github.com/PowerShell/xDatabase/blob/dev/Examples/Sample_xDatabase.ps1

【问题讨论】:

    标签: azure dsc


    【解决方案1】:

    类似这样的:

    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"
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2011-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多