Azure Networking Subnets API

Operations for managing subnets within a virtual network, including creation, configuration, and delegation.

OpenAPI Specification

microsoft-azure-networking-subnets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Azure Networking Azure Load Balancer Backend Address Pools Subnets API
  description: Distribute traffic across multiple virtual machines and services with Azure Load Balancer. This API provides operations for creating, configuring, and managing load balancers including frontend IP configurations, backend address pools, health probes, load balancing rules, inbound NAT rules, and outbound rules.
  version: '2024-05-01'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/
  license:
    name: Microsoft API License
    url: https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use
servers:
- url: https://management.azure.com
  description: Azure Resource Manager
security:
- OAuth2Auth: []
tags:
- name: Subnets
  description: Operations for managing subnets within a virtual network, including creation, configuration, and delegation.
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets
  : get:
      operationId: Subnets_List
      summary: Azure Networking List subnets
      description: Gets all subnets in a virtual network. Returns a paginated list of subnet resources within the specified virtual network.
      tags:
      - Subnets
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/VirtualNetworkNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully retrieved the list of subnets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubnetListResult'
        '401':
          description: Unauthorized. Authentication credentials are missing or invalid.
        '404':
          description: Virtual network not found.
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}
  : get:
      operationId: Subnets_Get
      summary: Azure Networking Get subnet
      description: Gets the specified subnet by virtual network and subnet name. Returns the full resource representation including address prefix, network security group, and route table associations.
      tags:
      - Subnets
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/VirtualNetworkNameParameter'
      - $ref: '#/components/parameters/SubnetNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully retrieved the subnet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subnet'
        '401':
          description: Unauthorized. Authentication credentials are missing or invalid.
        '404':
          description: Subnet not found.
    put:
      operationId: Subnets_CreateOrUpdate
      summary: Azure Networking Create or update subnet
      description: Creates a new subnet or updates an existing subnet within the specified virtual network. The address prefix must be within the virtual network address space.
      tags:
      - Subnets
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/VirtualNetworkNameParameter'
      - $ref: '#/components/parameters/SubnetNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Subnet'
      responses:
        '200':
          description: Successfully updated the subnet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subnet'
        '201':
          description: Successfully created the subnet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subnet'
        '400':
          description: Bad request. The request body is invalid.
        '401':
          description: Unauthorized. Authentication credentials are missing or invalid.
    delete:
      operationId: Subnets_Delete
      summary: Azure Networking Delete subnet
      description: Deletes the specified subnet from the virtual network.
      tags:
      - Subnets
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - $ref: '#/components/parameters/VirtualNetworkNameParameter'
      - $ref: '#/components/parameters/SubnetNameParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully deleted the subnet.
        '202':
          description: Accepted. The delete operation is in progress.
        '204':
          description: No content. The subnet does not exist.
        '401':
          description: Unauthorized. Authentication credentials are missing or invalid.
components:
  schemas:
    Subnet:
      type: object
      description: Subnet in a virtual network resource.
      properties:
        id:
          type: string
          readOnly: true
          description: Resource ID.
        name:
          type: string
          description: The name of the resource.
        properties:
          type: object
          description: Properties of the subnet.
          properties:
            addressPrefix:
              type: string
              description: The address prefix for the subnet.
            addressPrefixes:
              type: array
              items:
                type: string
              description: List of address prefixes for the subnet.
            networkSecurityGroup:
              type: object
              description: The reference to the network security group resource.
              properties:
                id:
                  type: string
                  description: Resource ID.
            routeTable:
              type: object
              description: The reference to the route table resource.
              properties:
                id:
                  type: string
                  description: Resource ID.
            natGateway:
              type: object
              description: NAT gateway associated with this subnet.
              properties:
                id:
                  type: string
                  description: Resource ID.
            serviceEndpoints:
              type: array
              items:
                type: object
                properties:
                  service:
                    type: string
                    description: The type of the endpoint service.
                  locations:
                    type: array
                    items:
                      type: string
                    description: A list of locations.
                  provisioningState:
                    type: string
                    readOnly: true
                    description: The provisioning state of the service endpoint.
              description: An array of service endpoints.
            delegations:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Resource ID.
                  name:
                    type: string
                    description: The name of the resource.
                  properties:
                    type: object
                    properties:
                      serviceName:
                        type: string
                        description: The name of the service to whom the subnet should be delegated.
              description: An array of references to the delegations on the subnet.
            privateEndpointNetworkPolicies:
              type: string
              description: Enable or disable network policies on private endpoints in the subnet.
              enum:
              - Enabled
              - Disabled
            privateLinkServiceNetworkPolicies:
              type: string
              description: Enable or disable network policies on private link service in the subnet.
              enum:
              - Enabled
              - Disabled
            provisioningState:
              type: string
              readOnly: true
              description: The provisioning state of the subnet resource.
    SubnetListResult:
      type: object
      description: Response for the ListSubnets API service call.
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/Subnet'
          description: The subnets in a virtual network.
        nextLink:
          type: string
          description: The URL to get the next set of results.
  parameters:
    VirtualNetworkNameParameter:
      name: virtualNetworkName
      in: path
      required: true
      description: The name of the virtual network.
      schema:
        type: string
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      required: true
      description: The subscription credentials which uniquely identify the Microsoft Azure subscription.
      schema:
        type: string
    SubnetNameParameter:
      name: subnetName
      in: path
      required: true
      description: The name of the subnet.
      schema:
        type: string
    ApiVersionParameter:
      name: api-version
      in: query
      required: true
      description: Client API version.
      schema:
        type: string
        default: '2024-05-01'
    ResourceGroupNameParameter:
      name: resourceGroupName
      in: path
      required: true
      description: The name of the resource group.
      schema:
        type: string
  securitySchemes:
    OAuth2Auth:
      type: oauth2
      description: Azure Active Directory OAuth2 Flow
      flows:
        implicit:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
          scopes:
            user_impersonation: Access Azure Load Balancer API
externalDocs:
  description: Azure Load Balancer REST API Documentation
  url: https://learn.microsoft.com/en-us/rest/api/load-balancer/