Azure / Azure/bicep-types-az

Microsoft.OperationalInsights/workspaces@2023-09-01: listKeys() intellisense missing

Open
#2,476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

inaccuracy
Dominant language
TypeScript
Stars
108
Forks
44
Avg merge
18h 53m
Merged PRs (30d)
29

Description

### Resource Type

Microsoft.OperationalInsights/workspaces

### Api Version

2023-09-01

### Issue Type

Missing property(s)

### Other Notes

`.listKeys()` is missing from VS Code Intellisense
`.listKeys().primarySharedKey` is also missing from Intellisense.
My specific use case was for creating a Container Apps Environment ('Microsoft.App/managedEnvironments@2024-10-02-preview') which needs `properties.logAnalyticsConfiguration.sharedKey` - I found that I could use `.listKeys().primarySharedKey` from this SO article: https://stackoverflow.com/questions/74183142/get-log-analytics-workspace-key-from-bicep

### Bicep Repro

```bicep
@description('Container Environment: Name')
param containerAppsEnvironmentName string

@description('App Insights: Name of log analytics workspace')
param logAnalyticsWorkspaceName string

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
name: logAnalyticsWorkspaceName
}

resource container_apps_environment 'Microsoft.App/managedEnvironments@2024-10-02-preview' = {
name: containerAppsEnvironmentName
location: 'North Europe'
properties: {
appLogsConfiguration: {
destination: 'log-analytics'
logAnalyticsConfiguration: {
customerId: logAnalyticsWorkspace.properties.customerId
dynamicJsonColumns: true
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey // PK - intellisense does not recognise // https://stackoverflow.com/questions/74183142/get-log-analytics-workspace-key-from-bicep
}
}
zoneRedundant: false
kedaConfiguration: {}
daprConfiguration: {}
customDomainConfiguration: {}
workloadProfiles: [
{
workloadProfileType: 'Consumption'
name: 'Consumption'
enableFips: false
}
]
peerAuthentication: {
mtls: {
enabled: false
}
}
peerTrafficConfiguration: {
encryption: {
enabled: false
}
}
publicNetworkAccess: 'Enabled'
}
}
```

### Confirm

- [x] I have read the troubleshooting guide and looked for duplicates.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Load the supplied Bicep repro in VS Code and inspect IntelliSense for Microsoft.OperationalInsights/workspaces@2023-09-01. Trace the type definition or entry point responsible for listKeys() and primarySharedKey; done means both members are recognized for the resource and the repro no longer reports missing IntelliSense.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.