azure-cli: Bicep : Private Endpoint already exists - Cognitive Search

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

az deployment group create --template-file main.bicep --resource-group %rg%

Describe the bug on running the bicep template the 2nd/3rd/4th etc time an error that the private endpoint already exists . it runs successfully the first time

Call to Microsoft.Search/searchServices failed. Error message: PrivateEndpointConnectionProxy myPrivateEndpoint.b2686eab-ca66-415d-8354-89a557719bfe already exists on search service sqlserverk7n35dszoxenq

To Reproduce main.bicep

Expected behavior ability to run the bicep definition multiple times without error/ trying to create another private endpoint

Environment summary

azure-cli                         2.38.0

core                              2.38.0
telemetry                          1.0.6

Dependencies:
msal                            1.18.0b1
azure-mgmt-resource             21.1.0b1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\domalley\.azure\cliextensions'

Python (Windows) 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 15:58:59) [MSC v.1929 32 bit (Intel)]

Additional context the same configuration works for sql server main.bicep based on the arm template supplied here: https://docs.microsoft.com/en-us/azure/private-link/create-private-endpoint-bicep?tabs=CLI

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 21 (5 by maintainers)

Most upvoted comments

Same issue here.

This is an idempotency issue with the resource provider. @yonzhan – what is the right way to involve the Networking Resource Provider to look into this?

Hi, could this be placed somewhere on the roadmap? Seems like an easy one for you smart people to fix 😃 @alex-frankel @yonzhan didn’t seem to have replied

ok thanks, I think you are incorrect that I should be opening a support ticket , and i wont be doing so, as it’s a bug in bicep deployment and I don’t have a high enough support plan level anyway .

I have a workaround in place, cli lookup to see if resource exists and pass in as a parameter through the pipeline

it’s still a bug that’s going to affect other users though making the bicep deployment not deterministic.

thanks.

sorry I’m not sure what there is to understand? the bicep template should be deterministic, if I run the bicep through the CLI once, it works. if I run it a second time, it does not as its trying to create the same resource twice. I’ve raised other bicep issues through this repo numerous times, can you provide a link to where I should be logging bugs?