Skip to content

feat(azure-network): Public IP Prefixes - #911

Open
NitinKumar004 wants to merge 1 commit into
developmentfrom
feat/azure-public-ip-prefixes
Open

feat(azure-network): Public IP Prefixes#911
NitinKumar004 wants to merge 1 commit into
developmentfrom
feat/azure-public-ip-prefixes

Conversation

@NitinKumar004

Copy link
Copy Markdown
Collaborator

What

Adds Microsoft.Network/publicIPPrefixes (CRUD + list) to the Azure vnet wire handler, driven end-to-end by the real armnetwork.PublicIPPrefixesClient.

  • On create the provider synthesizes properties.ipPrefix — a CIDR of the requested prefixLength carved from a deterministic 10.0.0.0/8 allocator (monotonic /24 block counter, no randomness). prefixLength defaults to 28 when omitted and is immutable on re-PUT.
  • sku is top-level (Standard/StandardV2, tier Regional), echoed back on GET.
  • Read-only publicIPAddresses[] back-reference: rebuilt by scanning public IPs whose publicIPPrefix ref matches this prefix. A public IP created with a publicIPPrefix ref only stores the ref (child-IP allocation from the prefix range is deferred); the public IP echoes the prefix on its own GET.

Architecture fit

  • LRO: PUT + DELETE ride the vnet handler's existing async plumbing (writeAcceptedAsync + the locations/operationStatuses responder) — the same pattern as NAT gateways, so BeginCreateOrUpdate/BeginDelete pollers terminate cleanly.
  • Snapshot: new store bolts onto the already-Snapshottable vnet Mock; since the completeness guard only checks the field type, the store was manually added to the provider's snapshot dumps/loads list and a round-trip assertion added to snapshot_test.go.
  • Purge: added to the PurgeResourceGroup cascade so prefixes don't orphan on RG delete.
  • ARG triple (Azure discovery gaps block cost E2E: Container Apps, Azure ML, Storage Account ARG projection #334): type-asserted walker in resourcediscovery, portable TypePublicIPPrefix const, and resourcegraph forward/reverse map entries. All additions are Azure-gated — AWS/GCP ARNs and Resource Graph rows are byte-unchanged (the walker fails the type assertion on AWS/GCP; the arn.go entry only extends the Azure type map).
  • Azure-only surface modeled as an optional, type-asserted AzurePublicIPPrefixes capability on the networking driver (mirrors AzureApplicationSecurityGroups); the cross-cloud driver is not widened.
  • docs/coverage/ regenerated.

Test

Real-SDK e2e through the pollers (server/azure/vnet/public_ip_prefix_test.go):

  • BeginCreateOrUpdate (prefixLength=28) → PollUntilDoneGet round-trips a synthesized ipPrefix of the right size + top-level sku; list; BeginDelete → subsequent Get returns 404.
  • Back-reference test: a public IP created with a publicIPPrefix ref appears in the prefix's read-only publicIPAddresses[] and echoes the prefix.
  • Provider snapshot/restore round-trip asserts the synthesized CIDR + sku survive.

Refs #611.

Add Microsoft.Network/publicIPPrefixes to the vnet wire handler: CRUD + list
through armnetwork's PublicIPPrefixesClient Begin* pollers. On create the
provider synthesizes properties.ipPrefix (a CIDR of the requested prefixLength
carved from a deterministic 10.0.0.0/8 allocator); sku is top-level. The
read-only publicIPAddresses[] back-reference is rebuilt by scanning public IPs
whose publicIPPrefix ref matches; a public IP created with a prefix ref only
stores the ref (child-IP allocation deferred).

- LRO: PUT/DELETE ride the existing writeAcceptedAsync + operationStatuses
  responder (same async plumbing as NAT gateways).
- Store bolted onto the existing vnet Mock, added to the snapshot dumps/loads
  list with a round-trip assertion.
- Added to the PurgeResourceGroup cascade.
- ARG triple (walker, portable Type const, resourcegraph forward/reverse maps),
  all Azure-gated; AWS/GCP ARNs and rows unchanged.
- docs/coverage regenerated.
@NitinKumar004
NitinKumar004 force-pushed the feat/azure-public-ip-prefixes branch from 2c787c0 to e1cd2d3 Compare August 31, 2026 04:45
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