-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Network]Add Microsoft.Network/privateLinkServices configuration to support the private endpoint connection #18000
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AzPSArgumentException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use AzPSArgumentException need pass parameter name. We have to hardcode parameter name if use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need change log for this feature.
added change log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/// <param name="name">The name of the parameter</param> | ||
/// <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is It is not required. Let's discuss further.
/// <param name="name">The name of the parameter</param> | ||
/// <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, the method should be moved to each cmdlet implementation. So, one should go to privateendpointconnnection, another goes to GetAzurePrivateLinkResource.
@@ -76,6 +77,8 @@ public new object GetDynamicParameters() | |||
|
|||
protected IPrivateLinkProvider BuildProvider(string subscription, string privateLinkResourceType) | |||
{ | |||
if (!GenericProvider.SupportsPrivateLinkResourceType(privateLinkResourceType)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please help to rename method to SupportsPrivateLinkFeature because it includes resource type and connection endpoint both.
@@ -735,4 +735,10 @@ | |||
<data name="VirtualNetworkGatewayNatRuleNotFound" xml:space="preserve"> | |||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Utility method should be defined as protected static method and accept resourceId as input parameter.
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added