2021年3月14日星期日

error when trying to create azure functions - consumption plan with terraform

I'm following the official sample:

terraform {    required_providers {      azurerm = {        source = "hashicorp/azurerm"        version = "2.51.0"      }    }  }    provider "azurerm" {    # Configuration options  }    resource "azurerm_resource_group" "example" {    name     = "azure-functions-cptest-rg"    location = "West Europe"  }    resource "azurerm_storage_account" "example" {    name                     = "functionsapptestsa"    resource_group_name      = azurerm_resource_group.example.name    location                 = azurerm_resource_group.example.location    account_tier             = "Standard"    account_replication_type = "LRS"  }    resource "azurerm_app_service_plan" "example" {    name                = "azure-functions-test-service-plan"    location            = azurerm_resource_group.example.location    resource_group_name = azurerm_resource_group.example.name    kind                = "FunctionApp"      sku {      tier = "Dynamic"      size = "Y1"    }  }    resource "azurerm_function_app" "example" {    name                       = "test-azure-functions"    location                   = azurerm_resource_group.example.location    resource_group_name        = azurerm_resource_group.example.name    app_service_plan_id        = azurerm_app_service_plan.example.id    storage_account_name       = azurerm_storage_account.example.name    storage_account_access_key = azurerm_storage_account.example.primary_access_key  }  

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/function_app#example-usage-in-a-consumption-plan

when I run terraform validate, it passes, but when I'm trying to apply it says:

An argument named "storage_account_access_key" is not expected here.

and

An argument named "storage_account_name" is not expected here.

Any clues?

https://stackoverflow.com/questions/66631158/error-when-trying-to-create-azure-functions-consumption-plan-with-terraform March 15, 2021 at 09:04AM

没有评论:

发表评论