Azure / Azure/terraform-provider-azapi

Internal server error when updating event grid namespace with custom JWT authentication

Open
#790 6 comments 0 reactions 0 assignees View on GitHub
triaged upstream-api
Dominant language
Go
Stars
244
Forks
97
Avg merge
3d 18h
Merged PRs (30d)
8

Description

I'm trying to configure an event grid namespace with custom JWT authentication, tried multiple times with the same result:
```
azapi_update_resource.azurerm_eventgrid_namespace_this: Creating...
azapi_update_resource.azurerm_eventgrid_namespace_this: Still creating... [10s elapsed]
azapi_update_resource.azurerm_eventgrid_namespace_this: Still creating... [20s elapsed]

│ Error: Failed to update resource

│ with azapi_update_resource.azurerm_eventgrid_namespace_this,
│ on main.tf line 91, in resource "azapi_update_resource" "azurerm_eventgrid_namespace_this":
│ 91: resource "azapi_update_resource" "azurerm_eventgrid_namespace_this" {

│ updating "Resource: (ResourceId \"/subscriptions//resourceGroups//providers/Microsoft.EventGrid/namespaces/\" / Api Version
│ \"2024-12-15-preview\")": PUT
│ https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.EventGrid/namespaces/
│ --------------------------------------------------------------------------------
│ RESPONSE 500: 500 Internal Server Error
│ ERROR CODE: InternalServerError
│ --------------------------------------------------------------------------------
│ {
│ "error": {
│ "code": "InternalServerError",
│ "message": "The operation failed due to an internal server error. The initial state of the impacted resources (if any) are restored. Please try again in few minutes. If error still persists, report f6e0d480-91d3-4e7f-9274-2a051e65093f:2/25/2025 5:29:29 PM (UTC) to our forums for assistance or raise a support ticket ."
│ }
│ }
│ --------------------------------------------------------------------------------
```

Relevant configuration:
```terraform
resource "azurerm_eventgrid_namespace" "this" {
name = "${local.name}-egn"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name

identity {
type = "SystemAssigned"
}

topic_spaces_configuration {}

tags = local.tags
}

resource "azapi_update_resource" "azurerm_eventgrid_namespace_this" {
type = "Microsoft.EventGrid/namespaces@2024-12-15-preview"
resource_id = azurerm_eventgrid_namespace.this.id

body = {
properties = {
topicSpacesConfiguration = {
clientAuthentication = {
customJwtAuthentication = {
issuerCertificates = [
{
certificateUrl = azurerm_key_vault_certificate.this.id
identity = {
type = "SystemAssigned"
}
}
]
tokenIssuer = "https://${azurerm_linux_web_app.this.default_hostname}/"
}
}
}
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

The reported entry point is the azapi_update_resource configuration using Microsoft.EventGrid/namespaces@2024-12-15-preview and customJwtAuthentication. Start by reproducing the PUT with the shown namespace and certificate settings, then inspect the Azure API response and provider handling. Done means identifying a reproducible cause and documenting or validating the resulting fix; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.