When setting up Discovery options for Azure discovery or visibility, you can configure Virtual Network tag filters. These let you exclude Azure Virtual Networks based on the Azure tags associated with them within Microsoft Azure.
For more details on editing the Discovery options, see Updating existing Schedule manager settings and Updating existing Visibility job settings.
You can edit and assign tags to a network when setting up a Virtual Network in Microsoft
Azure. Tags are listed as key/value pairs, such as role:primary (a tag
key of role and a value of primary).
Within Cloud Discovery & Visibility (CDV), you specify a list of Microsoft Azure tags and tag values. During Discovery (and Visibility), when CDV encounters a Virtual Network with an Azure tag that matches one of the tag keys and tag values, CDV does not include it in discovery or visibiltiy.
Using tag filters in API endpoints
Some CDV API endpoints for Microsoft Azure infrastructures now support the
tag_filter field. This field lets you specify a tag filter to
apply to Azure Virtual Networks to exclude matching networks from jobs in the
Schedule Manager or Visibility manager.
API endpoints that use the tag_filter field:
POST azure/discoveryPUT /schedule/{schedule_id}/tag-filterPUT /visibility-manager/{visibility_manager_id}/tag-filter
The format of the tag_filter field is as follows:
{
"private_networks":{
"exclude_tags":{
"<Tag key 1>":[
"<Tag value 1>",
"<Tag value 2>"
],
"<Tag key 2>":[
"<Tag value 3>"
]
}
}
}
Here, tag key 1 and tag key 2 are the tag keys of the tags by which you want to filter. The values tag value 1, tag value 2, and tag value 3 are the values to exclude for their associated tag keys. You can include as many tag keys and tag values as you want.
\) or quotation mark (") in the tag key or
value, you must precede it with a backslash character. For example, if you want to
exclude networks with a tag key of MusicFolder and a tag value of
\jazz, you could use: {
"private_networks":{
"exclude_tags":{
"MusicFolder":[
"\\jazz"
]
}
}
}