You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Terraform部署Azure Synapse Workspace遇azuread_authentication_only参数报错

Terraform部署Azure Synapse Workspace时azuread_authentication_only参数报错的解决方法
  • 确认参数的正确嵌套位置
    这个参数并非直接属于azurerm_synapse_workspace资源的顶层参数,而是必须嵌套在security_settings块内。很多人会误将其放在顶层,导致"参数不被期望"的报错。正确的代码结构示例:

    resource "azurerm_synapse_workspace" "example" {
      name                                 = "example-synapse-workspace"
      resource_group_name                  = azurerm_resource_group.example.name
      location                             = azurerm_resource_group.example.location
      storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.example.id
      sql_administrator_login              = "sqladminuser"
      sql_administrator_login_password     = "H@shPass123"
    
      security_settings {
        azuread_authentication_only = true
      }
    
      # 其他必要配置参数...
    }
    
  • 强制刷新Provider缓存
    即便已经升级到3.96.0版本,本地可能仍留存旧版本的缓存。执行以下命令清理缓存并重新初始化,确保加载指定的新版本:

    terraform init -upgrade -reconfigure
    
  • 明确指定Provider版本
    检查terraform块中的required_providers配置,确保明确指定azurerm 3.96.0版本,避免版本范围约束导致拉取旧版本:

    terraform {
      required_providers {
        azurerm = {
          source  = "hashicorp/azurerm"
          version = "3.96.0"
        }
      }
    }
    
  • 验证版本兼容性
    azuread_authentication_only参数是在azurerm Provider v3.74.0版本新增的,3.96.0版本完全支持,但必须严格遵循嵌套在security_settings内的要求。

内容的提问来源于stack exchange,提问作者Xyltic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 11:17:41