I have an existing Private Link Scope and App Insights workspace. I want to link them together using bicep
Here is my test main
param _hubSubscriptionId string = 'bdea0f7a-8006-4ae4-9baa-xxx'
param _appSubscriptionId string = 'efa02ec2-8f61-47c2-ab4b-xxx'
param appInsight string = 'appi-hlrpos-ci-a-uks-01'
param appInsghtRg string = 'rg-hlrpos-ci-a-uks-01'
param hubPlatformLogsRg string = 'rg-platformlogs-dev-h-uks-01'
resource existingLinkScope 'microsoft.insights/privateLinkScopes@2021-07-01-preview' existing = {
name: 'pls-log-platformlogs-dev-h-uks-01'
scope: resourceGroup(_hubSubscriptionId, hubPlatformLogsRg)
}
module AzureMonitorPrivateLinkConnection 'insights.privateLinkScopesScopedResources.bicep' = {
name: '${appInsight}-connection'
params: {
name: '${existingLinkScope.name}/${appInsight}-connection'
linkedResourceId: resourceId(_appSubscriptionId, 'microsoft.operationalinsights/workspaces', appInsight)
}
}
And this is the module
param linkedResourceId string
param name string
resource privateLinkScopes 'Microsoft.Insights/privateLinkScopes/scopedResources@2021-07-01-preview' = {
name: name
properties: {
linkedResourceId: linkedResourceId
}
}
I get this error
New-AzDeployment: 11:08:49 - Error: Code=InvalidDeployment; Message=The 'location' property must be specified for 'appi-hlrpos-ci-a-uks-01-connection'. Please see https://aka.ms/arm-deployment-subscription for usage details.
But I can't see anywhere this can be specified
Can someone help please