azure - 使用 Terraform 分配 Synapse 角色时出错

标签 azure terraform terraform-provider-azure azure-synapse

我试图通过 Terraform 在 Synapse 中分配内置角色,但出现错误。

这就是我正在尝试做的事情:

resource "azurerm_synapse_role_assignment" "example" {
  synapse_workspace_id = azurerm_synapse_workspace.syn_ws.id
  role_name            = "Synapse Administrator"
  principal_id         = "<user_objectid>"       # alternatively data.azurerm_client_config.current.object_id

  depends_on = [azurerm_synapse_firewall_rule.example]
}

下面是生成的错误,似乎缺少授权,但创建资源组、存储、工作区等的所有其他步骤都有效。

Error: listing synapse role definitions accesscontrol.RoleDefinitionsClient#ListRoleDefinitions: Failure sending request: StatusCode=0 -- Original Error: Get "https://synapse-da-dev.dev.azuresynapse.net/roleDefinitions?api-version=2020-08-01-preview&scope=workspaces%2Fsynapse-da-dev": authenticationrequired        
│
│   with module.rg-synapse.azurerm_synapse_role_assignment.example,
│   on ..\modules\rg-synapse\main.tf line 113, in resource "azurerm_synapse_role_assignment" "example":
│  113: resource "azurerm_synapse_role_assignment" "example" {

非常感谢任何意见,非常感谢!

最佳答案

检查您的 terraform 代理是否有权访问 synapse,如果您阻止对 synapse 的所有公共(public)访问,则将 terraform 代理的 IP 添加到允许的来源。

关于azure - 使用 Terraform 分配 Synapse 角色时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70562751/

相关文章:

terraform - aws_kms_ciphertext输出能稳定吗

Terraform - 重构模块 : Error: Provider configuration not present

linux - terraform 的问题,为什么在尝试规划特定资源时双引号被忽略

azure - 是否可以使用Terraform回收azurerm_kubernetes_cluster service_principal :client_secret only

azure - 在terraform中如何根据变量将数值转换为字符串

http - 云中的 Web 应用程序作为主要公司 URL 的子文件夹

asp.net - 如何将 ASP.NET Core Web 应用程序部署到 Azure B2C 租户?

c# - Azure 函数 : Client was not authenticated to send anonymous mail during MAIL FROM [DB6P189CA0021. EURP189.PROD.OUTLOOK.COM]

azure - AKS 使用 Terraform - 等待完成时出错

asp.net-mvc-3 - 并发请求时的 ASP.NET(或 IIS?)行为