Virtual Routers - List

Gets all the Virtual Routers in a subscription.

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters?api-version=2024-01-01

URI Parameters

Name In Required Type Description
subscriptionId
path True

string

The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Client API version.

Responses

Name Type Description
200 OK

VirtualRouterListResult

Success. The operation returns a list of Virtual Router resources.

Other Status Codes

Error

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

List all Virtual Routers for a given subscription

Sample request

GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Network/virtualRouters?api-version=2024-01-01

Sample response

{
  "value": [
    {
      "name": "virtualRouter",
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter",
      "type": "Microsoft.Network/virtualRouters",
      "etag": "w/\\00000000-0000-0000-0000-000000000000\\",
      "location": "West US",
      "tags": {
        "key1": "value1"
      },
      "properties": {
        "provisioningState": "Succeeded",
        "virtualRouterAsn": 10000,
        "virtualRouterIps": [
          "192.168.1.1",
          "192.168.1.2"
        ],
        "hostedGateway": {
          "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway"
        },
        "peerings": [
          {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualRouters/virtualRouter/peerings/peering1"
          }
        ]
      }
    }
  ]
}

Definitions

Name Description
Error

Common error representation.

ErrorDetails

Common error details representation.

ProvisioningState

The current provisioning state.

SubResource

Reference to another subresource.

VirtualRouter

VirtualRouter Resource.

VirtualRouterListResult

Response for ListVirtualRouters API service call.

Error

Common error representation.

Name Type Description
code

string

Error code.

details

ErrorDetails[]

Error details.

innerError

string

Inner error message.

message

string

Error message.

target

string

Error target.

ErrorDetails

Common error details representation.

Name Type Description
code

string

Error code.

message

string

Error message.

target

string

Error target.

ProvisioningState

The current provisioning state.

Name Type Description
Deleting

string

Failed

string

Succeeded

string

Updating

string

SubResource

Reference to another subresource.

Name Type Description
id

string

Resource ID.

VirtualRouter

VirtualRouter Resource.

Name Type Description
etag

string

A unique read-only string that changes whenever the resource is updated.

id

string

Resource ID.

location

string

Resource location.

name

string

Resource name.

properties.hostedGateway

SubResource

The Gateway on which VirtualRouter is hosted.

properties.hostedSubnet

SubResource

The Subnet on which VirtualRouter is hosted.

properties.peerings

SubResource[]

List of references to VirtualRouterPeerings.

properties.provisioningState

ProvisioningState

The provisioning state of the resource.

properties.virtualRouterAsn

integer

VirtualRouter ASN.

properties.virtualRouterIps

string[]

VirtualRouter IPs.

tags

object

Resource tags.

type

string

Resource type.

VirtualRouterListResult

Response for ListVirtualRouters API service call.

Name Type Description
nextLink

string

URL to get the next set of results.

value

VirtualRouter[]

List of Virtual Routers.