Azure / Azure/azure-cli

not possible to create private endpoint to connect to private link service using its alias with az cli

Open
#23,687 4 comments 0 reactions 1 assignee Claimed by @necusjz View on GitHub
act-quality-productivity-squad Auto-Assign Azure CLI Team customer-reported feature-request needs-team-attention Network
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

I was working on possible automation of creating private endpoints, especially connecting to private link service by using private link service alias. however, I did not find any option to do this using azure cli.

usually lots of things that azure portal can not do, they can be done using az cli; however, it seems to be inaccurate in this case. you can create private endpoints with private link service alias using portal but not with az cli.

this is very much needed in automating things in cross-subscription scenarios.

error:
az network private-endpoint create -g platdev2-cust-eastus -n testpep --subnet /subscriptions//resourceGroups/platdev2-cust-eastus/providers/Microsoft.Network/virtualNetworks/platdev2-cust-eastus-vnet/subnets/platdev2-cust-eastus-sub-endpoint-02 --private-connection-resource-id "elastic-obsv-mgmt-eastus-privlink-01.********fba.eastus.azure.privatelinkservice" --connection-name test
(LinkedInvalidPropertyId) Property id 'elastic-obsv-mgmt-eastus-privlink-01.******-*****fba.eastus.azure.privatelinkservice' at path 'properties.privateLinkServiceConnections[0].properties.privateLinkServiceId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
Code: LinkedInvalidPropertyId
Message: Property id 'elastic-obsv-mgmt-eastus-privlink-01.********-*****fba.eastus.azure.privatelinkservice' at path 'properties.privateLinkServiceConnections[0].properties.privateLinkServiceId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.

![2022-08-26_16-01-48](https://user-images.githubusercontent.com/30315028/186885505-28b724b8-903c-4d0b-bad2-c0b1330cbac5.png)
---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 8911e94f-9496-a68d-50c0-b5d536a375a4
* Version Independent ID: cc37b77b-0fa2-991b-e16b-fcdbbf183853
* Content: [az network private-endpoint](https://docs.microsoft.com/en-us/cli/azure/network/private-endpoint?view=azure-cli-latest)
* Content Source: [latest/docs-ref-autogen/network/private-endpoint.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/latest/docs-ref-autogen/network/private-endpoint.yml)
* Service: **virtual-network**
* GitHub Login: @rloutlaw
* Microsoft Alias: **routlaw**

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.