From 5c595cd4fc92086c57370cd30a78e1e8a8b1f1d0 Mon Sep 17 00:00:00 2001 From: Paolo Salvatori Date: Wed, 22 Apr 2026 10:21:02 +0200 Subject: [PATCH 1/2] docs: add Azure Public IP Prefix article (DOC-190) --- .../docs/azure/services/public-ip-prefix.mdx | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 src/content/docs/azure/services/public-ip-prefix.mdx diff --git a/src/content/docs/azure/services/public-ip-prefix.mdx b/src/content/docs/azure/services/public-ip-prefix.mdx new file mode 100644 index 00000000..d02b7bfe --- /dev/null +++ b/src/content/docs/azure/services/public-ip-prefix.mdx @@ -0,0 +1,196 @@ +--- +title: "Public IP Prefix" +description: Get started with Azure Public IP Prefix on LocalStack +template: doc +--- + +import AzureFeatureCoverage from "../../../../components/feature-coverage/AzureFeatureCoverage"; + +## Introduction + +Azure Public IP Prefix is a contiguous range of Standard SKU static public IP addresses. +When you create a public IP address from a prefix, the address is guaranteed to stay within the prefix range, making it useful for allow-listing IP ranges in external firewalls. +Public IP Prefixes are commonly used with NAT Gateway to provide predictable outbound IP addresses for entire subnets. For more information, see [Public IP address prefixes](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-address-prefix). + +LocalStack for Azure provides a local environment for building and testing applications that make use of Public IP Prefixes. +The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of Public IP Prefix's integration with LocalStack. + +## Getting started + +This guide is designed for users new to Public IP Prefixes and assumes basic knowledge of the Azure CLI and our `azlocal` wrapper script. + +Launch LocalStack using your preferred method. For more information, see [Introduction to LocalStack for Azure](/azure/getting-started/). Once the container is running, enable Azure CLI interception by running: + +```bash +azlocal start-interception +``` + +This command points the `az` CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API. +To revert this configuration, run: + +```bash +azlocal stop-interception +``` + +This reconfigures the `az` CLI to send commands to the official Azure management REST API. + +### Create a resource group + +Create a resource group to hold all resources created in this guide: + +```bash +az group create \ + --name rg-pip-prefix-demo \ + --location westeurope +``` + +```bash title="Output" +{ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo", + "location": "westeurope", + "managedBy": null, + "name": "rg-pip-prefix-demo", + "properties": { + "provisioningState": "Succeeded" + }, + "tags": null, + "type": "Microsoft.Resources/resourceGroups" +} +``` + +### Create a public IP prefix + +Create a /29 public IP prefix (8 IP addresses): + +```bash +az network public-ip prefix create \ + --name pip-prefix-demo \ + --resource-group rg-pip-prefix-demo \ + --location westeurope \ + --length 29 +``` + +```bash title="Output" +{ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo/providers/Microsoft.Network/publicIPPrefixes/pip-prefix-demo", + "ipPrefix": "20.184.13.0/29", + "ipTags": [], + "location": "westeurope", + "name": "pip-prefix-demo", + "prefixLength": 29, + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4", + "resourceGroup": "rg-pip-prefix-demo", + "sku": { + "name": "Standard", + "tier": "Regional" + }, + "type": "Microsoft.Network/publicIPPrefixes", + "zones": [] +... +} +``` + +### Get and list public IP prefixes + +Retrieve the details of the public IP prefix and list all prefixes in the resource group: + +```bash +az network public-ip prefix show \ + --name pip-prefix-demo \ + --resource-group rg-pip-prefix-demo +``` + +```bash title="Output" +{ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo/providers/Microsoft.Network/publicIPPrefixes/pip-prefix-demo", + "ipPrefix": "20.184.13.0/29", + "ipTags": [], + "location": "westeurope", + "name": "pip-prefix-demo", + "prefixLength": 29, + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4", + "resourceGroup": "rg-pip-prefix-demo", + "sku": { + "name": "Standard", + "tier": "Regional" + }, + "type": "Microsoft.Network/publicIPPrefixes", + "zones": [] +... +} +``` + +Then list all public IP prefixes in the resource group: + +```bash +az network public-ip prefix list \ + --resource-group rg-pip-prefix-demo +``` + +```bash title="Output" +[ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo/providers/Microsoft.Network/publicIPPrefixes/pip-prefix-demo", + "ipPrefix": "20.184.13.0/29", + "ipTags": [], + "location": "westeurope", + "name": "pip-prefix-demo", + "prefixLength": 29, + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4", + "resourceGroup": "rg-pip-prefix-demo", + "sku": { "name": "Standard", "tier": "Regional" }, + "type": "Microsoft.Network/publicIPPrefixes", + "zones": [] + } +] +``` + +### Delete the public IP prefix + +Delete the public IP prefix and verify it no longer appears in the list: + +```bash +az network public-ip prefix delete \ + --name pip-prefix-demo \ + --resource-group rg-pip-prefix-demo +``` + +Then list all public IP prefixes to confirm the resource group is now empty: + +```bash +az network public-ip prefix list --resource-group rg-pip-prefix-demo +``` + +```bash title="Output" +[] +``` + +## Features + +The Public IP Prefix emulator supports the following features: + +- **Create and manage prefixes**: Full lifecycle management including create, get, update, list, and delete. +- **Configurable prefix length**: Set any prefix length from /28 to /31 to define the size of the IP range. +- **Tags**: Apply and update resource tags on public IP prefix resources. +- **Subscription-scoped listing**: List all public IP prefixes across a subscription. +- **Multiple prefix lengths**: Create prefixes of different lengths within the same resource group. + +## Limitations + +- **No real IP range allocation**: Public IP Prefix is a mock implementation. No actual IP address ranges are allocated from Azure's public IP pools, and no public internet connectivity is provided. +- **No IP address derivation**: Creating individual public IP addresses from a prefix is not enforced; both resources are stored independently. +- **No data persistence**: Public IP prefix resources are not persisted and are lost when the emulator is stopped or restarted. + +## Samples + +The following samples demonstrate how to use Azure Public IP Prefixes with LocalStack for Azure: + +- [Function App and Service Bus](https://github.com/localstack/localstack-azure-samples/tree/main/samples/function-app-service-bus/dotnet/) +- [Web App and Cosmos DB for MongoDB API ](https://github.com/localstack/localstack-azure-samples/samples/web-app-cosmosdb-mongodb-api/python/README.md) + +## API Coverage + + From 60796d55136edbe6aea0c7ca019b903bc3b66995 Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Fri, 8 May 2026 16:19:11 -0400 Subject: [PATCH 2/2] Minor accuracy updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Adjusted in the MDX** 1. **Illustrative Public IP Prefix JSON** – Azure’s REST examples put **`ipPrefix`**, **`prefixLength`**, **`provisioningState`**, **`publicIPAddressVersion`**, **`ipTags`**, etc., under **`properties`**, not at the resource root ([GET example](https://learn.microsoft.com/en-us/rest/api/virtualnetwork/public-ip-prefixes/get)). The samples were updated to that nesting; **`sku.name` / `tier: Regional`** remain valid (`PublicIPPrefixSku`). 2. **Prefix length bullet** – Azure documents **IPv4 `/28–/31`** and **IPv6 `/124–/127`** with parallel address counts ([prefix sizes](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-address-prefix#prefix-sizes)). The feature line now spells that out and links there. 3. **Cosmos sample link** – The URL pointed at an invalid GitHub path; it now matches **`tree/main/samples/web-app-cosmosdb-mongodb-api/python/`** like your other Azure pages. --- .../docs/azure/services/public-ip-prefix.mdx | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/src/content/docs/azure/services/public-ip-prefix.mdx b/src/content/docs/azure/services/public-ip-prefix.mdx index d02b7bfe..f7c9177e 100644 --- a/src/content/docs/azure/services/public-ip-prefix.mdx +++ b/src/content/docs/azure/services/public-ip-prefix.mdx @@ -73,13 +73,17 @@ az network public-ip prefix create \ ```bash title="Output" { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo/providers/Microsoft.Network/publicIPPrefixes/pip-prefix-demo", - "ipPrefix": "20.184.13.0/29", - "ipTags": [], "location": "westeurope", "name": "pip-prefix-demo", - "prefixLength": 29, - "provisioningState": "Succeeded", - "publicIPAddressVersion": "IPv4", + "properties": { + "ipPrefix": "20.184.13.0/29", + "ipTags": [], + "prefixLength": 29, + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4", + "resourceGuid": "00000000-0000-0000-0000-000000000000" + ... + }, "resourceGroup": "rg-pip-prefix-demo", "sku": { "name": "Standard", @@ -87,7 +91,7 @@ az network public-ip prefix create \ }, "type": "Microsoft.Network/publicIPPrefixes", "zones": [] -... + ... } ``` @@ -104,13 +108,17 @@ az network public-ip prefix show \ ```bash title="Output" { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo/providers/Microsoft.Network/publicIPPrefixes/pip-prefix-demo", - "ipPrefix": "20.184.13.0/29", - "ipTags": [], "location": "westeurope", "name": "pip-prefix-demo", - "prefixLength": 29, - "provisioningState": "Succeeded", - "publicIPAddressVersion": "IPv4", + "properties": { + "ipPrefix": "20.184.13.0/29", + "ipTags": [], + "prefixLength": 29, + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4", + "resourceGuid": "00000000-0000-0000-0000-000000000000" + ... + }, "resourceGroup": "rg-pip-prefix-demo", "sku": { "name": "Standard", @@ -118,7 +126,7 @@ az network public-ip prefix show \ }, "type": "Microsoft.Network/publicIPPrefixes", "zones": [] -... + ... } ``` @@ -133,13 +141,15 @@ az network public-ip prefix list \ [ { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-pip-prefix-demo/providers/Microsoft.Network/publicIPPrefixes/pip-prefix-demo", - "ipPrefix": "20.184.13.0/29", - "ipTags": [], "location": "westeurope", "name": "pip-prefix-demo", - "prefixLength": 29, - "provisioningState": "Succeeded", - "publicIPAddressVersion": "IPv4", + "properties": { + "ipPrefix": "20.184.13.0/29", + "ipTags": [], + "prefixLength": 29, + "provisioningState": "Succeeded", + "publicIPAddressVersion": "IPv4" + }, "resourceGroup": "rg-pip-prefix-demo", "sku": { "name": "Standard", "tier": "Regional" }, "type": "Microsoft.Network/publicIPPrefixes", @@ -173,7 +183,7 @@ az network public-ip prefix list --resource-group rg-pip-prefix-demo The Public IP Prefix emulator supports the following features: - **Create and manage prefixes**: Full lifecycle management including create, get, update, list, and delete. -- **Configurable prefix length**: Set any prefix length from /28 to /31 to define the size of the IP range. +- **Configurable prefix length**: For IPv4, set prefix length /28 through /31 to define how many addresses the range contains (/28 = 16, /29 = 8, /30 = 4, /31 = 2 addresses), matching Azure’s [published prefix sizes](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-address-prefix#prefix-sizes). IPv6 uses /124–/127 for the same address counts when you configure an IPv6 prefix in Azure. - **Tags**: Apply and update resource tags on public IP prefix resources. - **Subscription-scoped listing**: List all public IP prefixes across a subscription. - **Multiple prefix lengths**: Create prefixes of different lengths within the same resource group. @@ -189,7 +199,7 @@ The Public IP Prefix emulator supports the following features: The following samples demonstrate how to use Azure Public IP Prefixes with LocalStack for Azure: - [Function App and Service Bus](https://github.com/localstack/localstack-azure-samples/tree/main/samples/function-app-service-bus/dotnet/) -- [Web App and Cosmos DB for MongoDB API ](https://github.com/localstack/localstack-azure-samples/samples/web-app-cosmosdb-mongodb-api/python/README.md) +- [Web App and Cosmos DB for MongoDB API](https://github.com/localstack/localstack-azure-samples/tree/main/samples/web-app-cosmosdb-mongodb-api/python/) ## API Coverage