[Bug] Incorrect JSON template for linked app insights with ARM/Bicep
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I'm trying to deploy a SWA with an App Insights instance connected from a Bicep template.
Looking at the JSON overview in the portal, it seems that the App Insight instance is linked using special tags:
```json
...
"hidden-link: /app-insights-resource-id": "/subscriptions/123...",
"hidden-link: /app-insights-instrmentation-key": "98765431..."
...
```
When I tried to set this in my Bicep template to reference the App Insight resource:
```
tags: {
'hidden-link: /app-insights-resource-id': appInsights.id
'hidden-link: /app-insights-instrmentation-key': reference(appInsights.id, appInsights.apiVersion).InstrumentationKey
}
```
I get this error: `This expression is being used in an assignment to the "tags" property of the "Microsoft.Web/staticSites" type, which requires a value that can be calculated at the start of the deployment`

It seems that the tags values must be statically defined, so it's not possible to reference the App Insights also created in the template.
Do you know a workaround about this? I think using a dedicated module for the SWA resource might be a way around, but I don't want to use modules.
Out of curiosity, what was the rationale for using tags instead of regular properties for these values?
Thanks.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.