当我尝试在底部运行代码时,我收到以下错误(无论我命名存储帐户是什么),当前其名为“functions”,但我可以称其为“bannanas”,它会输出相同的错误?
我遇到的错误:(
“发生了 1 个错误:
azurerm_storage_account.test:发生 1 个错误:
azurerm_storage_account.test:创建 Azure 存储帐户“函数”时出错:storage.AccountsClient#Create:发送请求失败:StatusCode=0 -- 原始错误:autorest/azure:服务返回错误。状态= Code="StorageAccountAlreadyTaken" Message="名为functions 的存储帐户已被占用。
我的代码:
resource "azurerm_resource_group" "test" {
name = "azure-functions-cptest-rg"
location = "westus2"
}
resource "azurerm_storage_account" "test" {
name = "functionsapptestsa"
resource_group_name = "${azurerm_resource_group.test.name}"
location = "${azurerm_resource_group.test.location}"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_app_service_plan" "test" {
name = "azure-functions-test-service-plan"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
kind = "FunctionApp"
sku {
tier = "Dynamic"
size = "Y1"
}
}
resource "azurerm_function_app" "test" {
name = "test-azure-functions"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}"
}
Run Code Online (Sandbox Code Playgroud)