小编Sou*_*jan的帖子

在 Terraform 中为 Azure 存储帐户创建事件订阅

我正在尝试使用TerraformTerraform provider for Azure在 Azure 中创建以下资源。

  • 为 Blob 存储创建存储帐户。
  • 创建将引发 Blob 活动事件的事件订阅。

运行 terraform 脚本时出现以下错误

错误:创建/更新 EventGrid 事件订阅“evtFileReceived”时出错(范围“/subscriptions/c17cf5ee-d3d7-4f64-b863-f2a4d6948594/resourceGroups/dominos-doodle”):eventgrid.EventSubscriptionsClient#CreateOrUpdate:发送请求失败:StatusCode=400 - - 原始错误:代码 =“InvalidRequest”消息 =“指定的主题属性与事件订阅范围中的预期主题不匹配。”

我该如何解决它?谷歌搜索没有给出任何结果。

生成错误的脚本如下。引发错误的步骤是terraform apply

显然,一种方法是使用 ARM 模板来实现此目的,但我正在尝试查看是否可以使用本机 Terraform 脚本创建它。我参考了Terraform Docs并创建了以下内容。

variable "inp_resource_group_name" { }
variable "inp_geo_location" { }
variable "inp_account_name" { }
variable "inp_az_subscription_id" { }
variable "inp_resource_group_id" { }

resource "azurerm_storage_account" "cave" {
  name                     = var.inp_account_name
  resource_group_name      = var.inp_resource_group_name
  location                 = var.inp_geo_location
  account_tier             = "Standard"
  account_replication_type = "LRS"
  account_kind             = "StorageV2" …
Run Code Online (Sandbox Code Playgroud)

azure terraform terraform-provider-azure

4
推荐指数
1
解决办法
3561
查看次数