Discovery.QueryAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| QueryAsync(QueryConfig, CancellationToken) |
Get data using search. |
| QueryAsync(RequestContent, RequestContext) |
[Protocol Method] Get data using search.
|
QueryAsync(QueryConfig, CancellationToken)
- Source:
- Discovery.cs
Get data using search.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.QueryResult>> QueryAsync(Azure.Analytics.Purview.DataMap.QueryConfig body, System.Threading.CancellationToken cancellationToken = default);
abstract member QueryAsync : Azure.Analytics.Purview.DataMap.QueryConfig * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.QueryResult>>
override this.QueryAsync : Azure.Analytics.Purview.DataMap.QueryConfig * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.QueryResult>>
Public Overridable Function QueryAsync (body As QueryConfig, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of QueryResult))
Parameters
- body
- QueryConfig
Body parameter.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
body is null.
Examples
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "exampledata",
Limit = 10,
Orderby = {BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5719",
["name"] = "ASC"
}), BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5721",
["updateTime"] = "DESC"
})},
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5713",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5714",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "5715",
["entityType"] = "azure_blob_path"
}
}
}),
Facets = {new SearchFacetItem
{
Count = 0,
Facet = "assetType",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "classification",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "contactId",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "label",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "term",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5798",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5799",
["entityType"] = "azure_blob_path"
},
new Dictionary<string, object>
{
["$id"] = "5800",
["attributeName"] = "qualifiedName",
["operator"] = "contains",
["attributeValue"] = ".csv"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5851",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5852",
["entityType"] = "azure_blob_path"
},
new Dictionary<string, object>
{
["$id"] = "5853",
["attributeName"] = "qualifiedName",
["operator"] = "contains",
["attributeValue"] = ".csv"
},
new Dictionary<string, object>
{
["$id"] = "5854",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5855",
["attributeName"] = "name",
["operator"] = "eq",
["attributeValue"] = "exampledata.csv"
},
new Dictionary<string, object>
{
["$id"] = "5856",
["attributeName"] = "qualifiedName",
["operator"] = "prefix",
["attributeValue"] = "https://"
}
}
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5909",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5910",
["assetType"] = "SQL Server"
},
new Dictionary<string, object>
{
["$id"] = "5911",
["assetType"] = "Azure SQL Server"
},
new Dictionary<string, object>
{
["$id"] = "5912",
["assetType"] = "Azure SQL Database"
},
new Dictionary<string, object>
{
["$id"] = "5913",
["assetType"] = "Azure SQL Data Warehouse"
},
new Dictionary<string, object>
{
["$id"] = "5914",
["assetType"] = "Azure SQL Managed Instance"
},
new Dictionary<string, object>
{
["$id"] = "5915",
["assetType"] = "Azure Storage Account"
},
new Dictionary<string, object>
{
["$id"] = "5916",
["assetType"] = "Azure Blob Storage"
},
new Dictionary<string, object>
{
["$id"] = "5917",
["assetType"] = "Azure Files"
},
new Dictionary<string, object>
{
["$id"] = "5918",
["assetType"] = "Azure Table Storage"
},
new Dictionary<string, object>
{
["$id"] = "5919",
["assetType"] = "Azure Data Lake Storage Gen1"
},
new Dictionary<string, object>
{
["$id"] = "5920",
["assetType"] = "Azure Data Lake Storage Gen2"
},
new Dictionary<string, object>
{
["$id"] = "5921",
["assetType"] = "Azure Cosmos DB"
},
new Dictionary<string, object>
{
["$id"] = "5922",
["assetType"] = "Azure Data Factory"
},
new Dictionary<string, object>
{
["$id"] = "5923",
["assetType"] = "Azure Cognitive Search"
},
new Dictionary<string, object>
{
["$id"] = "5924",
["assetType"] = "Power BI"
},
new Dictionary<string, object>
{
["$id"] = "5925",
["assetType"] = "Azure Data Explorer"
},
new Dictionary<string, object>
{
["$id"] = "5926",
["assetType"] = "Amazon S3"
},
new Dictionary<string, object>
{
["$id"] = "5927",
["assetType"] = "Azure Data Share"
},
new Dictionary<string, object>
{
["$id"] = "5928",
["assetType"] = "Teradata"
},
new Dictionary<string, object>
{
["$id"] = "5929",
["assetType"] = "SAP S4HANA"
},
new Dictionary<string, object>
{
["$id"] = "5930",
["assetType"] = "SAP ECC"
},
new Dictionary<string, object>
{
["$id"] = "5931",
["assetType"] = "SQL Server Integration Services"
},
new Dictionary<string, object>
{
["$id"] = "5932",
["assetType"] = "hive"
},
new Dictionary<string, object>
{
["$id"] = "5933",
["assetType"] = "Azure Database for MySQL"
},
new Dictionary<string, object>
{
["$id"] = "5934",
["assetType"] = "Azure Database for MariaDB"
},
new Dictionary<string, object>
{
["$id"] = "5935",
["assetType"] = "Azure Database for PostgreSQL"
},
new Dictionary<string, object>
{
["$id"] = "5936",
["assetType"] = "Azure Synapse Analytics"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "5978",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5979",
["attributeName"] = "name",
["operator"] = "eq",
["attributeValue"] = "exampledata.csv"
},
new Dictionary<string, object>
{
["$id"] = "5980",
["attributeName"] = "createTime",
["operator"] = "ge",
["attributeValue"] = 1545580800000L
},
new Dictionary<string, object>
{
["$id"] = "5981",
["attributeName"] = "modifiedTime",
["operator"] = "timerange",
["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6043",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6044",
["attributeName"] = "<BusinessMetadataName>.<StringAttributeName>",
["operator"] = "eq|ne|contains|prefix",
["attributeValue"] = "string value"
},
new Dictionary<string, object>
{
["$id"] = "6045",
["attributeName"] = "<BusinessMetadataName>.<NumberAttributeName>",
["operator"] = "eq|ne|gt|ge|lt|le",
["attributeValue"] = 123
},
new Dictionary<string, object>
{
["$id"] = "6046",
["attributeName"] = "<BusinessMetadataName>.<BooleanAttributeName>",
["operator"] = "eq|ne",
["attributeValue"] = true
},
new Dictionary<string, object>
{
["$id"] = "6047",
["attributeName"] = "<BusinessMetadataName>.<DateAttributeName>",
["operator"] = "timerange",
["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6070",
["classification"] = "MICROSOFT.PERSONAL.EMAIL",
["includeSubClassifications"] = true
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6120",
["collectionId"] = "collectionName"
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6169",
["objectType"] = "Tables"
}),
Facets = {new SearchFacetItem
{
Count = 10,
Facet = "assetType",
}, new SearchFacetItem
{
Count = 10,
Facet = "classification",
}, new SearchFacetItem
{
Count = 10,
Facet = "term",
}, new SearchFacetItem
{
Count = 10,
Facet = "label",
}},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6299",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6300",
["fileExtension"] = "txt"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "<term name>",
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6343",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6344",
["objectType"] = "Glossary terms"
},
new Dictionary<string, object>
{
["$id"] = "6345",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6346",
["glossaryType"] = "AtlasGlossary"
},
new Dictionary<string, object>
{
["$id"] = "6347",
["glossaryType"] = "AtlasGlossaryTerm"
}
}
}
}
}),
Facets = {new SearchFacetItem
{
Count = 10,
Facet = "termStatus",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "termTemplate",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6415",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6416",
["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6444",
["not"] = new Dictionary<string, object>
{
["$id"] = "6445",
["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE"
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6487",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6488",
["objectType"] = "Dashboards"
},
new Dictionary<string, object>
{
["$id"] = "6489",
["objectType"] = "Data pipelines"
},
new Dictionary<string, object>
{
["$id"] = "6490",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6491",
["objectType"] = "Folders"
},
new Dictionary<string, object>
{
["$id"] = "6492",
["objectType"] = "Glossary terms"
},
new Dictionary<string, object>
{
["$id"] = "6493",
["objectType"] = "Reports"
},
new Dictionary<string, object>
{
["$id"] = "6494",
["objectType"] = "Stored procedures"
},
new Dictionary<string, object>
{
["$id"] = "6495",
["objectType"] = "Tables"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "exampledata",
Limit = 2,
ContinuationToken = "<token>",
Orderby = {BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6540",
["name"] = "ASC"
}), BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6542",
["updateTime"] = "DESC"
})},
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6533",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6534",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6535",
["entityType"] = "azure_blob_path"
}
}
}),
Facets = {new SearchFacetItem
{
Count = 0,
Facet = "assetType",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "classification",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "contactId",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "label",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "term",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "exampledata",
Limit = 2,
Orderby = {BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6626",
["name"] = "ASC"
}), BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6628",
["updateTime"] = "DESC"
})},
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6620",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6621",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6622",
["entityType"] = "azure_blob_path"
}
}
}),
Facets = {new SearchFacetItem
{
Count = 0,
Facet = "assetType",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "classification",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "contactId",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "label",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "term",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "exampledata",
Limit = 2,
ContinuationToken = "<token>",
Orderby = {BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6713",
["name"] = "ASC"
}), BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6715",
["updateTime"] = "DESC"
})},
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6706",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6707",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6708",
["entityType"] = "azure_blob_path"
}
}
}),
Facets = {new SearchFacetItem
{
Count = 0,
Facet = "assetType",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "classification",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "contactId",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "label",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}, new SearchFacetItem
{
Count = 10,
Facet = "term",
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
}},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6792",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6793",
["createTime"] = new Dictionary<string, object>
{
["$id"] = "6794",
["operator"] = "lt",
["timeThreshold"] = 1545580800000L
}
},
new Dictionary<string, object>
{
["$id"] = "6795",
["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "exampledata",
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6828",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6829",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6830",
["not"] = new Dictionary<string, object>
{
["$id"] = "6831",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6832",
["attributeName"] = "size",
["operator"] = "eq",
["attributeValue"] = 0
},
new Dictionary<string, object>
{
["$id"] = "6833",
["attributeName"] = "fileSize",
["operator"] = "eq",
["attributeValue"] = 0
}
}
}
},
new Dictionary<string, object>
{
["$id"] = "6834",
["not"] = new Dictionary<string, object>
{
["$id"] = "6835",
["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE"
}
}
}
}),
TaxonomySetting = new SearchTaxonomySetting
{
AssetTypes = { "Azure Blob Storage" },
Facet = new SearchFacetItem
{
Count = 10,
Sort = new SearchFacetSort
{
Count = SearchSortOrder.Descend,
},
},
},
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Keywords = "<asset name>",
Limit = 3,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6889",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6890",
["term"] = "ExampleTerm"
},
new Dictionary<string, object>
{
["$id"] = "6891",
["term"] = "ExampleTerm",
["glossary"] = "GlossaryName"
},
new Dictionary<string, object>
{
["$id"] = "6892",
["termGuid"] = "<term guid>"
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
This sample shows how to call QueryAsync.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
QueryConfig body = new QueryConfig
{
Limit = 10,
Filter = BinaryData.FromObjectAsJson(new Dictionary<string, object>
{
["$id"] = "6925",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6926",
["entityType"] = "azure_blob_path",
["includeSubTypes"] = false
}
}
}),
};
Response<QueryResult> response = await client.QueryAsync(body);
Applies to
QueryAsync(RequestContent, RequestContext)
- Source:
- Discovery.cs
[Protocol Method] Get data using search.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler QueryAsync(QueryConfig, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> QueryAsync(Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member QueryAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.QueryAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function QueryAsync (content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
content is null.
Service returned a non-success status code.
Examples
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "exampledata",
filter = new Dictionary<string, object>
{
["$id"] = "5713",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5714",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "5715",
["entityType"] = "azure_blob_path"
}
}
},
limit = 10,
orderby = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5719",
["name"] = "ASC"
},
new Dictionary<string, object>
{
["$id"] = "5721",
["updateTime"] = "DESC"
}
},
facets = new object[]
{
new
{
facet = "assetType",
count = 0,
sort = new
{
count = "desc",
},
},
new
{
facet = "classification",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "contactId",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "label",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "term",
count = 10,
sort = new
{
count = "desc",
},
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "5798",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5799",
["entityType"] = "azure_blob_path"
},
new Dictionary<string, object>
{
["$id"] = "5800",
["attributeName"] = "qualifiedName",
["operator"] = "contains",
["attributeValue"] = ".csv"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "5851",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5852",
["entityType"] = "azure_blob_path"
},
new Dictionary<string, object>
{
["$id"] = "5853",
["attributeName"] = "qualifiedName",
["operator"] = "contains",
["attributeValue"] = ".csv"
},
new Dictionary<string, object>
{
["$id"] = "5854",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5855",
["attributeName"] = "name",
["operator"] = "eq",
["attributeValue"] = "exampledata.csv"
},
new Dictionary<string, object>
{
["$id"] = "5856",
["attributeName"] = "qualifiedName",
["operator"] = "prefix",
["attributeValue"] = "https://"
}
}
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "5909",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5910",
["assetType"] = "SQL Server"
},
new Dictionary<string, object>
{
["$id"] = "5911",
["assetType"] = "Azure SQL Server"
},
new Dictionary<string, object>
{
["$id"] = "5912",
["assetType"] = "Azure SQL Database"
},
new Dictionary<string, object>
{
["$id"] = "5913",
["assetType"] = "Azure SQL Data Warehouse"
},
new Dictionary<string, object>
{
["$id"] = "5914",
["assetType"] = "Azure SQL Managed Instance"
},
new Dictionary<string, object>
{
["$id"] = "5915",
["assetType"] = "Azure Storage Account"
},
new Dictionary<string, object>
{
["$id"] = "5916",
["assetType"] = "Azure Blob Storage"
},
new Dictionary<string, object>
{
["$id"] = "5917",
["assetType"] = "Azure Files"
},
new Dictionary<string, object>
{
["$id"] = "5918",
["assetType"] = "Azure Table Storage"
},
new Dictionary<string, object>
{
["$id"] = "5919",
["assetType"] = "Azure Data Lake Storage Gen1"
},
new Dictionary<string, object>
{
["$id"] = "5920",
["assetType"] = "Azure Data Lake Storage Gen2"
},
new Dictionary<string, object>
{
["$id"] = "5921",
["assetType"] = "Azure Cosmos DB"
},
new Dictionary<string, object>
{
["$id"] = "5922",
["assetType"] = "Azure Data Factory"
},
new Dictionary<string, object>
{
["$id"] = "5923",
["assetType"] = "Azure Cognitive Search"
},
new Dictionary<string, object>
{
["$id"] = "5924",
["assetType"] = "Power BI"
},
new Dictionary<string, object>
{
["$id"] = "5925",
["assetType"] = "Azure Data Explorer"
},
new Dictionary<string, object>
{
["$id"] = "5926",
["assetType"] = "Amazon S3"
},
new Dictionary<string, object>
{
["$id"] = "5927",
["assetType"] = "Azure Data Share"
},
new Dictionary<string, object>
{
["$id"] = "5928",
["assetType"] = "Teradata"
},
new Dictionary<string, object>
{
["$id"] = "5929",
["assetType"] = "SAP S4HANA"
},
new Dictionary<string, object>
{
["$id"] = "5930",
["assetType"] = "SAP ECC"
},
new Dictionary<string, object>
{
["$id"] = "5931",
["assetType"] = "SQL Server Integration Services"
},
new Dictionary<string, object>
{
["$id"] = "5932",
["assetType"] = "hive"
},
new Dictionary<string, object>
{
["$id"] = "5933",
["assetType"] = "Azure Database for MySQL"
},
new Dictionary<string, object>
{
["$id"] = "5934",
["assetType"] = "Azure Database for MariaDB"
},
new Dictionary<string, object>
{
["$id"] = "5935",
["assetType"] = "Azure Database for PostgreSQL"
},
new Dictionary<string, object>
{
["$id"] = "5936",
["assetType"] = "Azure Synapse Analytics"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "5978",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "5979",
["attributeName"] = "name",
["operator"] = "eq",
["attributeValue"] = "exampledata.csv"
},
new Dictionary<string, object>
{
["$id"] = "5980",
["attributeName"] = "createTime",
["operator"] = "ge",
["attributeValue"] = 1545580800000L
},
new Dictionary<string, object>
{
["$id"] = "5981",
["attributeName"] = "modifiedTime",
["operator"] = "timerange",
["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6043",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6044",
["attributeName"] = "<BusinessMetadataName>.<StringAttributeName>",
["operator"] = "eq|ne|contains|prefix",
["attributeValue"] = "string value"
},
new Dictionary<string, object>
{
["$id"] = "6045",
["attributeName"] = "<BusinessMetadataName>.<NumberAttributeName>",
["operator"] = "eq|ne|gt|ge|lt|le",
["attributeValue"] = 123
},
new Dictionary<string, object>
{
["$id"] = "6046",
["attributeName"] = "<BusinessMetadataName>.<BooleanAttributeName>",
["operator"] = "eq|ne",
["attributeValue"] = true
},
new Dictionary<string, object>
{
["$id"] = "6047",
["attributeName"] = "<BusinessMetadataName>.<DateAttributeName>",
["operator"] = "timerange",
["attributeValue"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6070",
["classification"] = "MICROSOFT.PERSONAL.EMAIL",
["includeSubClassifications"] = true
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6120",
["collectionId"] = "collectionName"
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
filter = new Dictionary<string, object>
{
["$id"] = "6169",
["objectType"] = "Tables"
},
limit = 10,
facets = new object[]
{
new
{
facet = "assetType",
count = 10,
},
new
{
facet = "classification",
count = 10,
},
new
{
facet = "term",
count = 10,
},
new
{
facet = "label",
count = 10,
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6299",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6300",
["fileExtension"] = "txt"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "<term name>",
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6343",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6344",
["objectType"] = "Glossary terms"
},
new Dictionary<string, object>
{
["$id"] = "6345",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6346",
["glossaryType"] = "AtlasGlossary"
},
new Dictionary<string, object>
{
["$id"] = "6347",
["glossaryType"] = "AtlasGlossaryTerm"
}
}
}
}
},
facets = new object[]
{
new
{
facet = "termStatus",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "termTemplate",
count = 10,
sort = new
{
count = "desc",
},
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6415",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6416",
["id"] = "bfecbcc3-1838-45fe-96d6-112de8a170f9"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6444",
["not"] = new Dictionary<string, object>
{
["$id"] = "6445",
["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE"
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6487",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6488",
["objectType"] = "Dashboards"
},
new Dictionary<string, object>
{
["$id"] = "6489",
["objectType"] = "Data pipelines"
},
new Dictionary<string, object>
{
["$id"] = "6490",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6491",
["objectType"] = "Folders"
},
new Dictionary<string, object>
{
["$id"] = "6492",
["objectType"] = "Glossary terms"
},
new Dictionary<string, object>
{
["$id"] = "6493",
["objectType"] = "Reports"
},
new Dictionary<string, object>
{
["$id"] = "6494",
["objectType"] = "Stored procedures"
},
new Dictionary<string, object>
{
["$id"] = "6495",
["objectType"] = "Tables"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "exampledata",
filter = new Dictionary<string, object>
{
["$id"] = "6533",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6534",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6535",
["entityType"] = "azure_blob_path"
}
}
},
limit = 2,
continuationToken = "<token>",
orderby = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6540",
["name"] = "ASC"
},
new Dictionary<string, object>
{
["$id"] = "6542",
["updateTime"] = "DESC"
}
},
facets = new object[]
{
new
{
facet = "assetType",
count = 0,
sort = new
{
count = "desc",
},
},
new
{
facet = "classification",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "contactId",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "label",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "term",
count = 10,
sort = new
{
count = "desc",
},
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "exampledata",
filter = new Dictionary<string, object>
{
["$id"] = "6620",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6621",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6622",
["entityType"] = "azure_blob_path"
}
}
},
limit = 2,
orderby = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6626",
["name"] = "ASC"
},
new Dictionary<string, object>
{
["$id"] = "6628",
["updateTime"] = "DESC"
}
},
facets = new object[]
{
new
{
facet = "assetType",
count = 0,
sort = new
{
count = "desc",
},
},
new
{
facet = "classification",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "contactId",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "label",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "term",
count = 10,
sort = new
{
count = "desc",
},
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "exampledata",
filter = new Dictionary<string, object>
{
["$id"] = "6706",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6707",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6708",
["entityType"] = "azure_blob_path"
}
}
},
limit = 2,
continuationToken = "<token>",
orderby = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6713",
["name"] = "ASC"
},
new Dictionary<string, object>
{
["$id"] = "6715",
["updateTime"] = "DESC"
}
},
facets = new object[]
{
new
{
facet = "assetType",
count = 0,
sort = new
{
count = "desc",
},
},
new
{
facet = "classification",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "contactId",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "label",
count = 10,
sort = new
{
count = "desc",
},
},
new
{
facet = "term",
count = 10,
sort = new
{
count = "desc",
},
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6792",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6793",
["createTime"] = new Dictionary<string, object>
{
["$id"] = "6794",
["operator"] = "lt",
["timeThreshold"] = 1545580800000L
}
},
new Dictionary<string, object>
{
["$id"] = "6795",
["updateTime"] = "LAST_24H|LAST_7D|LAST_30D|LAST_365D|MORE_THAN_365D"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "exampledata",
filter = new Dictionary<string, object>
{
["$id"] = "6828",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6829",
["objectType"] = "Files"
},
new Dictionary<string, object>
{
["$id"] = "6830",
["not"] = new Dictionary<string, object>
{
["$id"] = "6831",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6832",
["attributeName"] = "size",
["operator"] = "eq",
["attributeValue"] = 0
},
new Dictionary<string, object>
{
["$id"] = "6833",
["attributeName"] = "fileSize",
["operator"] = "eq",
["attributeValue"] = 0
}
}
}
},
new Dictionary<string, object>
{
["$id"] = "6834",
["not"] = new Dictionary<string, object>
{
["$id"] = "6835",
["classification"] = "MICROSOFT.SYSTEM.TEMP_FILE"
}
}
}
},
limit = 10,
taxonomySetting = new
{
assetTypes = new object[]
{
"Azure Blob Storage"
},
facet = new
{
count = 10,
sort = new
{
count = "desc",
},
},
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
keywords = "<asset name>",
limit = 3,
filter = new Dictionary<string, object>
{
["$id"] = "6889",
["or"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6890",
["term"] = "ExampleTerm"
},
new Dictionary<string, object>
{
["$id"] = "6891",
["term"] = "ExampleTerm",
["glossary"] = "GlossaryName"
},
new Dictionary<string, object>
{
["$id"] = "6892",
["termGuid"] = "<term guid>"
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
This sample shows how to call QueryAsync and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Discovery client = new DataMapClient(endpoint, credential).GetDiscoveryClient(apiVersion: "2023-09-01");
using RequestContent content = RequestContent.Create(new
{
limit = 10,
filter = new Dictionary<string, object>
{
["$id"] = "6925",
["and"] = new object[]
{
new Dictionary<string, object>
{
["$id"] = "6926",
["entityType"] = "azure_blob_path",
["includeSubTypes"] = false
}
}
},
});
Response response = await client.QueryAsync(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());