[Network]Add Microsoft.Network/privateLinkServices configuration to support the private endpoint connection #18000
[Network]Add Microsoft.Network/privateLinkServices configuration to support the private endpoint connection #18000dingmeng-xue merged 19 commits intomainfrom
Conversation
…C and add hasSupportResourceURI parameter.
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/ProviderConfiguration.cs
Outdated
Show resolved
Hide resolved
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/ProviderConfiguration.cs
Outdated
Show resolved
Hide resolved
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/ProviderConfiguration.cs
Outdated
Show resolved
Hide resolved
.../Network/PrivateLinkService/PrivateEndpointConnection/PrivateEndpointConnectionBaseCmdlet.cs
Outdated
Show resolved
Hide resolved
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/GenericProvider.cs
Outdated
Show resolved
Hide resolved
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/GenericProvider.cs
Outdated
Show resolved
Hide resolved
| @@ -1,63 +1,69 @@ | |||
| ## Applicability | |||
| Az.Network supports the retrieval of private link resource in `Get-AzPrivateLinkResource` as well as the management of private endpoint connection in `Approve-AzPrivateEndpointConnect`, `Deny-AzPrivateEndpointConnect`, `Remove-AzPrivateEndpointConnect` and `Set-AzPrivateEndpointConnect`. | |||
| Az.Network supports the retrieval of private link resource in `Get-AzPrivateLinkResource` as well as the management of private endpoint connection by `Get-AzPrivateEndpointConnect`, `Approve-AzPrivateEndpointConnect`, `Deny-AzPrivateEndpointConnect`, `Remove-AzPrivateEndpointConnect` and `Set-AzPrivateEndpointConnect`. | |||
There was a problem hiding this comment.
| Az.Network supports the retrieval of private link resource in `Get-AzPrivateLinkResource` as well as the management of private endpoint connection by `Get-AzPrivateEndpointConnect`, `Approve-AzPrivateEndpointConnect`, `Deny-AzPrivateEndpointConnect`, `Remove-AzPrivateEndpointConnect` and `Set-AzPrivateEndpointConnect`. | |
| Az.Network supports the retrieval of private link resource in `Get-AzPrivateLinkResource` as well as the management of private endpoint connection by `Get-AzPrivateEndpointConnection`, `Approve-AzPrivateEndpointConnection`, `Deny-AzPrivateEndpointConnection`, `Remove-AzPrivateEndpointConnection` and `Set-AzPrivateEndpointConnection`. |
| For providers who | ||
| - supports the features of private linke resource and private endpoint connection already | ||
| - and want to onboard these features in Azure PowerShell, | ||
| This example is for provider who |
There was a problem hiding this comment.
| This example is for provider who | |
| For providers who |
The audience should be providers.
| - supports the features of private linke resource and private endpoint connection already | ||
| - and want to onboard these features in Azure PowerShell, | ||
| This example is for provider who | ||
| - supports the features of private link resource and private endpoint connection already |
There was a problem hiding this comment.
| - supports the features of private link resource and private endpoint connection already | |
| - supports the features of private link resource or private endpoint connection already |
| ``` | ||
| # Get Private Endpoint Connection API | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Level-Resource}/{Top-Level-Resource-Name}/privateEndpointConnections/{PrivateEndpointConnection-Name}" | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Resource}/{Top-Resource-Name}/privateEndpointConnections/{Resource-Name}" |
There was a problem hiding this comment.
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Resource}/{Top-Resource-Name}/privateEndpointConnections/{Resource-Name}" | |
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{provider}/{Top-Resource}/{Top-Resource-Name}/privateEndpointConnections/{PrivateEndpointConnection-Name}" |
The name should be the name of PrivateEndpointConnection
|
Please contact me if you have any question about these comments. |
.../Network/PrivateLinkService/PrivateEndpointConnection/PrivateEndpointConnectionBaseCmdlet.cs
Outdated
Show resolved
Hide resolved
|
|
||
| if (!GenericProvider.SupportsPrivateLinkResourceType(this.PrivateLinkResourceType)) | ||
| { | ||
| throw new ArgumentException(string.Format(Properties.Resources.UnsupportPrivateLinkResourceType, this.PrivateLinkResourceType)); |
There was a problem hiding this comment.
Use AzPSArgumentException need pass parameter name. We have to hardcode parameter name if use it.
There was a problem hiding this comment.
Please find a proper exception from https://github.com/Azure/azure-powershell-common/tree/main/src/Common/Exceptions
There was a problem hiding this comment.
Used AzPSApplicationException
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/GenericProvider.cs
Outdated
Show resolved
Hide resolved
src/Network/Network/PrivateLinkService/PrivateLinkServiceProvider/GenericProvider.cs
Outdated
Show resolved
Hide resolved
BethanyZhou
left a comment
There was a problem hiding this comment.
Need change log for this feature.
added change log |
| /// <param name="runtimeParameter">The returned runtime parameter for context, with appropriate validate set</param> | ||
| /// <returns>True if one or more contexts were found, otherwise false</returns> | ||
| public static bool TryGetProvideServiceParameter(string name, string parameterSetName, out RuntimeDefinedParameter runtimeParameter) | ||
| public static bool TryGetProvideServiceParameter(string serviceType, string name, string parameterSetName, out RuntimeDefinedParameter runtimeParameter) |
There was a problem hiding this comment.
My understanding is It is not required. Let's discuss further.
| /// <param name="runtimeParameter">The returned runtime parameter for context, with appropriate validate set</param> | ||
| /// <returns>True if one or more contexts were found, otherwise false</returns> | ||
| public static bool TryGetProvideServiceParameter(string name, string parameterSetName, out RuntimeDefinedParameter runtimeParameter) | ||
| public static bool TryGetProvideServiceParameter(string serviceType, string name, string parameterSetName, out RuntimeDefinedParameter runtimeParameter) |
There was a problem hiding this comment.
If possible, the method should be moved to each cmdlet implementation. So, one should go to privateendpointconnnection, another goes to GetAzurePrivateLinkResource.
|
|
||
| protected IPrivateLinkProvider BuildProvider(string subscription, string privateLinkResourceType) | ||
| { | ||
| if (!GenericProvider.SupportsPrivateLinkResourceType(privateLinkResourceType)) |
There was a problem hiding this comment.
Please help to rename method to SupportsPrivateLinkFeature because it includes resource type and connection endpoint both.
| <value>The VirtualNetworkGatewayNatRule could not be found</value> | ||
| </data> | ||
| <data name="UnsupportPrivateEndpointConnectionType" xml:space="preserve"> | ||
| <value>The {0} doesn't register private endpoint connection.</value> |
There was a problem hiding this comment.
| <value>The {0} doesn't register private endpoint connection.</value> | |
| <value>Resource type {0} doesn't support private endpoint connection.</value> |
| /// Check if the resource id format is valid. | ||
| /// </summary> | ||
| /// <exception cref="AzPSApplicationException">unvaild throw exception</exception> | ||
| public void CheckResourceId () |
There was a problem hiding this comment.
Utility method should be defined as protected static method and accept resourceId as input parameter.
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added