我有我的应用服务:
resource "azurerm_app_service" "appservice" {
name = name",
location = "${var.location}",
resource_group_name = "${azurerm_resource_group.resourcegroup.name}",
app_service_plan_id = "${azurerm_app_service_plan.appserviceplan.id}"
app_settings{
...
}
site_config {
dotnet_framework_version = "v4.0"
scm_type = "LocalGit"
}
}
然后我尝试将site_credential.username添加为key_vault_secret
resource "azurerm_key_vault_secret" "key_vault_secret_publish_profile_username" {
name = "username"
value = "${azurerm_app_service.appservice.site_credential.username}"
vault_uri = "${azurerm_key_vault.keyvault.vault_uri}"
}
地形计划还可以,当我尝试“ terraform apply”时,它将返回以下错误:
发生1个错误:
Terraform文档规定scm_type必须设置为“ LocalGit” => https://www.terraform.io/docs/providers/azurerm/r/app_service.html
答案 0 :(得分:0)
尝试一下:
resource "azurerm_key_vault_secret" "key_vault_secret_publish_profile_username" {
name = "username"
value = "${azurerm_app_service.appservice.site_credential.0.username}"
vault_uri = "${azurerm_key_vault.keyvault.vault_uri}"
}