Bicep Template failing on privateEndpointConnections

Mahesh chandak 25 Reputation points
2024-03-07T10:59:11.75+00:00

Hi,

We are getting the below error while deploying privateEndpointConnections for service bus.

ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/e03a9d4e-499f-4fd2-8fd1-4d13d0756fc2/resourceGroups/rg-dev-uks-integrations-common/providers/Microsoft.Resources/deployments/azuredeploy","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"PrivateEndpointConnectionInvalidStateChange","message":"A state change from Approved to Approved is not valid"}]}}

Here is the snip of the bicep template. Also just to let you know the private endpoint connection already exists. But we expect the bicep template to not fail and just update the existing resource.

Bicep snip

var servicebusprivateendpoint='/subscriptions/xxx/resourceGroups/rg-${environment}-xxxx/providers/Microsoft.Network/privateEndpoints/xxx'


resource privateEndpointConnections_102e8d0a_a3b0_4307_849d_39d2ac85be19 'Microsoft.ServiceBus/namespaces/privateEndpointConnections@2022-10-01-preview' = {
  parent: servicebus_namespace_resource
  name: '102e8d0a-a3b0-4307-849d-39d2ac85be19'
  location: resource_location
  properties: {
    provisioningState: 'Succeeded'
   privateEndpoint: {
      id: servicebusprivateendpoint
    }
    privateLinkServiceConnectionState: {
      status: 'Approved'
      description: 'Auto-Approved'
    }
  }
}

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
632 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
514 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.