Skip to content

Add 101-standard-service-endpoint-storage quickstart sample - #488

Draft
asudbring wants to merge 2 commits into
Azure:masterfrom
asudbring:terraform/101-service-endpoint-storage
Draft

Add 101-standard-service-endpoint-storage quickstart sample#488
asudbring wants to merge 2 commits into
Azure:masterfrom
asudbring:terraform/101-service-endpoint-storage

Conversation

@asudbring

@asudbring asudbring commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Adds a quickstart sample for a standard service endpoint for Azure Storage.

A standard service endpoint connects IaaS workloads to PaaS resources using a network identifier (a public IP address) and a network security perimeter, rather than subnet-scoped ACLs. This addresses the scale limits of basic service endpoints: one public IP can represent many virtual networks and subnets in the same region and subscription.

Sample directory: quickstart/101-standard-service-endpoint-storage/

Resources

Resource Purpose
Virtual network and subnet Hosts the IaaS workload
Public IP prefix and public IP Network identifier for the service endpoint
Subnet service endpoint (azapi) Associates the network identifier with Microsoft.Storage
NAT gateway and public IP Outbound connectivity for the VM
Linux VM and NIC IaaS workload, private IP only
Storage account and file share PaaS resource behind the endpoint
Network security perimeter, profile, association Secures the storage account
Perimeter inbound access rule Authorizes the network identifier prefix

Notes for reviewers

  • The subnet is created with the azapi provider because the service endpoint networkIdentifier property is not exposed by azurerm. It is available in the stable ARM API Microsoft.Network/virtualNetworks/subnets@2025-07-01.
  • Standard service endpoint is in public preview behind the AllowServiceEndpointNetworkIdentifier feature flag. The readme documents the self-serve registration commands. CI will need this feature registered on the test subscription, or this sample will fail to deploy. Happy to hold this PR until the feature is GA if that is preferred.
  • The perimeter association defaults to Learning mode (logs, does not block), which is the recommended starting posture. nsp_access_mode can be set to Enforced.
  • Default location is eastus2.

Verification

terraform apply and terraform destroy run against a subscription with the preview feature registered.

  • 21 resources created, 21 destroyed, resource group confirmed removed.
  • Subnet service endpoint after apply:
{
  "service": "Microsoft.Storage",
  "networkIdentifier": {
    "id": ".../providers/Microsoft.Network/publicIPAddresses/public-ip-1"
  },
  "provisioningState": "Succeeded"
}
  • Perimeter association: assoc-storage, mode Learning, state Succeeded.
  • Perimeter inbound rule: allow-se-standard, direction Inbound, prefix matching the allocated network identifier range.

terraform fmt applied; terraform validate passes.


Revision history

The initial revision of this PR configured a basic virtual network service endpoint (subnet.service_endpoints plus storage network rules) and named it after the standard service endpoint feature. Those are different features. The sample has been rewritten to implement the standard service endpoint, and the directory renamed accordingly.

Adds a Terraform quickstart that deploys a virtual network with a subnet
that has a Microsoft.Storage service endpoint, a Standard static public IP
that serves as the network identifier, a Linux virtual machine, and an
Azure Storage account restricted to the subnet.

Test-deployed and torn down against two Azure subscriptions in eastus2.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@asudbring

Copy link
Copy Markdown
Contributor Author

Companion Terraform quickstart article PR: MicrosoftDocs/azure-docs-pr#319044 (internal). The article references this sample via quickstart/101-service-endpoint-storage.

@asudbring
asudbring marked this pull request as draft August 5, 2026 03:53
…dpoint

The original sample configured a basic virtual network service endpoint
(subnet service_endpoints plus storage network rules) and named it after
the standard service endpoint feature. Those are different features.

A standard service endpoint requires a network identifier associated with
the subnet service endpoint, and a network security perimeter that
authorizes that identifier with an IP-based inbound access rule. None of
that was present.

Changes:
- Rename sample to 101-standard-service-endpoint-storage
- Associate a public IP address as the service endpoint networkIdentifier
  via azapi (the azurerm provider does not expose this property)
- Add public IP prefix backing the network identifier
- Add network security perimeter, profile, association, and inbound
  access rule matching the network identifier prefix
- Add NAT gateway for VM outbound connectivity
- Add storage file share for connectivity validation
- Drop subnet-scoped storage network rules; the perimeter governs access
- Pin azapi to ~>2.0 to match the object-syntax body already in use
- Default location to eastus2

Verified: terraform apply and destroy against a subscription with the
AllowServiceEndpointNetworkIdentifier feature registered. 21 resources
created and destroyed. Subnet serviceEndpoints reported networkIdentifier
associated with provisioningState Succeeded.
@asudbring asudbring changed the title Add 101-service-endpoint-storage quickstart sample Add 101-standard-service-endpoint-storage quickstart sample Aug 5, 2026
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