ConnectionPolicy changes#29655
Open
rchepala wants to merge 1 commit into
Open
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
Collaborator
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
Please don't update auto generated code and fix CI errors. |
5508d63 to
828c1dd
Compare
828c1dd to
1f335d4
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds VirtualHub ConnectionPolicy support to Az.Network by introducing new cmdlets (Get/New/Set/Remove), wiring up SDK operations/models, and adding documentation + scenario coverage.
Changes:
- Added ConnectionPolicy cmdlets and a shared base cmdlet to call new SDK operations.
- Extended the generated NetworkManagement SDK with ConnectionPolicy model + operations and exposed it via
NetworkManagementClient. - Added cmdlet help markdown, module exports, changelog entry, and a live-only scenario test.
Reviewed changes
Copilot reviewed 18 out of 26 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/StaticAnalysis/Exceptions/Az.Network/GeneratedSdkIssues.csv | Adds static analysis exception entry for generated SDK freshness. |
| src/Network/Network/help/Get-AzConnectionPolicy.md | New help documentation for Get-AzConnectionPolicy. |
| src/Network/Network/help/New-AzConnectionPolicy.md | New help documentation for New-AzConnectionPolicy. |
| src/Network/Network/help/Set-AzConnectionPolicy.md | New help documentation for Set-AzConnectionPolicy. |
| src/Network/Network/help/Remove-AzConnectionPolicy.md | New help documentation for Remove-AzConnectionPolicy. |
| src/Network/Network/Properties/Resources.resx | Adds a new localized resource string for ConnectionPolicy errors. |
| src/Network/Network/Models/Cortex/PSConnectionPolicy.cs | Introduces PowerShell model for ConnectionPolicy. |
| src/Network/Network/Cortex/CortexParameterSetNames.cs | Adds parameter set name constants for ConnectionPolicy cmdlets. |
| src/Network/Network/Cortex/ConnectionPolicy/ConnectionPolicyBaseCmdlet.cs | Adds base cmdlet wrapping ConnectionPolicy operations. |
| src/Network/Network/Cortex/ConnectionPolicy/GetAzureRmConnectionPolicyCommand.cs | Implements Get-AzConnectionPolicy. |
| src/Network/Network/Cortex/ConnectionPolicy/NewAzureRmConnectionPolicyCommand.cs | Implements New-AzConnectionPolicy. |
| src/Network/Network/Cortex/ConnectionPolicy/SetAzureRmConnectionPolicyCommand.cs | Implements Set-AzConnectionPolicy. |
| src/Network/Network/Cortex/ConnectionPolicy/RemoveAzureRmConnectionPolicyCommand.cs | Implements Remove-AzConnectionPolicy. |
| src/Network/Network/Common/NetworkResourceManagerProfile.cs | Adds AutoMapper mappings for ConnectionPolicy model conversion. |
| src/Network/Network/ChangeLog.md | Notes new ConnectionPolicy cmdlets in upcoming release notes. |
| src/Network/Network/Az.Network.psd1 | Exports the new cmdlets from the module. |
| src/Network/Network.Test/ScenarioTests/CortexTests.ps1 | Adds live-only CRUD scenario coverage for ConnectionPolicy. |
| src/Network/Network.Test/ScenarioTests/CortexTests.cs | Registers the new scenario test in xUnit. |
| src/Network/Network.Management.Sdk/Generated/NetworkManagementClient.cs | Exposes ConnectionPolicy operations on the SDK client. |
| src/Network/Network.Management.Sdk/Generated/INetworkManagementClient.cs | Adds ConnectionPolicy to the SDK client interface. |
| src/Network/Network.Management.Sdk/Generated/IConnectionPolicyOperations.cs | Adds generated ConnectionPolicy operations contract. |
| src/Network/Network.Management.Sdk/Generated/ConnectionPolicyOperations.cs | Adds generated REST implementation for ConnectionPolicy operations. |
| src/Network/Network.Management.Sdk/Generated/ConnectionPolicyOperationsExtensions.cs | Adds generated convenience extension methods for ConnectionPolicy. |
| src/Network/Network.Management.Sdk/Generated/Models/ConnectionPolicy.cs | Adds generated ConnectionPolicy model. |
| src/Network/Network.Management.Sdk/Generated/Models/StaticRoutesConfig.cs | Adjusts generated model mutability for PropagateStaticRoutes. |
Files not reviewed (1)
- src/Network/Network/Properties/Resources.Designer.cs: Language not supported
| @@ -0,0 +1,2 @@ | |||
| "Module","Sdk","Severity","ProblemId","Description","Remediation" | |||
| "Az.Network","src/Network/Network.Management.Sdk","1","9090","Generated code for Az.Network is not up to date or you have updated generated Sdk.","You may need to rebase on the latest main, regenerate code accroding to README.md file under src/Network/Network.Management.Sdk, and make sure no more updates based on generated files." | |||
Comment on lines
+70
to
+77
| public void IsParentVirtualHubPresent(string resourceGroupName, string parentHubName) | ||
| { | ||
| PSVirtualHub resolvedVirtualHub = new VirtualHubBaseCmdlet().GetVirtualHub(resourceGroupName, parentHubName); | ||
| if (resolvedVirtualHub == null) | ||
| { | ||
| throw new PSArgumentException(Properties.Resources.ParentVirtualHubNotFound); | ||
| } | ||
| } |
Comment on lines
+92
to
+97
| else if (ParameterSetName.Contains(CortexParameterSetNames.ByVirtualHubResourceId)) | ||
| { | ||
| var parsedResourceId = new ResourceIdentifier(this.ParentResourceId); | ||
| this.ResourceGroupName = parsedResourceId.ResourceGroupName; | ||
| this.ParentResourceName = parsedResourceId.ResourceName; | ||
| } |
Comment on lines
+81
to
+84
| [Parameter( | ||
| Mandatory = false, | ||
| HelpMessage = "Flag to enable internet security for this connection policy.")] | ||
| public SwitchParameter EnableInternetSecurity { get; set; } |
Comment on lines
+104
to
+107
| if (string.IsNullOrWhiteSpace(this.ResourceId)) | ||
| { | ||
| throw new PSArgumentException(Properties.Resources.ConnectionPolicyNotFound); | ||
| } |
Comment on lines
+2114
to
+2117
| # Update the ConnectionPolicy | ||
| $connectionPolicy = Set-AzConnectionPolicy -ResourceGroupName $rgName -ParentResourceName $virtualHubName -Name $policyName | ||
| $connectionPolicy = Get-AzConnectionPolicy -ResourceGroupName $rgName -HubName $virtualHubName -Name $policyName | ||
| Assert-AreEqual $policyName $connectionPolicy.Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add CRUD cmdlets for
ConnectionPolicy, a new nested resource underVirtualHubinAz.Network(API version2025-07-01).New cmdlets:
Get-AzConnectionPolicyNew-AzConnectionPolicySet-AzConnectionPolicyRemove-AzConnectionPolicyImplemented following the
RoutingIntentpattern. Includes SDK layer, PS model, AutoMapper mappings, module manifest export, and help files.Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.