gpt4 book ai didi

azure - Bicep 使用 URI 发布 Runbook

转载 作者:行者123 更新时间:2023-12-03 06:38:36 25 4
gpt4 key购买 nike

我正在使用 Bicep 创建自动化帐户、Blob 存储、将文件上传到 Blob,然后在我的自动化帐户中创建 Runbook。这是第一次工作,但如果我更新进入我的 blob 的文件,这不会反射(reflect)在我的 Runbook 中。

这是我的 Runbook 部署的副本 - 发布链接 URI 是否可能被缓存并且不会“重新获取”脚本内容?

resource symbolicname 'Microsoft.Automation/automationAccounts/runbooks@2022-08-08' = {
name: 'Schedule Summary Table Rebuild'
location: automationAccount.location
tags: _tags
dependsOn: [deploymentScript]
parent: automationAcc
properties: {
description: 'Automation to recreate summary tables.'
logActivityTrace: 0
logProgress: true
logVerbose: true
runbookType: 'PowerShell7'
publishContentLink: {
uri:'https://storageacc.blob.core.windows.net/data/ExecuteSQL.txt'
version:'1.0.0.0'
}

}

}```

最佳答案

当您重新部署模板时,没有任何变化,因此我猜测 ARM API 甚至不会尝试将部署重新提交给资源提供程序。

您可以添加一个参数来尝试强制更新:

param forceUpdate string = newGuid()
...

resource symbolicname 'Microsoft.Automation/automationAccounts/runbooks@2022-08-08' = {
name: 'Schedule Summary Table Rebuild'
location: automationAccount.location
tags: _tags
dependsOn: [ deploymentScript ]
parent: automationAcc
properties: {
description: 'Automation to recreate summary tables.'
logActivityTrace: 0
logProgress: true
logVerbose: true
runbookType: 'PowerShell7'
publishContentLink: {
uri: 'https://storageacc.blob.core.windows.net/data/ExecuteSQL.txt?forceUpdate=${forceUpdate}'
version: '1.0.0.0'
}
}
}
...

关于azure - Bicep 使用 URI 发布 Runbook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74671632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com