hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.53k stars 4.61k forks source link

Deploying an Azure Private Endpoint for azuremonitor gives internal server error #26010

Open RHooijer opened 4 months ago

RHooijer commented 4 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.3

AzureRM Provider Version

3.104.0

Affected Resource(s)/Data Source(s)

azurerm_private_endpoint

Terraform Configuration Files

resource "azurerm_private_endpoint" "this" {
  name                = "name"
  resource_group_name = "namerg"
  location            = "westeurope"

  subnet_id = "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworks/xxx/subnets/az142nvnexxx"

  private_dns_zone_group {
    name                 = "azuremonitor-pep-zone-group"
    private_dns_zone_ids = [
      "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/privateDnsZones/privatelink.monitor.azure.com",
      "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/privateDnsZones/privatelink.oms.opinsights.azure.com",
      "/subscriptions/xxx/resourceGroups/xxx/Microsoft.Network/privateDnsZones/privatelink.ods.opinsights.azure.com",
      "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/privateDnsZones/privatelink.agentsvc.azure-automation.net",
      "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net"
    ]
    }

  private_service_connection {
    name                           = "name"
    private_connection_resource_id = module.azurerm_monitor_private_link_scope.output.id
    is_manual_connection           = false
    subresource_names = [
      "azuremonitor"
    ]
  }
}

Debug Output/Panic Output

╷
│ Error: waiting for creation of Private DNS Zone Group "azuremonitor-pep-zone-group" for Private Endpoint (Subscription: ""
│ Resource Group Name: ""
│ Private Endpoint Name: "azuremonitor-pep"): Code="InternalServerError" Message="An error occurred." Details=[]
│ 
│   with azurerm_private_endpoint.this,
│   on main.tf line 466, in resource "azurerm_private_endpoint" "this":
│  466: resource "azurerm_private_endpoint" "this" {
│ 
╵
##[error]Error: The process '/agent/_work/_tool/terraform/1.8.3/x64/terraform' failed with exit code 1

Expected Behaviour

Deploy a private endpoint and give succesfull deployment

Actual Behaviour

The private endpoint is deployed and does work, but the pipeline gives the following error: ╷ │ Error: waiting for creation of Private DNS Zone Group "azuremonitor-pep-zone-group" for Private Endpoint (Subscription: "" │ Resource Group Name: "" │ Private Endpoint Name: "azuremonitor-pep"): Code="InternalServerError" Message="An error occurred." Details=[] │ │ with azurerm_private_endpoint.this, │ on main.tf line 466, in resource "azurerm_private_endpoint" "this": │ 466: resource "azurerm_private_endpoint" "this" { │ ╵

[error]Error: The process '/agent/_work/_tool/terraform/1.8.3/x64/terraform' failed with exit code 1

Steps to Reproduce

No response

Important Factoids

No response

References

No response

ZeJ0hn commented 4 months ago

Exactly the same issue since few days. It was working last month.

But if I use terraform apply a second time, Private DNS Zone Group has been successfully created.

RHooijer commented 4 months ago

@ZeJ0hn do you know in which azurerm version it was still working? If so I can test if it does work with older versions.

ZeJ0hn commented 4 months ago

@RHooijer Not sure that is a azurerm issue because I didn't change it. Maybe more an Azure API issue.