Skip to content

ConnectionPolicy changes#29655

Open
rchepala wants to merge 1 commit into
Azure:release-network-2025-07-01from
rchepala:rchepala/connectionPolicy
Open

ConnectionPolicy changes#29655
rchepala wants to merge 1 commit into
Azure:release-network-2025-07-01from
rchepala:rchepala/connectionPolicy

Conversation

@rchepala

Copy link
Copy Markdown

Description

Add CRUD cmdlets for ConnectionPolicy, a new nested resource under VirtualHub in Az.Network (API version 2025-07-01).

New cmdlets:

  • Get-AzConnectionPolicy
  • New-AzConnectionPolicy
  • Set-AzConnectionPolicy
  • Remove-AzConnectionPolicy

Implemented following the RoutingIntent pattern. Includes SDK layer, PS model, AutoMapper mappings, module manifest export, and help files.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@azure-client-tools-bot-prd

Copy link
Copy Markdown
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@VeryEarly

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines successfully started running 3 pipeline(s).

@YanaXu

YanaXu commented May 21, 2026

Copy link
Copy Markdown
Contributor

Please don't update auto generated code and fix CI errors.

@rchepala rchepala force-pushed the rchepala/connectionPolicy branch from 5508d63 to 828c1dd Compare June 1, 2026 21:58
@rchepala rchepala force-pushed the rchepala/connectionPolicy branch from 828c1dd to 1f335d4 Compare June 1, 2026 22:01
@rchepala rchepala requested a review from Copilot June 8, 2026 21:03
@rchepala rchepala self-assigned this Jun 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants