Terraform在Azure上创建订阅问题

huangapple go评论61阅读模式
英文:

Terraform Azure subscription create issue

问题

Terraform版本

1.5.1

Terraform配置文件

  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
    }
  }
}

# 配置Microsoft Azure提供程序
provider "azurerm" {
  features {}
}

data "azurerm_billing_enrollment_account_scope" "example" {
  billing_account_name    = "account holder name"
  enrollment_account_name = "NOYX-xxx-xxxx"
}

resource "azurerm_subscription" "example" {
  subscription_name = "My Example EA Subscription"
  billing_scope_id  = data.azurerm_billing_enrollment_account_scope.example.id
}

调试输出

2023-06-26T10:37:41.381+0530 [DEBUG] provider.terraform-provider-azurerm_v3.62.1_x5.exe: AzureRM请求:
GET /subscriptions/45bd2bdb-be9a-4e7c-9358-944ba5a90060/providers/Microsoft.EventHub?api-version=2022-09-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.20.5 (amd64-windows) go-autorest/v14.2.1 hashicorp/go-azure-sdk/providers/2022-09-01 HashiCorp Terraform/1.5.1 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/3.62.1 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 7367ad54-9cd7-1084-a740-4fd2e6d3e649
Accept-Encoding: gzip: timestamp=2023-06-26T10:37:41.381+0530
2023-06-26T10:37:41.426+0530 [DEBUG] provider.terraform-provider-azurerm_v3.62.1_x5.exe: AzureRM响应https://management.azure.com/subscriptions/45bd2bdb-be9a-4e7c-9358-944ba5a90060/providers/Microsoft.EventHub?api-version=2022-09-01:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Mon, 26 Jun 2023 05:07:40 GMT
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 7367ad54-9cd7-1084-a740-4fd2e6d3e649
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11997
X-Ms-Request-Id: b729746a-4630-4299-b489-58f02562c41c
X-Ms-Routing-Request-Id: WESTINDIA:20230626T050741Z:b729746a-4630-4299-b489-58f02562c41c

{"id":"/subscriptions/45bd2bdb-be9a-4e7c-9358-944ba5a90060/providers/Microsoft.EventHub","namespace":"Microsoft.EventHub","authorizations":[{"applicationId":"80369ed6-5f11-4dd9-bef3-692475845e77","roleDefinitionId":"eb8e1991-5de0-42a6-a64b-29b059341b7b"},{"applicationId":"6201d19e-14fb-4472-a2d6-5634a5c97568"}],"resourceTypes":[{"resourceType":"namespaces","locations":["Australia Central","Australia East","Australia Southeast","Brazil South","Canada Central","Canada East","Central India","Central US","East Asia","East US","East US 2","France Central","Germany West Central","Japan East","Japan West","Korea Central","Korea South","North Central US","North Europe","Norway East","Poland Central","Qatar Central","South Africa North","South Central US","Southeast Asia","South India","Sweden Central","Switzerland North","UAE North","UK South","UK West","West Central US","West Europe","West India","West US","West US 2","West US 3"],"apiVersions":["2023-01-01-preview","2022-10-01-preview","2022-01-01-preview","2021-11-01","2021-06-01-preview","2021-01-01-preview","2018-01

<details>
<summary>英文:</summary>

### Terraform Version

```shell
1.5.1

Terraform Configuration Files

  required_providers {
    azurerm = {
      source  = &quot;hashicorp/azurerm&quot;
    }
  }
}

# Configure the Microsoft Azure Provider
provider &quot;azurerm&quot; {
  features {}
}


data &quot;azurerm_billing_enrollment_account_scope&quot; &quot;example&quot; {
  billing_account_name    = &quot;account holder name&quot;
  enrollment_account_name = &quot;NOYX-xxx-xxxx&quot;
}

resource &quot;azurerm_subscription&quot; &quot;example&quot; {
  subscription_name = &quot;My Example EA Subscription&quot;
  billing_scope_id  = data.azurerm_billing_enrollment_account_scope.example.id
}

Debug Output

2023-06-26T10:37:41.381+0530 [DEBUG] provider.terraform-provider-azurerm_v3.62.1_x5.exe: AzureRM Request: 
GET /subscriptions/45bd2bdb-be9a-4e7c-9358-944ba5a90060/providers/Microsoft.EventHub?api-version=2022-09-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.20.5 (amd64-windows) go-autorest/v14.2.1 hashicorp/go-azure-sdk/providers/2022-09-01 HashiCorp Terraform/1.5.1 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/3.62.1 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 7367ad54-9cd7-1084-a740-4fd2e6d3e649
Accept-Encoding: gzip: timestamp=2023-06-26T10:37:41.381+0530
2023-06-26T10:37:41.426+0530 [DEBUG] provider.terraform-provider-azurerm_v3.62.1_x5.exe: AzureRM Response for https://management.azure.com/subscriptions/45bd2bdb-be9a-4e7c-9358-944ba5a90060/providers/Microsoft.EventHub?api-version=2022-09-01: 
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Mon, 26 Jun 2023 05:07:40 GMT
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 7367ad54-9cd7-1084-a740-4fd2e6d3e649
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11997
X-Ms-Request-Id: b729746a-4630-4299-b489-58f02562c41c
X-Ms-Routing-Request-Id: WESTINDIA:20230626T050741Z:b729746a-4630-4299-b489-58f02562c41c
{&quot;id&quot;:&quot;/subscriptions/45bd2bdb-be9a-4e7c-9358-944ba5a90060/providers/Microsoft.EventHub&quot;,&quot;namespace&quot;:&quot;Microsoft.EventHub&quot;,&quot;authorizations&quot;:[{&quot;applicationId&quot;:&quot;80369ed6-5f11-4dd9-bef3-692475845e77&quot;,&quot;roleDefinitionId&quot;:&quot;eb8e1991-5de0-42a6-a64b-29b059341b7b&quot;},{&quot;applicationId&quot;:&quot;6201d19e-14fb-4472-a2d6-5634a5c97568&quot;}],&quot;resourceTypes&quot;:[{&quot;resourceType&quot;:&quot;namespaces&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;South India&quot;,&quot;Southeast Asia&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;,&quot;2015-08-01&quot;,&quot;2014-09-01&quot;],&quot;defaultApiVersion&quot;:&quot;2017-04-01&quot;,&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation&quot;},{&quot;resourceType&quot;:&quot;clusters&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2018-01-01-preview&quot;],&quot;capabilities&quot;:&quot;CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation&quot;},{&quot;resourceType&quot;:&quot;namespaces/authorizationrules&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Brazil Southeast&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/networkrulesets&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/privateEndpointConnections&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/privateEndpointConnectionProxies&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/networkSecurityPerimeterConfigurations&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/networkSecurityPerimeterAssociationProxies&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/eventhubs&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Brazil Southeast&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/eventhubs/authorizationrules&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Brazil Southeast&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/eventhubs/consumergroups&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Brazil Southeast&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/applicationGroups&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;checkNamespaceAvailability&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2015-08-01&quot;,&quot;2014-09-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2015-08-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;checkNameAvailability&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;,&quot;2015-08-01&quot;,&quot;2014-09-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;sku&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2017-04-01&quot;,&quot;2015-08-01&quot;,&quot;2014-09-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;operations&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;,&quot;2015-08-01&quot;,&quot;2014-09-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/disasterrecoveryconfigs&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;namespaces/disasterrecoveryconfigs/checkNameAvailability&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;locations&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;locations/operationStatus&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;locations/clusterOperationResults&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;locations/namespaceOperationResults&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;locations/notifyNetworkSecurityPerimeterUpdatesAvailable&quot;,&quot;locations&quot;:[&quot;East US&quot;,&quot;East US 2&quot;,&quot;South Central US&quot;,&quot;Australia Central&quot;,&quot;Australia Central 2&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Brazil SouthEast&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;Central US EUAP&quot;,&quot;East Asia&quot;,&quot;East US 2 EUAP&quot;,&quot;France Central&quot;,&quot;France South&quot;,&quot;Germany North&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Norway West&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Africa West&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;Switzerland West&quot;,&quot;UAE Central&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;locations/deleteVirtualNetworkOrSubnets&quot;,&quot;locations&quot;:[&quot;Australia Central&quot;,&quot;Australia East&quot;,&quot;Australia Southeast&quot;,&quot;Brazil South&quot;,&quot;Canada Central&quot;,&quot;Canada East&quot;,&quot;Central India&quot;,&quot;Central US&quot;,&quot;East Asia&quot;,&quot;East US&quot;,&quot;East US 2&quot;,&quot;France Central&quot;,&quot;Germany West Central&quot;,&quot;Japan East&quot;,&quot;Japan West&quot;,&quot;Korea Central&quot;,&quot;Korea South&quot;,&quot;North Central US&quot;,&quot;North Europe&quot;,&quot;Norway East&quot;,&quot;Poland Central&quot;,&quot;Qatar Central&quot;,&quot;South Africa North&quot;,&quot;South Central US&quot;,&quot;Southeast Asia&quot;,&quot;South India&quot;,&quot;Sweden Central&quot;,&quot;Switzerland North&quot;,&quot;UAE North&quot;,&quot;UK South&quot;,&quot;UK West&quot;,&quot;West Central US&quot;,&quot;West Europe&quot;,&quot;West India&quot;,&quot;West US&quot;,&quot;West US 2&quot;,&quot;West US 3&quot;],&quot;apiVersions&quot;:[&quot;2023-01-01-preview&quot;,&quot;2022-10-01-preview&quot;,&quot;2022-01-01-preview&quot;,&quot;2021-11-01&quot;,&quot;2021-06-01-preview&quot;,&quot;2021-01-01-preview&quot;,&quot;2018-01-01-preview&quot;,&quot;2017-04-01&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2017-04-01&quot;}],&quot;capabilities&quot;:&quot;None&quot;},{&quot;resourceType&quot;:&quot;availableClusterRegions&quot;,&quot;locations&quot;:[],&quot;apiVersions&quot;:[&quot;2018-01-01-preview&quot;],&quot;apiProfiles&quot;:[{&quot;profileVersion&quot;:&quot;2018-06-01-profile&quot;,&quot;apiVersion&quot;:&quot;2018-01-01-preview&quot;}],&quot;capabilities&quot;:&quot;None&quot;}],&quot;registrationState&quot;:&quot;Registering&quot;,&quot;registrationPolicy&quot;:&quot;RegistrationRequired&quot;}: timestamp=2023-06-26T10:37:41.424+0530

Expected Behavior

show what resources are created

Actual Behavior

it hangs for ever and command never completes

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

No response

References

No response

答案1

得分: 0

来自MS API的响应消息表示EventHub进入了"registering"状态,这可能需要很长时间。

您可以通过运行 az provider show --namespace Microsoft.EventHub -o table 来检查是否在此期间完成了注册,如果已完成,它应该会显示为"registered"。注册提供程序后,您应该再次运行,以便它调用负责创建订阅的提供程序,该提供程序是Microsoft.Subscription,根据其API文档此处

英文:

The response message from MS API says that EventHub entered the "registering" state -- this can take a very long time.

You can check if it finished in the meantime by running az provider show --namespace Microsoft.EventHub -o table -- it should say registered if it has finished. After that provider has been registered you should run again so that it gets to calling the provider responsible for creating a Subscription which is Microsoft.Subscription according to their API Docs here

答案2

得分: 0

需要验证以下内容:

  1. 这主要是与Terraform相关的问题,但只是一个非常暂时的问题。根据您提供的调试日志,问题出在事件中心提供程序的版本上。确保所有提供程序都已更新并与所需版本兼容。

    注意: 这类问题会在一段时间后消失。如果问题仍然存在,请卸载Terraform设置,然后从头重新安装以避免任何冲突。

  2. 检查代码中提供的订阅是否正在有效工作。

  3. 确保与Terraform设置连接的Azure AD应用程序具有访问订阅详细信息的权限。验证应用程序是否已分配了必要的角色,如“Owner”或“Contributor”,以访问订阅详细信息。

  4. 重新启动Terraform配置设置并再次运行Terraform。尝试再次清除缓存。

  5. 使用 terraform refresh 命令更新/刷新当前的Terraform状态配置。

我在我的环境中尝试了您的要求,并成功运行如下:

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "3.62.1"
    }
  }
}
provider "azurerm" {
  features {}
}

data "azurerm_billing_enrollment_account_scope" "example" {
  billing_account_name    = "xxxxxx"
  enrollment_account_name = "xxxxxx"
}
resource "azurerm_subscription" "example" {
  subscription_name = "My Example EA Subscription"
  billing_scope_id  = data.azurerm_billing_enrollment_account_scope.example.id
}

输出:

Terraform在Azure上创建订阅问题

Terraform在Azure上创建订阅问题

注意: azurerm_subscription 资源目前处于实验形式,并且在某些情况下,Azure提供程序可能不完全支持。这可能是在运行 terraform apply 时未收到任何响应的原因。

英文:

Need to verify below:

  1. This is mainly a terraform-related issue but a very temporary one. Based on the debug logs you provided, the issue is with the event hub provider versions. Make sure that all the providers are updated and compatible with the desired versions.

    Note: These kinds of issues will go away after a while. If the issue persists, uninstall the Terraform setup and reinstall it from scratch to avoid any conflicts.

  2. Check whether the subscription provided in the code is actively working.

  3. Ascertain that the Azure AD application connected with the Terraform setup has to have access to subscription details. Verify if the application has the necessary roles assigned, like "Owner" or "Contributor," in order to access subscription details.

  4. Restart the terraform configuration set up and run terraform again. Try clearing the cache once again.

  5. Use terraform refresh command to update/refresh the current terraform state configuration.

I tried your requirement in mine, and it was successfully working as follows:

terraform {
  required_providers {
    azurerm = {
      source = &quot;hashicorp/azurerm&quot;
      version = &quot;3.62.1&quot;
    }
  }
}
provider &quot;azurerm&quot; {
  features {}
}

data &quot;azurerm_billing_enrollment_account_scope&quot; &quot;example&quot; {
  billing_account_name    = &quot;xxxxxx&quot;
  enrollment_account_name = &quot;xxxxxx&quot;
}
resource &quot;azurerm_subscription&quot; &quot;example&quot; {
  subscription_name = &quot;My Example EA Subscription&quot;
  billing_scope_id  = data.azurerm_billing_enrollment_account_scope.example.id
}

Output:

Terraform在Azure上创建订阅问题

Terraform在Azure上创建订阅问题

Note: The azurerm_subscription resource is currently in an experimental form and at few times, it is not completely supportive by the Azure providers. This might be the reason for not getting any response when you run terraform apply.

huangapple
  • 本文由 发表于 2023年6月26日 13:14:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76553680.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定