Azure / Azure/bicep

API Connection needs to support 'kind' property

Open
#3,512 8 comments 0 reactions 0 assignees View on GitHub
provider bug types: swagger inaccuracy
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

API Connections in Azure can be either V1 or V2. Yet we can't specify this property using bicep:

```bicep
resource tableStorageConnection 'Microsoft.Web/connections@2016-06-01' = {
name: 'tablestorage'
location: resourceGroup().location
kind: 'V2'
properties: {
...
```

```shell
/env/step1.bicep(95,3) : Error BCP037: The property "kind" is not allowed on objects of type "Microsoft.Web/connections". Permissible properties include "dependsOn", "etag".
```

ARM outputs for an API connection deployed via portal vs one deployed via bicep:

Portal
```json
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_azuretables_name')]",
"location": "westus2",
"kind": "V2",
"properties": {
"displayName": "tablestorage",
"customParameterValues": {},
"api": {
"id": "[concat('/subscriptions/xxx/providers/Microsoft.Web/locations/westus2/managedApis/', parameters('connections_azuretables_name'))]"
}
}
},
```

Bicep
```json
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_tablestorage_name')]",
"location": "westus2",
"kind": "V1",
"properties": {
"displayName": "[parameters('connections_tablestorage_name')]",
"customParameterValues": {},
"api": {
"id": "/subscriptions/xxx/providers/Microsoft.Web/locations/westus2/managedApis/azuretables"
}
}
},
```

if I `bicep build` my file and augment the JSON to add `"kind" : "V2"` to my connection, it deploys exactly as I expect.

```json
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "tablestorage",
"location": "[resourceGroup().location]",
"kind": "V2",
"properties": {
...
```

Contributor guide

Open the contributing guide

Research direction

Start with /env/step1.bicep around line 95 and compare the Microsoft.Web/connections@2016-06-01 type definition with the portal ARM JSON. Confirm that bicep build accepts kind: 'V2' and that the generated deployment output preserves kind as V2.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.