我有一个简单的管道,它按照微软的建议将我的DataFactory代码从一个通道迁移到另一个通道。这是:
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: '{connectionName}'
subscriptionId: '{subscriptionId}'
action: 'Create Or Update Resource Group'
resourceGroupName: 'default-rg'
location: 'East US'
templateLocation: 'URL of the file'
csmFileLink: 'https://raw.githubusercontent.com/{OrgName}/{RepoName}/adf_publish/{folder}/ARMTemplateForFactory.json?token=GHSAT0AAAAAA*************************'
csmParametersFileLink: 'https://raw.githubusercontent.com/{OrgName}/{RepoName}/adf_publish/{folder}/ARMTemplateParametersForFactory.json?token=GHSAT0AAAAAA*************************'
overrideParameters: '-factoryName "{new factory name}"'
deploymentMode: 'Incremental'
这个代码成功了,但在第10行我必须指定";文件的URL";在第12行和第13行中,我提供了包含允许访问的令牌参数的原始url。相反,我想链接我的GitHub回购并指向那里的文件。我不知道怎么做。有人能帮忙吗?
这就是我目前所处的位置。我添加了1-7以引用文件所在的GitHub repo。它们存在于";adf_publish"树枝第18行我改为";链接工件";。第19行和第20行是我想引用文件的地方,但不确定语法应该是什么
resources:
repositories:
- repository: {RepoName}
type: github
name: {OrgName}/{RepoName}
endpoint: {ServiceConnectionName}
ref: adf_publish
steps:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: '{ConnectionName}'
subscriptionId: '{subscriptionId}'
action: 'Create Or Update Resource Group'
resourceGroupName: 'default-rg'
location: 'East US'
templateLocation: 'Linked artifact'
csmFile: '??'
csmParametersFile: '??'
overrideParameters: '-factoryName "{new factory name}"'
deploymentMode: 'Incremental'
我使用以下代码开始工作:
resources:
repositories:
- repository: adf_publish
type: github
name: {OrgName}/{RepoName}
endpoint: {ServiceConnectionName}
ref: adf_publish
steps:
- checkout: self
path: main
- checkout: adf_publish
path: adf
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: {ConnectionName}
subscriptionId: '{subscriptionId}'
action: 'Create Or Update Resource Group'
resourceGroupName: 'default-rg'
location: 'East US'
templateLocation: 'Linked artifact'
csmFile: '$(Agent.BuildDirectory)/adf/{data factory name}/ARMTemplateForFactory.json'
csmParametersFile: '$(Agent.BuildDirectory)/adf/{data factory name}/ARMTemplateParametersForFactory.json'
overrideParameters: '-factoryName "{new factory name}"'
deploymentMode: 'Incremental'