def create_vnet(access_token, subscription_id, resource_group, name, location,<EOL>address_prefix='<STR_LIT>', subnet_prefix='<STR_LIT>', nsg_id=None):
endpoint = '<STR_LIT>'.join([get_rm_endpoint(),<EOL>'<STR_LIT>', subscription_id,<EOL>'<STR_LIT>', resource_group,<EOL>'<STR_LIT>', name,<EOL>'<STR_LIT>', NETWORK_API])<EOL>vnet_body = {'<STR_LIT:location>': location}<EOL>properties = {'<STR_LIT>': {'<STR_LIT>': [address_prefix]}}<EOL>subnet = {'<STR_LIT:name>': '<STR_LIT>'}<EOL>subnet['<STR_LIT>'] = {'<STR_LIT>': subnet_prefix}<EOL>if nsg_id is not None:<EOL><INDENT>subnet['<STR_LIT>']['<STR_LIT>'] = {'<STR_LIT:id>': nsg_id}<EOL><DEDENT>properties['<STR_LIT>'] = [subnet]<EOL>vnet_body['<STR_LIT>'] = properties<EOL>body = json.dumps(vnet_body)<EOL>return do_put(endpoint, body, access_token)<EOL>
Create a VNet with specified name and location. Optional subnet address prefix..

    Args:
        access_token (str): A valid Azure authentication token.
        subscription_id (str): Azure subscription id.
        resource_group (str): Azure resource group name.
        name (str): Name of the new VNet.
        location (str): Azure data center location. E.g. westus.
        address_prefix (str): Optional VNet address prefix. Default '10.0.0.0/16'.
        subnet_prefix (str): Optional subnet address prefix. Default '10.0.0.0/16'.
        nsg_id (str): Optional Netwrok Security Group resource Id. Default None.

    Returns:
        HTTP response. VNet JSON body.