Skip to content

fix(azure)!: migrate network cluster to new Azure SDK (batch 2/5)#1741

Open
james00012 wants to merge 3 commits intomainfrom
fix/azure-sdk-batch2-network
Open

fix(azure)!: migrate network cluster to new Azure SDK (batch 2/5)#1741
james00012 wants to merge 3 commits intomainfrom
fix/azure-sdk-batch2-network

Conversation

@james00012
Copy link
Copy Markdown
Contributor

Summary

Second batch of the incremental Azure SDK migration. Migrates the network cluster from deprecated azure-sdk-for-go v51 to armnetwork/v6.

  • Migrate nsg.go, networkinterface.go, publicaddress.go, loadbalancer.go, virtualnetwork.go to armnetwork/v6
  • Add getArmNetworkClientFactory() and new client creators (CreateLoadBalancerFrontendIPConfigClientE, CreateNetworkManagementClientE)
  • Update safePtrToList in common.go from (*[]string) to ([]*string) to match new SDK conventions
  • Replace old iterator pagination with NewListPager/More/NextPage pattern
  • Add unit tests for NSG rule collection using fake servers
  • Remove deprecated non-Context/non-E function variants

Breaking changes: public return types changed, property access paths changed, safePtrToList signature changed.

Follows #1740 (batch 1: compute cluster).

Test plan

  • go build ./modules/azure/... passes
  • go test ./modules/azure/... — all unit tests pass
  • golangci-lint run ./modules/azure/... — 0 issues
  • Integration tests compile with -tags azure

Migrate nsg, networkinterface, publicaddress, loadbalancer, and
virtualnetwork modules from the deprecated azure-sdk-for-go v51 to
azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6.

Breaking changes:
- Public return types changed (e.g. network.DefaultSecurityRulesClient →
  armnetwork.DefaultSecurityRulesClient)
- Deprecated non-Context/non-E function variants removed
- Property access paths changed (e.g. avs.VirtualMachines →
  resp.Properties.VirtualMachines)
- safePtrToList signature changed from (*[]string) to ([]*string)

Also:
- Add getArmNetworkClientFactory() and new client creators
  (CreateLoadBalancerFrontendIPConfigClientE, CreateNetworkManagementClientE)
- Replace old iterator pagination with NewListPager/More/NextPage pattern
- Add unit tests for NSG rule collection using fake servers
Address review feedback from #1740 — adds tests for
listVirtualMachineProperties, extractVMManagedDisks,
extractVMOSDiskName, and extractVMSize.
The stubbed integration tests (behind build tags) still called removed
deprecated functions and would fail to compile with -tags azure. Updated
all network test stubs to use ContextE variants. Also fixed
terraform_azure_nsg_example_test.go calling removed GetAllNSGRulesE.
james00012 added a commit that referenced this pull request Apr 8, 2026
Complete the migration of all remaining Azure modules from the
deprecated azure-sdk-for-go v51 to the actively maintained modular
ARM SDK packages.

Migrated services (batch 4):
- containers → armcontainerinstance/v2, armcontainerregistry
- aks → armcontainerservice/v6
- frontdoor → armfrontdoor
- monitor/actiongroup → armmonitor
- loganalytics → armoperationalinsights/v2
- privatednszone → armprivatedns
- recoveryservices → armrecoveryservices/v2, armrecoveryservicesbackup/v4
- subscription → armsubscriptions
- region, resourcegroup, resourcegroupv2 → armresources, armsubscriptions

Cleanup (batch 5):
- Remove authorizer.go (NewAuthorizer no longer needed)
- Remove all old SDK imports from client_factory.go
- Remove deprecated non-Context/non-E variants across all modules
- Refactor all factory functions to use newArmCredential/newArmClientOptions
- Delete deprecated wrapper functions (appService, keyvault, mysql,
  postgresql, sql, sql_managedinstance, container_apps, datafactory)

Note: This PR includes changes from batches 2 (network) and 3 (data)
since those PRs (#1741, #1742) haven't merged yet. After they merge,
rebase this branch to shrink the diff to only batch 4+5 changes.
james00012 added a commit that referenced this pull request Apr 8, 2026
Complete the migration of all remaining Azure modules from the
deprecated azure-sdk-for-go v51 to the actively maintained modular
ARM SDK packages.

Migrated services (batch 4):
- containers → armcontainerinstance/v2, armcontainerregistry
- aks → armcontainerservice/v6
- frontdoor → armfrontdoor
- monitor/actiongroup → armmonitor
- loganalytics → armoperationalinsights/v2
- privatednszone → armprivatedns
- recoveryservices → armrecoveryservices/v2, armrecoveryservicesbackup/v4
- subscription → armsubscriptions
- region, resourcegroup, resourcegroupv2 → armresources, armsubscriptions

Cleanup (batch 5):
- Remove authorizer.go (NewAuthorizer no longer needed)
- Remove all old SDK imports from client_factory.go
- Remove deprecated non-Context/non-E variants across all modules
- Refactor all factory functions to use newArmCredential/newArmClientOptions
- Delete deprecated wrapper functions (appService, keyvault, mysql,
  postgresql, sql, sql_managedinstance, container_apps, datafactory)

Note: This PR includes changes from batches 2 (network) and 3 (data)
since those PRs (#1741, #1742) haven't merged yet. After they merge,
rebase this branch to shrink the diff to only batch 4+5 changes.
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.

1 participant