英文:
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 = "hashicorp/azurerm"
}
}
}
# Configure the Microsoft Azure Provider
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
}
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
{"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","South India","Southeast Asia","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-01-preview","2017-04-01","2015-08-01","2014-09-01"],"defaultApiVersion":"2017-04-01","apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation"},{"resourceType":"clusters","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","2018-01-01-preview"],"capabilities":"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation"},{"resourceType":"namespaces/authorizationrules","locations":["Australia Central","Australia East","Australia Southeast","Brazil South","Brazil Southeast","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/networkrulesets","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/privateEndpointConnections","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-01-preview"],"capabilities":"None"},{"resourceType":"namespaces/privateEndpointConnectionProxies","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-01-preview"],"capabilities":"None"},{"resourceType":"namespaces/networkSecurityPerimeterConfigurations","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"],"capabilities":"None"},{"resourceType":"namespaces/networkSecurityPerimeterAssociationProxies","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"],"capabilities":"None"},{"resourceType":"namespaces/eventhubs","locations":["Australia Central","Australia East","Australia Southeast","Brazil South","Brazil Southeast","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/eventhubs/authorizationrules","locations":["Australia Central","Australia East","Australia Southeast","Brazil South","Brazil Southeast","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/eventhubs/consumergroups","locations":["Australia Central","Australia East","Australia Southeast","Brazil South","Brazil Southeast","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/applicationGroups","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"],"capabilities":"None"},{"resourceType":"checkNamespaceAvailability","locations":[],"apiVersions":["2015-08-01","2014-09-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2015-08-01"}],"capabilities":"None"},{"resourceType":"checkNameAvailability","locations":[],"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-01-preview","2017-04-01","2015-08-01","2014-09-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"sku","locations":[],"apiVersions":["2017-04-01","2015-08-01","2014-09-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"operations","locations":[],"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-01-preview","2017-04-01","2015-08-01","2014-09-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/disasterrecoveryconfigs","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"namespaces/disasterrecoveryconfigs/checkNameAvailability","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"locations","locations":[],"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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"locations/operationStatus","locations":[],"apiVersions":["2023-01-01-preview","2022-10-01-preview","2022-01-01-preview"],"capabilities":"None"},{"resourceType":"locations/clusterOperationResults","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-01-preview"],"capabilities":"None"},{"resourceType":"locations/namespaceOperationResults","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-01-preview","2017-04-01"],"capabilities":"None"},{"resourceType":"locations/notifyNetworkSecurityPerimeterUpdatesAvailable","locations":["East US","East US 2","South Central US","Australia Central","Australia Central 2","Australia East","Australia Southeast","Brazil South","Brazil SouthEast","Canada Central","Canada East","Central India","Central US","Central US EUAP","East Asia","East US 2 EUAP","France Central","France South","Germany North","Germany West Central","Japan East","Japan West","Korea Central","Korea South","North Central US","North Europe","Norway East","Norway West","Poland Central","Qatar Central","South Africa North","South Africa West","Southeast Asia","South India","Sweden Central","Switzerland North","Switzerland West","UAE Central","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"],"capabilities":"None"},{"resourceType":"locations/deleteVirtualNetworkOrSubnets","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-01-preview","2017-04-01"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2017-04-01"}],"capabilities":"None"},{"resourceType":"availableClusterRegions","locations":[],"apiVersions":["2018-01-01-preview"],"apiProfiles":[{"profileVersion":"2018-06-01-profile","apiVersion":"2018-01-01-preview"}],"capabilities":"None"}],"registrationState":"Registering","registrationPolicy":"RegistrationRequired"}: 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
- terraform init
- 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
需要验证以下内容:
-
这主要是与Terraform相关的问题,但只是一个非常暂时的问题。根据您提供的调试日志,问题出在事件中心提供程序的版本上。确保所有提供程序都已更新并与所需版本兼容。
注意: 这类问题会在一段时间后消失。如果问题仍然存在,请卸载Terraform设置,然后从头重新安装以避免任何冲突。
-
检查代码中提供的订阅是否正在有效工作。
-
确保与Terraform设置连接的Azure AD应用程序具有访问订阅详细信息的权限。验证应用程序是否已分配了必要的角色,如“Owner”或“Contributor”,以访问订阅详细信息。
-
重新启动Terraform配置设置并再次运行Terraform。尝试再次清除缓存。
-
使用
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
}
输出:
注意: azurerm_subscription
资源目前处于实验形式,并且在某些情况下,Azure提供程序可能不完全支持。这可能是在运行 terraform apply
时未收到任何响应的原因。
英文:
Need to verify below:
-
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.
-
Check whether the subscription provided in the code is actively working.
-
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.
-
Restart the terraform configuration set up and run terraform again. Try clearing the cache once again.
-
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 = "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
}
Output:
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论