关于azure:Terraform azurerm_data_factory vsts_configuration失败,并显示错误:为Data Factory配置存储库时出错

Terraform azurerm_data_factory vsts_configuration failing with Error: Error configuring Repository for Data Factory

我正在尝试使用Terraform部署在Azure数据工厂中建立代码存储库,并通过Azure Cloud Shell进行具有贡献者访问权限,遵循以下步骤:https://www.terraform.io/docs/providers/azurerm/r/data_factory。 html#vsts_configuration

我收到错误消息:

Error: Error configuring Repository for Data Factory"adf-name"
(Resource Group"rg-name"):
datafactory.FactoriesClient#ConfigureFactoryRepo: Failure responding
to request: StatusCode=403 -- Original Error: autorest/azure: Service
returned an error. Status=403 Code="AuthorizationFailed" Message="The
client '[email protected]' with object id 'xxxxx' does not have
authorization to perform action
'Microsoft.DataFactory/locations/configureFactoryRepo/action' over
scope '/subscriptions/xxxxxx' or the scope is invalid. If access was recently granted,
please refresh your credentials.

我对客户端,对象ID和范围不敏感。

我能够在门户中设置代码存储库,但是当我尝试在Azure Cloud Shell中运行terraform时失败。有没有人以前见过此错误消息或知道如何解决该错误消息?

代码将其剪切:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
`provider"azurerm" {
  version ="=2.3.0"
  features {}
}
resource"azurerm_data_factory""example" {
  name                = var.adf_name
  location            = var.location
  resource_group_name = var.rg_name
  vsts_configuration {
    account_name      = var.account_name
    branch_name       = var.branch_name
    project_name      = var.project_name
    repository_name   = var.repo_name
    root_folder       = var.root_folder
    tenant_id         = var.tenant_id
  }
}`


必须为操作添加自定义角色吗? Microsoft.DataFactory / locations / configureFactoryRepo / actiona?并分配给服务主体。贡献者角色本身不足以使用Terraform azurerm设置Azure Data Factory的代码存储库。