azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Private Endpoints Support

Open malopMSFT opened this issue 7 years ago • 7 comments

Resource Provider Microsoft.Network

Description of Feature or Work Requested Support for private endpoints operations, new top level resource that provides private connectivity to azure resources, here a few sample operations:

Minimum API Version Required 2019-02-01

Swagger Link https://github.com/Azure/azure-rest-api-specs/pull/5860 Pending for merge to master

Target Date June release

###########################################

Private Endpoints CLI operations

###########################################

###########################################

Listing available endpoint types

API: GET "https://management.azure.com/subscriptions/{SUBSCRIPTION}/providers/Microsoft.Network/locations/{LOCATION}/availablePrivateEndpointTypes"

###########################################

az network list-private-endpoint-types -l "West US" { "value": [ { "name": "Microsoft.DocumentDB.databaseAccounts", "id": "/subscriptions/e05dbbce-79c2-45a2-a7ef-f1058856feb3/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.DocumentDB.databaseAccounts", "type": "Microsoft.Network/availablePrivateEndpointTypes", "resourceName": "Microsoft.DocumentDB/databaseAccounts" }, { "name": "Microsoft.Sql.servers", "id": "/subscriptions/e05dbbce-79c2-45a2-a7ef-f1058856feb3/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Sql.servers", "type": "Microsoft.Network/availablePrivateEndpointTypes", "resourceName": "Microsoft.Sql/servers" }, { "name": "Microsoft.Network.privateLinkServers", "id": "/subscriptions/e05dbbce-79c2-45a2-a7ef-f1058856feb3/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Network.privateLinkServers", "type": "Microsoft.Network/availablePrivateEndpointTypes", "resourceName": "Microsoft.Network/privateLinkServers" }, { "name": "Microsoft.Web.sites", "id": "/subscriptions/e05dbbce-79c2-45a2-a7ef-f1058856feb3/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Web.sites", "type": "Microsoft.Network/availablePrivateEndpointTypes", "resourceName": "Microsoft.Web/sites" }, { "name": "Microsoft.Web.hostingEnvironments", "id": "/subscriptions/e05dbbce-79c2-45a2-a7ef-f1058856feb3/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Web.hostingEnvironments", "type": "Microsoft.Network/availablePrivateEndpointTypes", "resourceName": "Microsoft.Web/hostingEnvironments" } ] }

###########################################

Private Endpoint CRUD

API: PUT/GET/DELETE "https://management.azure.com/subscriptions/{SUBSCRIPTION}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.Network/privateEndpoints/{NAME}"

###########################################

az network private-endpoint create -g "MyResourceGroup" -n "MyPrivateEndpoint" -l "West US" --resourceId "$resourceId" --subnetId "$subnetId" az network private-endpoint create -g "MyResourceGroup" -n "MyPrivateEndpoint" -l "West US" --resourceId "$resourceId" --subnetId "$subnetId" --requestMethod Manual az network private-endpoint show -g "MyResourceGroup" -n "MyPrivateEndpoint" az network private-endpoint list az network private-endpoint delete -g "MyResourceGroup" -n "MyPrivateEndpoint"

az network private-endpoint list-required-FQDNs -g "MyResourceGroup" -n "MyPrivateEndpoint"

###########################################

Private Resource show

API: GET "https://management.azure.com/subscriptions/{SUBSCRIPTION}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.{RP_NAME}/{NAME}/privateLinkResources"

###########################################

az network private-resource show -g "MyResourceGroup" -n "MySQL" --ResourceProviderName "Microsoft.Sql/server"
az network private-resource show --id "subscriptions/..../Microsoft.Sql/server/MySQL"

###########################################

Private Resource Connections list/show/approve/reject/delete

API: GET "https://management.azure.com/subscriptions/{SUBSCRIPTION}/resourceGroups/{RESOURCE_GROUP}/providers/Microsoft.{RP_NAME}/{NAME}/privateEndpointConnections"

###########################################

az network private-resource connections list -g "MyResourceGroup" -n "MySQL" --ResourceProviderName "Microsoft.Sql/server"
az network private-resource connections list --id "subscriptions/..../Microsoft.Sql/server/MySQL"

az network private-resource connections approve --id "subscriptions/..../Microsoft.Sql/server/MySQL" -n "MyConnectionName" --response-message "Welcome" az network private-resource connections reject --id "subscriptions/..../Microsoft.Sql/server/MySQL" -n "MyConnectionName" --response-message "Sorry" az network private-resource connections delete --id "subscriptions/..../Microsoft.Sql/server/MySQL" -n "MyConnectionName"

malopMSFT avatar May 24 '19 16:05 malopMSFT

"name": "Microsoft.Network.privateLinkServers", "id": "/subscriptions/e05dbbce-79c2-45a2-a7ef-f1058856feb3/providers/Microsoft.Network/availablePrivateEndpointTypes/Microsoft.Network.privateLinkServers", "type": "Microsoft.Network/availablePrivateEndpointTypes", "resourceName": "Microsoft.Network/privateLinkServers"

This should be - "Microsoft.Network/privatelinkservices" not "Microsoft.Network.privateLinkServers"

sumeetmittal avatar May 24 '19 21:05 sumeetmittal

@malopMSFT I don't see any support for "Private Resource show" or "Private Resource Connections list/show/approve/reject/delete" in the referenced swagger.

tjprescott avatar Jul 05 '19 23:07 tjprescott

Moving to the backlog as this item is not ready to be worked.

tjprescott avatar Jul 09 '19 20:07 tjprescott

@malopMSFT Hi. Recently, I'm working on this issue. I have a few questions and need your help.

  • I don't fully understand the private-resources, especially the Private Resource Connections. In another issue https://github.com/Azure/azure-cli/issues/9475, private-link-service will have a command called private-endpoint-connection which can set private-link-service-connection-state. Here for the private resource connections, we have similar commands like private-resource connections approve/reject. Do they manipulate the same resource or not? Based on the service name, I think there should be private-endpoint connections approve/reject. What's the relationship between the private-resource and private-endpoint?
  • Will the private-resource connections approve/reject create the connection? Because there is a command called private-resource connections delete

mmyyrroonn avatar Jul 22 '19 03:07 mmyyrroonn

@malopMSFT Besides, now, is our minimal API Version still 2019-02-01 or 2019-04-01?

mmyyrroonn avatar Jul 22 '19 04:07 mmyyrroonn

@MyronFanQiu please use 2019-04-01, let's have a meeting to discuss the implementation of those options on the private endpoint connections area, is basically a generic method to list, approve and reject on multiple resource APIs

malopMSFT avatar Jul 22 '19 18:07 malopMSFT

@malopMSFT Sounds good. Let's have a meeting tomorrow.

mmyyrroonn avatar Jul 23 '19 00:07 mmyyrroonn