Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.67k stars 5.1k forks source link

[BUG] - Updating an Scoped Resource on Private Link Scope Fails #28176

Open sajid08 opened 8 months ago

sajid08 commented 8 months ago

API Spec link

https://github.com/Azure/azure-rest-api-specs

API Spec version

2021-07-01-preview

Describe the bug

I am using following Bicep to add an App Insights instance to an existing private link scope

resource privatelinkedscoperesource 'Microsoft.Insights/privateLinkScopes/scopedResources@2021-07-01-preview' = { name: 'AppInsightsPrivateLinkScope' parent: privatelinkscope properties: { linkedResourceId: appinsights_name_resource.id } } it works fine the first time when adding it, but fails with the following error on the subsequent deployments even though it's an Incremental release. Can we do anything to change this behaviour? otherwise we'll have to comment this part of template and only uncomment it for initial deployment which is a pretty bad solution.

"code":"Conflict","message":"Scoped resource with same linked resource id already exists in this private link scope"

Expected behavior

It should complete successfully

Actual behavior

Fails with this error

"code":"Conflict","message":"Scoped resource with same linked resource id already exists in this private link scope"

Reproduction Steps

Create a Bicep script with references for an App Insights and Private Link Scope instance and then add this section.

resource privatelinkedscoperesource 'Microsoft.Insights/privateLinkScopes/scopedResources@2021-07-01-preview' = { name: 'AppInsightsPrivateLinkScope' parent: privatelinkscope properties: { linkedResourceId: appinsights_name_resource.id } }

Environment

No response

zzhxiaofeng commented 7 months ago

@vutran01 Please help have a look, thank you.

sajid08 commented 7 months ago

Any update on this?

sajid08 commented 6 months ago

@qinjoshua any update on this?