【发布时间】:2021-02-19 03:11:03
【问题描述】:
如果我通过门户手动创建 Azure 函数,则会创建应用密钥:
如果我通过 terraform 尝试相同的方法:
函数应用
resource "azurerm_function_app" "resize_images" {
name = format("%s%s%s%s", module.subscription_prefix.prefix, "pfunctionapp", lower(local.environment), "0001")
location = azurerm_resource_group.azure_functions.location
resource_group_name = azurerm_resource_group.azure_functions.name
app_service_plan_id = module.app_service_plan.id
# AzureRM 1.x needs this
#storage_connection_string = local.azure_functions_storage_account_primary_connection_string
# AzureRM 2.x needs this
storage_account_name = data.azurerm_storage_account.resize_storage.name
storage_account_access_key = data.azurerm_storage_account.resize_storage.primary_access_key
app_settings = {
AzureWebJobsDashboard = data.azurerm_storage_account.resize_storage.primary_connection_string
AzureWebJobsStorage = data.azurerm_storage_account.resize_storage.primary_connection_string
BLOB_STORAGE_CONNECTION_STRING = data.azurerm_storage_account.resize_storage.primary_connection_string
CONTAINER_NAME = "images"
FUNCTIONS_EXTENSION_VERSION = "~3"
WEBSITE_HTTPLOGGING_RETENTION_DAYS = "3"
WEBSITE_RUN_FROM_PACKAGE = "1"
}
version = "~3"
tags = local.tags
}
在Terraform documentation 中没有如何创建这些密钥,但您可以将它们读为data。
谁能指出正确的方向是如何创建键的?!
【问题讨论】:
标签: function terraform terraform-provider-azure