Terraform创建Synapse链接服务遇问题求助(Azure存储/SQL Server)
Terraform创建Synapse链接服务问题及示例
我是Terraform新手,正在寻找基于hashicorp/azurerm provider的Terraform示例,用于创建Synapse链接服务以连接:Azure Data Lake Storage账户、Azure SQL Server。
一、报错的ADLS链接服务代码
以下代码无法运行:
resource "azurerm_synapse_linked_service" "synapse_linked_service_datalake" { depends_on = [module.add_synapse_firewall_rule0, azurerm_storage_data_lake_gen2_filesystem.datalake_fs, data.azurerm_storage_account.datalake, module.set_role_storage] name = "linked-service-to_${data.azurerm_storage_account.datalake.name}" synapse_workspace_id = azurerm_synapse_workspace.synapse.id type = "AzureBlobFS" type_properties_json = <<JSON { "connectionString": "DefaultEndpointsProtocol=https;AccountName=${data.azurerm_storage_account.datalake.name};AccountKey=${data.azurerm_storage_account.datalake.primary_access_key};EndpointSuffix=core.windows.net" } JSON }
报错信息
2023-07-15T12:55:58.2894784Z [31m│[0m [0m "Name": "linked-service-to_XXXXXXXXX", 2023-07-15T12:55:58.2895043Z [31m│[0m [0m "Properties": { 2023-07-15T12:55:58.2895237Z [31m│[0m [0m "type": "AzureBlobFS", 2023-07-15T12:55:58.2895441Z [31m│[0m [0m "typeProperties": {} 2023-07-15T12:55:58.2895614Z [31m│[0m [0m } 2023-07-15T12:55:58.2895910Z [31m│[0m [0m} and error is Invalid linked service payload, the 'typeProperties' nested in payload is提示:无效的链接服务负载,payload中的'typeProperties'为空。
二、参考的Cosmos DB链接服务示例
网上找到以下示例,需修改以适配Azure存储账户:
resource "azurerm_synapse_linked_service" "cosmos" { name = "synsv-powerbi-uksouth" synapse_workspace_id = azurerm_synapse_workspace.synapse.id type = "Azure Cosmos DB (SQL API)" type_properties_json = <<JSON { "connectionString": "${azurerm_cosmosdb_account.cosmos.connection_strings[0]}Database=${azurerm_cosmosdb_sql_database.cosmos.name}" } JSON depends_on = [ azurerm_synapse_firewall_rule.synapse ] }
三、执行成功但Synapse Studio不可见的代码
以下代码Terraform日志显示执行成功,但在Azure Synapse Studio中看不到新建的Synapse链接服务:
resource "azurerm_synapse_linked_service" "synapse_linked_service_datalake" { depends_on = [module.add_synapse_firewall_rule0, azurerm_storage_data_lake_gen2_filesystem.datalake_fs, data.azurerm_storage_account.datalake, module.set_role_storage] name = "linked-service-to_${data.azurerm_storage_account.datalake.name}" synapse_workspace_id = azurerm_synapse_workspace.synapse.id type = "AzureBlobStorage" type_properties_json = <<JSON { "connectionString": "DefaultEndpointsProtocol=https;AccountName=${data.azurerm_storage_account.datalake.name};AccountKey=${data.azurerm_storage_account.datalake.primary_access_key};EndpointSuffix=core.windows.net" } JSON /* integration_runtime { name = azurerm_synapse_integration_runtime_azure.synapse_integration_runtime.name } */ }
内容的提问来源于stack exchange,提问作者Ian Carrick
相关产品推荐
相关产品推荐

