Share via


Virtual Networks - Update

Allows modifying tags of virtual networks. All other properties will be ignored.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}?api-version=2018-09-15

URI Parameters

Name In Required Type Description
labName
path True

string

The name of the lab.

name
path True

string

The name of the virtual network.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
tags

object

The tags of the resource.

Responses

Name Type Description
200 OK

VirtualNetwork

Azure operation completed successfully.

Other Status Codes

ErrorResponse

An unexpected error response.

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

VirtualNetworks_Update

Sample request

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}?api-version=2018-09-15

{
  "tags": {
    "tagName1": "tagValue1"
  }
}

Sample response

{
  "name": "{virtualNetworkName}",
  "type": "Microsoft.DevTestLab/labs/virtualNetworks",
  "id": "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}",
  "properties": {
    "createdDate": "2018-10-01T13:01:44.6005134-07:00",
    "externalProviderResourceId": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}",
    "provisioningState": "Succeeded",
    "subnetOverrides": [
      {
        "labSubnetName": "{virtualNetworkName}Subnet",
        "resourceId": "/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{virtualNetworkName}Subnet",
        "sharedPublicIpAddressConfiguration": {
          "allowedPorts": [
            {
              "backendPort": 3389,
              "transportProtocol": "Tcp"
            },
            {
              "backendPort": 22,
              "transportProtocol": "Tcp"
            }
          ]
        },
        "useInVmCreationPermission": "Allow",
        "usePublicIpAddressPermission": "Allow"
      }
    ],
    "uniqueIdentifier": "{uniqueIdentifier}"
  },
  "tags": {
    "tagName1": "tagValue1"
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ExternalSubnet

Subnet information as returned by the Microsoft.Network API.

Port

Properties of a network port.

Subnet

Subnet information.

SubnetOverride

Property overrides on a subnet of a virtual network.

SubnetSharedPublicIpAddressConfiguration

Configuration for public IP address sharing.

systemData

Metadata pertaining to creation and last modification of the resource.

TransportProtocol

The transport protocol for the endpoint.

UsagePermissionType

The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).

VirtualNetwork

A virtual network.

VirtualNetworkFragment

A virtual network.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ExternalSubnet

Subnet information as returned by the Microsoft.Network API.

Name Type Description
id

string

Gets or sets the identifier.

name

string

Gets or sets the name.

Port

Properties of a network port.

Name Type Description
backendPort

integer (int32)

Backend port of the target virtual machine.

transportProtocol

TransportProtocol

Protocol type of the port.

Subnet

Subnet information.

Name Type Description
allowPublicIp

UsagePermissionType

The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).

labSubnetName

string

The name of the subnet as seen in the lab.

resourceId

string

The resource ID of the subnet.

SubnetOverride

Property overrides on a subnet of a virtual network.

Name Type Description
labSubnetName

string

The name given to the subnet within the lab.

resourceId

string

The resource ID of the subnet.

sharedPublicIpAddressConfiguration

SubnetSharedPublicIpAddressConfiguration

Properties that virtual machines on this subnet will share.

useInVmCreationPermission

UsagePermissionType

Indicates whether this subnet can be used during virtual machine creation (i.e. Allow, Deny).

usePublicIpAddressPermission

UsagePermissionType

Indicates whether public IP addresses can be assigned to virtual machines on this subnet (i.e. Allow, Deny).

virtualNetworkPoolName

string

The virtual network pool associated with this subnet.

SubnetSharedPublicIpAddressConfiguration

Configuration for public IP address sharing.

Name Type Description
allowedPorts

Port[]

Backend ports that virtual machines on this subnet are allowed to expose

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

TransportProtocol

The transport protocol for the endpoint.

Value Description
Tcp
Udp

UsagePermissionType

The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).

Value Description
Default
Deny
Allow

VirtualNetwork

A virtual network.

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

location

string

The geo-location where the resource lives

name

string

The name of the resource

properties.allowedSubnets

Subnet[]

The allowed subnets of the virtual network.

properties.createdDate

string (date-time)

The creation date of the virtual network.

properties.description

string

The description of the virtual network.

properties.externalProviderResourceId

string

The Microsoft.Network resource identifier of the virtual network.

properties.externalSubnets

ExternalSubnet[]

The external subnet properties.

properties.provisioningState

string

The provisioning status of the resource.

properties.subnetOverrides

SubnetOverride[]

The subnet overrides of the virtual network.

properties.uniqueIdentifier

string

The unique immutable identifier of a resource (Guid).

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

tags

object

Resource tags.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

VirtualNetworkFragment

A virtual network.

Name Type Description
tags

object

The tags of the resource.