【发布时间】:2020-12-23 16:38:29
【问题描述】:
我一直在寻找一种使用 azure DSC 将文件从 azure 存储复制到 vm 的方法,但没有找到任何解决方案
每次我运行 dsc 时都会收到如下错误消息 “PowerShell DSC 资源 MSFT_xRemoteFile 无法执行 Set-TargetResource 功能并显示错误消息:调用 Web 请求失败并出现错误。远程服务器返回错误:(403) Forbidden。” 使用自动化帐户我已经添加了 azure 自动化 ok ,不知道什么是禁止的??我已经生成了一个 SAS 令牌并复制了下面的 URI,所以不确定我还需要做什么???
dsc如下
configuration dscfiletest
{
Import-DscResource -ModuleName xPSDesiredStateConfiguration
Node localhost
{
File SetupDir {
Type = 'Directory'
DestinationPath = 'C:\dsctest'
Ensure = "Present"
}
xRemoteFile Package {
Uri = "https://dscfiles.blob.core.windows.net/dsctesting/dsctesting.zip?sastokenhere"
DestinationPath = "C:\dsctest"
#DependsOn = "[File]SetupDir"
MatchSource = $false
}
}
}
【问题讨论】:
标签: azure automation dsc