def create_nsg_rule(access_token, subscription_id, resource_group, nsg_name, nsg_rule_name,<EOL>description, protocol='<STR_LIT>', source_range='<STR_LIT:*>', destination_range='<STR_LIT:*>',<EOL>source_prefix='<STR_LIT:*>', destination_prefix='<STR_LIT:*>', access='<STR_LIT>', priority=<NUM_LIT:100>,<EOL>direction='<STR_LIT>'):
endpoint = '<STR_LIT>'.join([get_rm_endpoint(),<EOL>'<STR_LIT>', subscription_id,<EOL>'<STR_LIT>', resource_group,<EOL>'<STR_LIT>', nsg_name,<EOL>'<STR_LIT>', nsg_rule_name,<EOL>'<STR_LIT>', NETWORK_API])<EOL>properties = {'<STR_LIT:description>': description}<EOL>properties['<STR_LIT>'] = protocol<EOL>properties['<STR_LIT>'] = source_range<EOL>properties['<STR_LIT>'] = destination_range<EOL>properties['<STR_LIT>'] = source_prefix<EOL>properties['<STR_LIT>'] = destination_prefix<EOL>properties['<STR_LIT>'] = access<EOL>properties['<STR_LIT>'] = priority<EOL>properties['<STR_LIT>'] = direction<EOL>ip_body = {'<STR_LIT>': properties}<EOL>body = json.dumps(ip_body)<EOL>return do_put(endpoint, body, access_token)<EOL>
Create network security group rule.

    Args:
        access_token (str): A valid Azure authentication token.
        subscription_id (str): Azure subscription id.
        resource_group (str): Azure resource group name.
        nsg_name (str): Name of the Network Security Group.
        nsg_rule_name (str): Name of the new rule.
        description (str): Description.
        protocol (str): Optional protocol. Default Tcp.
        source_range (str): Optional source IP range. Default '*'.
        destination_range (str): Destination IP range. Default *'.
        source_prefix (str): Source DNS prefix. Default '*'.
        destination_prefix (str): Destination prefix. Default '*'.
        access (str): Allow or deny rule. Default Allow.
        priority: Relative priority. Default 100.
        direction: Inbound or Outbound. Default Inbound.

    Returns:
        HTTP response. NSG JSON rule body.