Azure / Azure/azure-rest-api-specs

[BUG]`Microsoft.Authorization/resourceManagementPrivateLinks` - `properties.privateEndpointConnections` field returns object array instead of string array

Open
#29,885 2 comments 1 reaction 1 assignee Claimed by @tjegbejimba View on GitHub
bug Mgmt
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/dc4f9f316f20e45231df187971a4dad2e5dd8964/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/privateLinks.json#L575-L580

### API Spec version

2020-05-01

### Describe the bug

In swagger, the `privateEndpointConnections` field should return array of strings, but array of objects are returned

### Expected behavior

In swagger, the `privateEndpointConnections` field should return array of strings

### Actual behavior

array of objects are returned

### Reproduction Steps

use terraform config to provision a `azurerm_resource_management_private_link` and `azurerm_private_endpoint`:
```hcl
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "management_privatelink" {
name = "management_privatelink"
location = "eastus"
}
resource "azurerm_resource_management_private_link" "management_privatelink" {
name = "management_privatelink"
resource_group_name = azurerm_resource_group.management_privatelink.name
location = azurerm_resource_group.management_privatelink.location
}
resource "random_uuid" "management_privatelink" {
}
data "azurerm_management_group" "management_group" {
name = ""
}
resource "azurerm_resource_management_private_link_association" "management_privatelink" {
name = random_uuid.management_privatelink.result
management_group_id = data.azurerm_management_group.management_group.id
resource_management_private_link_id = azurerm_resource_management_private_link.management_privatelink.id
public_network_access_enabled = true # Presumably we will eventually want to change this to false
}
resource "azurerm_virtual_network" "management_privatelink" {
name = "management_privatelink-network"
address_space = ["10.0.0.0/16"]
location = azurerm_resource_group.management_privatelink.location
resource_group_name = azurerm_resource_group.management_privatelink.name
}
resource "azurerm_subnet" "endpoint" {
name = "endpoint"
resource_group_name = azurerm_resource_group.management_privatelink.name
virtual_network_name = azurerm_virtual_network.management_privatelink.name
address_prefixes = ["10.0.2.0/24"]

enforce_private_link_endpoint_network_policies = true
}
resource "azurerm_private_endpoint" "management_privatelink" {
name = "management_privatelink"
location = azurerm_resource_group.management_privatelink.location
resource_group_name = azurerm_resource_group.management_privatelink.name
subnet_id = azurerm_subnet.endpoint.id
private_service_connection {
name = "management_privatelink"
private_connection_resource_id = azurerm_resource_management_private_link.management_privatelink.id
is_manual_connection = false
subresource_names = [
"ResourceManagement",
]
}
}
```

if no private endpoint is created, the privateEndpointConnections will be empty array, but if private endpoint is created, we can see the array contains objects:
```sh
-> % az rest --method get --uri "/subscriptions//resourceGroups/management_privatelink/providers/Microsoft.Authorization/resourceManagementPrivateLinks/management_privatelink?api-version=2020-05-01"
{
"id": "/subscriptions//resourceGroups/management_privatelink/providers/Microsoft.Authorization/resourceManagementPrivateLinks/management_privatelink",
"location": "eastus",
"name": "management_privatelink",
"properties": {
"privateEndpointConnections": [
{
"id": "/subscriptions//resourceGroups/management_privatelink/providers/Microsoft.Authorization/resourceManagementPrivateLinks/management_privatelink/privateEndpointConnections/management_privatelink.",
"name": "management_privatelink.",
"properties": {
"privateEndpoint": {
"id": "/subscriptions//resourceGroups/management_privatelink/providers/Microsoft.Network/privateEndpoints/management_privatelink"
},
"privateLinkServiceConnectionState": {
"description": "Auto-approved",
"status": "Approved"
},
"provisioningState": "Succeeded"
},
"type": "Microsoft.Authorization/resourceManagementPrivateLinks/privateEndpointConnections"
}
]
},
"type": "Microsoft.Authorization/resourceManagementPrivateLinks"
}
```

### Environment

terraform

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.