terraform-provider-azurerm
terraform-provider-azurerm copied to clipboard
Support Updated api-version When Authenticating in Azure Container App With MSI_ENDPOINT
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
- Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Authentication using MSI_ENDPOINT
for Terraform in Azure Container App is using the the api-version
2018-02-01
as shown in the error below.
2023-05-01T13:05:58.920Z [WARN] ValidateProviderConfig from "provider[\"registry.terraform.io/hashicorp/azurerm\"]" changed the config value, but that value is unused
2023-05-01T13:05:58.921Z [DEBUG] provider.terraform-provider-azurerm_v3.54.0_x5: Performing GET Request to "http://localhost:42356/msi/token?api-version=2018-02-01&client_id=003873c2-xxxx-xxxx-xxxx-xxxxxxxxxxxx&resource=https%3A%2F%2Fgraph.microsoft.com": timestamp=2023-05-01T13:05:58.921Z
2023-05-01T13:05:58.921Z [DEBUG] provider.terraform-provider-azurerm_v3.54.0_x5: GET http://localhost:42356/msi/token?api-version=2018-02-01&client_id=003873c2-xxxx-xxxx-xxxx-xxxxxxxxxxxx&resource=https%3A%2F%2Fgraph.microsoft.com: timestamp=2023-05-01T13:05:58.921Z
2023-05-01T13:05:58.924Z [DEBUG] provider.terraform-provider-azurerm_v3.54.0_x5: Reading Body from GET "http://localhost:42356/msi/token?api-version=2018-02-01&client_id=003873c2-xxxx-xxxx-xxxx-xxxxxxxxxxxx&resource=https%3A%2F%2Fgraph.microsoft.com": timestamp=2023-05-01T13:05:58.923Z
2023-05-01T13:05:58.924Z [ERROR] provider.terraform-provider-azurerm_v3.54.0_x5: Response contains error diagnostic: @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:55 @module=sdk.proto tf_provider_addr=provider tf_req_id=25930b13-aa7d-85a3-16d2-9f2dc2c91794 tf_rpc=Configure diagnostic_detail= diagnostic_severity=ERROR diagnostic_summary="building account: could not acquire access token to parse claims: ManagedIdentityAuthorizer: failed to request token from metadata endpoint: received HTTP status 400 with body: {"error":{"code":"UnsupportedApiVersion","message":"The HTTP resource that matches the request URI 'http://localhost:42356/msi/token' does not support the API version '2018-02-01'.","innerError":null}}" tf_proto_version=5.3 timestamp=2023-05-01T13:05:58.924Z
2023-05-01T13:05:58.924Z [ERROR] vertex "provider[\"registry.terraform.io/hashicorp/azurerm\"]" error: building account: could not acquire access token to parse claims: ManagedIdentityAuthorizer: failed to request token from metadata endpoint: received HTTP status 400 with body: {"error":{"code":"UnsupportedApiVersion","message":"The HTTP resource that matches the request URI 'http://localhost:42356/msi/token' does not support the API version '2018-02-01'.","innerError":null}}
2023-05-01T13:05:58.924Z [INFO] backend/local: plan operation completed
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: building account: could not acquire access token to parse claims: ManagedIdentityAuthorizer: failed to request token from metadata endpoint: received HTTP status 400 with body: {"error":{"code":"UnsupportedApiVersion","message":"The HTTP resource that matches the request URI 'http://localhost:42356/msi/token' does not support the API version '2018-02-01'.","innerError":null}}
│
│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on provider.tf line 1, in provider "azurerm":
│ 1: provider "azurerm" {
│
╵
2023-05-01T13:05:58.940Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-05-01T13:05:58.943Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/azurerm/3.54.0/linux_amd64/terraform-provider-azurerm_v3.54.0_x5 pid=7848
2023-05-01T13:05:58.943Z [DEBUG] provider: plugin exited
The api-version
for authenticating in Azure Container App is 2019-08-01
New or Affected Resource(s)/Data Source(s)
azurerm_resource_group
Potential Terraform Configuration
The api-version called when authenticating using MSI_ENDPOINT will be 2019-08-01
References
No response