How to login and deploy resource using resource management private link?

Minwoo Jo 5 평판 포인트
2025-04-18T01:06:09.1566667+00:00

Hello. I test private connection using resource management private link and private endpoint.

How to azure login using private endpoint?

I deploy VM, resource management private link associated with private endpoint. And I add DNS information in /etc/hosts ( private endpoint IP : management.azure.com )

When i command azure login --identity --debug, i get error message below.

cli.azure.cli.core.azclierror: (PrivateLinkAccessRestricted) Request originated from private virtual network for resource '/subscriptions', but this resource can not be accessed from a private endpoint. To connect to this resource, please use the public network without a private endpoint.
Code: PrivateLinkAccessRestricted
Message: Request originated from private virtual network for resource '/subscriptions', but this resource can not be accessed from a private endpoint. To connect to this resource, please use the public network without a private endpoint.
az_command_data_logger: (PrivateLinkAccessRestricted) Request originated from private virtual network for resource '/subscriptions', but this resource can not be accessed from a private endpoint. To connect to this resource, please use the public network without a private endpoint.
Code: PrivateLinkAccessRestricted
Message: Request originated from private virtual network for resource '/subscriptions', but this resource can not be accessed from a private endpoint. To connect to this resource, please use the public network without a private endpoint.

How to solve this issue?

Is it impossible to login and deploy resource (network, vm) using resource management private link?

Azure
Azure
Microsoft에서 관리하는 전 세계 데이터 센터 네트워크를 통해 애플리케이션과 서비스를 빌드, 배포, 관리하기 위한 클라우드 컴퓨팅 플랫폼 및 인프라입니다.
질문 92개
투표 {count}개

답변 2개

정렬 기준: 가장 유용함
  1. Minwoo Jo 5 평판 포인트
    2025-04-18T07:02:17.61+00:00

    Hi Venkat.
    Thank you for your apply!

    I tried to Method 1.
    First, VM was authenticated using public access.
    Secondly, I add that private endpoint IP : management.azure.com in /etc/hosts.

    Lastly, I try to create vm using azure cli but same error is still occured.

    az vm restart -g mw-resource-group-2 -n testvm
    
    (PrivateLinkAccessRestricted) Request originated from private virtual network for resource '/subscriptions/<Subscription ID>/resourceGroups/mw-resource-group-2/providers/Microsoft.Compute/virtualMachines/testvm/restart', but this resource can not be accessed from a private endpoint. To connect to this resource, please use the public network without a private endpoint.
    Code: PrivateLinkAccessRestricted
    Message: Request originated from private virtual network for resource '/subscriptions/
    <Subscription ID>/resourceGroups/mw-resource-group-2/providers/Microsoft.Compute/virtualMachines/testvm/restart', but this resource can not be accessed from a private endpoint. To connect to this resource, please use the public network without a private endpoint.
    

    Which commands is working correctly using private endpoint? What is resource-level operations?

    댓글 0개 설명 없음

  2. Venkat V 2,055 평판 포인트 Microsoft 외부 직원 Moderator
    2025-04-18T11:17:01.0033333+00:00

    Hi @Minwoo Jo

    Even though you've configured a private endpoint for ⁣,management.azure.com Azure does not fully support all Azure CLI or SDK operations—such as over private linkaz login alone, especially for tenant- or subscription-level endpoints like /subscriptions``/tenants

    Method 1: Temporary public access for login operations like az login, az account list, or ⁣ requiresaz vm create access to control plane endpoints that are not yet exposed via Private Link.

    To work around this, temporarily allow internet access (either directly on the VM ) to perform login and control plane operations:

    
    az login --identity
    
    

    Once authenticated, most supported resource-level operations will work over the existing Private Endpoint.

    Note: If you are using Azure VM and created the same VNet as the resource management private link, there is no need to add any host entry on VM

    Method 2: Use Azure Bastion Keep the private VM fully isolated, and use a secure jump host or Azure Bastion (with internet access) for CLI authentication and initial deployment tasks.

    As I tested the same in my environment without internet access, I also encountered the same error.

    enter image description here

    enter image description here

    To resolve the issue, I created an outbound rule for internet access to the VM, as shown below.

    enter image description here

    After creating the rule, I was able to connect to the VM using the cmdlet and successfully create resources using the same identity

    enter image description here

    I hope this helps to resolve your issue. Please feel free to ask any questions if the solution provided isn't helpful.

    Please provide your valuable feedback on the thread by clicking Accept the answer and upvoting wherever the information was helpful, as this can be beneficial to other community members


답변

질문 작성자가 수락한 답변이라고 답변에 표시할 수 있으며, 이를 통해 작성자의 문제를 해결한 답변을 사용자가 알 수 있도록 도와줍니다.