Query - Usage
Voer een query uit op de gebruiksgegevens voor het gedefinieerde bereik.
POST https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2024-08-01
URI-parameters
Name | In | Vereist | Type | Description |
---|---|---|---|---|
scope
|
path | True |
string |
Het bereik dat is gekoppeld aan query- en exportbewerkingen. Dit omvat '/subscriptions/{subscriptionId}/' voor het abonnementsbereik, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' voor resourceGroup-bereik, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' voor het bereik van de factureringsrekening en /providers/Microsoft.Billing/billingAccounts/{billingAccountId}/afdelingen/{departmentId} voor afdelingsbereik, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{ enrollmentAccountId} voor het bereik EnrollmentAccount, '/providers/Microsoft.Management/managementGroups/{managementGroupId} voor het bereik van de beheergroep, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' voor het bereik billingProfile, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' voor het bereik van invoiceSection en /providers/Microsoft. Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specifiek voor partners. |
api-version
|
query | True |
string |
De API-versie die voor deze bewerking moet worden gebruikt. |
Aanvraagbody
Name | Vereist | Type | Description |
---|---|---|---|
dataset | True |
Bevat definitie voor gegevens in deze query. |
|
timeframe | True |
Het tijdsbestek voor het ophalen van gegevens voor de query. Als dit aangepast is, moet er een specifieke periode worden opgegeven. |
|
type | True |
Het type query. |
|
timePeriod |
Heeft een periode voor het ophalen van gegevens voor de query. |
Antwoorden
Name | Type | Description |
---|---|---|
200 OK |
OK. De aanvraag is voltooid. |
|
204 No Content |
Geen inhoud. Resource is niet beschikbaar. |
|
Other Status Codes |
Foutreactie waarin wordt beschreven waarom de bewerking is mislukt. |
Beveiliging
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name | Description |
---|---|
user_impersonation | Uw gebruikersaccount imiteren |
Voorbeelden
BillingAccountQuery-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
BillingAccountQuery-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
BillingAccountQueryGrouping-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
"USD"
]
]
}
}
BillingAccountQueryGrouping-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
"USD"
]
]
}
}
BillingProfileQuery-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
BillingProfileQueryGrouping-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
"USD"
]
]
}
}
CustomerQuery-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
CustomerQueryGrouping-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/customers/5678/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
"USD"
]
]
}
}
DepartmentQuery-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/70664866/departments/123/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/departments/123/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
DepartmentQueryGrouping-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/departments/123/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/70664866/departments/123/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/departments/123/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
"USD"
]
]
}
}
EnrollmentAccountQuery-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/70664866/enrollmentAccounts/456/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/enrollmentAccounts/456/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
EnrollmentAccountQueryGrouping-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "Daily",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/70664866/enrollmentAccounts/456/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/enrollmentAccounts/456/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
]
]
}
}
InvoiceSectionQuery-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
InvoiceSectionQueryGrouping-MCA
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
"USD"
]
]
}
}
ManagementGroupQuery-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
0.16677720329728665,
"gs-stms-dev",
20180331,
"USD"
]
]
}
}
ManagementGroupQueryGrouping-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Management/managementGroups/MyMgId/providers/Microsoft.CostManagement/Query?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D",
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
20.35941656262545,
"VSTSHOL-1595322048000",
20180331,
"USD"
],
[
173.41979241290323,
"RVIIOT-TRIAL",
20180331,
"USD"
],
[
19.545363672276512,
"JapanUnifia-Trial",
20180331,
"USD"
]
]
}
}
ResourceGroupQuery-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "subscriptions/55312978-ba1b-415c-9304-c4b9c43c0481/resourcegroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/Query/9af9459d-441d-4055-9ed0-83d4c4a363fb",
"name": "9af9459d-441d-4055-9ed0-83d4c4a363fb",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": null,
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
2.10333307059661,
"ScreenSharingTest-peer",
20180417,
"USD"
],
[
20.10333307059661,
"ScreenSharingTest-peer",
20180418,
"USD"
]
]
}
}
ResourceGroupQueryGrouping-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "Daily",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceType"
}
]
}
}
Voorbeeldrespons
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/Query/9af9459d-441d-4055-9ed0-83d4c4a363fb",
"name": "9af9459d-441d-4055-9ed0-83d4c4a363fb",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": null,
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceType",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
2.10333307059661,
"Microsoft.SqlServer",
20180417,
"USD"
],
[
20.10333307059661,
"Microsoft.Compute",
20180418,
"USD"
]
]
}
}
SubscriptionQuery-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Voorbeeldrespons
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/Query/00000000-0000-0000-0000-000000000000",
"name": "55312978-ba1b-415c-9304-cfd9c43c0481",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": null,
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
2.10333307059661,
"ScreenSharingTest-peer",
20180331,
"USD"
],
[
218.68795741935486,
"Ict_StratAndPlan_GoldSprova_Prod",
20180331,
"USD"
],
[
0.14384913581657052,
"ssbciotelement01",
20180401,
"USD"
],
[
0.009865586851323632,
"ict_stratandplan_goldsprova_prod",
20180429,
"USD"
]
]
}
}
SubscriptionQueryGrouping-Legacy
Voorbeeldaanvraag
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query?api-version=2024-08-01
{
"type": "Usage",
"timeframe": "TheLastMonth",
"dataset": {
"granularity": "None",
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "ResourceGroup"
}
]
}
}
Voorbeeldrespons
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/Query/00000000-0000-0000-0000-000000000000",
"name": "55312978-ba1b-415c-9304-cfd9c43c0481",
"type": "microsoft.costmanagement/Query",
"properties": {
"nextLink": null,
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ResourceGroup",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
0.009865586851323632,
"Ict_StratAndPlan_GoldSprova_Prod_0",
"USD"
],
[
218.68795741935486,
"Ict_StratAndPlan_GoldSprova_Prod_1",
"USD"
],
[
2.10333307059661,
"ScreenSharingTest-peer1",
"USD"
],
[
0.14384913581657052,
"Ssbciotelement01",
"USD"
]
]
}
}
Definities
Name | Description |
---|---|
Error |
De details van de fout. |
Error |
Foutreactie geeft aan dat de service de binnenkomende aanvraag niet kan verwerken. De reden is opgegeven in het foutbericht. Enkele foutberichten:
|
Export |
Het type query. |
Function |
De naam van de te gebruiken aggregatiefunctie. |
Granularity |
De granulariteit van rijen in de prognose. |
Query |
De aggregatie-expressie die moet worden gebruikt in de query. |
Query |
QueryColumn-eigenschappen |
Query |
Het type kolom in de export. |
Query |
De vergelijkingsexpressie die moet worden gebruikt in de query. |
Query |
De definitie van gegevens die aanwezig zijn in de query. |
Query |
De configuratie van de gegevensset in de query. |
Query |
De definitie van een query. |
Query |
De filterexpressie die moet worden gebruikt in de export. |
Query |
De groeperen op expressie die in de query moet worden gebruikt. |
Query |
De operator die moet worden gebruikt voor vergelijking. |
Query |
Resultaat van query. Het bevat alle kolommen die worden vermeld onder groeperingen en aggregatie. |
Query |
De begin- en einddatum voor het ophalen van gegevens voor de query. |
Timeframe |
Het tijdsbestek voor het ophalen van gegevens voor de query. Als dit aangepast is, moet er een specifieke periode worden opgegeven. |
ErrorDetails
De details van de fout.
Name | Type | Description |
---|---|---|
code |
string |
Foutcode. |
message |
string |
Foutbericht dat aangeeft waarom de bewerking is mislukt. |
ErrorResponse
Foutreactie geeft aan dat de service de binnenkomende aanvraag niet kan verwerken. De reden is opgegeven in het foutbericht.
Enkele foutberichten:
429 TooManyRequests - Aanvraag wordt beperkt. Probeer het opnieuw nadat u hebt gewacht op de tijd die is opgegeven in de header x-ms-ratelimit-microsoft.consumption-retry-after.
503 ServiceUnavailable - Service is tijdelijk niet beschikbaar. Probeer het opnieuw nadat u hebt gewacht op de tijd die is opgegeven in de header 'Opnieuw proberen-na'.
Name | Type | Description |
---|---|---|
error |
De details van de fout. |
ExportType
Het type query.
Name | Type | Description |
---|---|---|
ActualCost |
string |
|
AmortizedCost |
string |
|
Usage |
string |
FunctionType
De naam van de te gebruiken aggregatiefunctie.
Name | Type | Description |
---|---|---|
Sum |
string |
GranularityType
De granulariteit van rijen in de prognose.
Name | Type | Description |
---|---|---|
Daily |
string |
QueryAggregation
De aggregatie-expressie die moet worden gebruikt in de query.
Name | Type | Description |
---|---|---|
function |
De naam van de te gebruiken aggregatiefunctie. |
|
name |
string |
De naam van de kolom die moet worden samengevoegd. |
QueryColumn
QueryColumn-eigenschappen
Name | Type | Description |
---|---|---|
name |
string |
De naam van de kolom. |
type |
string |
Het type kolom. |
QueryColumnType
Het type kolom in de export.
Name | Type | Description |
---|---|---|
Dimension |
string |
De dimensie van kostengegevens. |
TagKey |
string |
De tag die is gekoppeld aan de kostengegevens. |
QueryComparisonExpression
De vergelijkingsexpressie die moet worden gebruikt in de query.
Name | Type | Description |
---|---|---|
name |
string |
De naam van de kolom die moet worden gebruikt in vergelijking. |
operator |
De operator die moet worden gebruikt voor vergelijking. |
|
values |
string[] |
Matrix met waarden die moeten worden gebruikt voor vergelijking |
QueryDataset
De definitie van gegevens die aanwezig zijn in de query.
Name | Type | Description |
---|---|---|
aggregation |
<string,
Query |
Woordenlijst van aggregatie-expressie die moet worden gebruikt in de query. De sleutel van elk item in de woordenlijst is de alias voor de samengevoegde kolom. Query kan maximaal 2 aggregatiecomponenten bevatten. |
configuration |
Bevat configuratie-informatie voor de gegevens in de export. De configuratie wordt genegeerd als aggregatie en groepering worden opgegeven. |
|
filter |
De filterexpressie die moet worden gebruikt in de query. Raadpleeg de REST-documentatie van de Query-API voor het op de juiste wijze opmaken van het filter. |
|
granularity |
De granulariteit van rijen in de query. |
|
grouping |
Matrix van groeperen op expressie die moet worden gebruikt in de query. Query kan maximaal 2 groepen per component bevatten. |
QueryDatasetConfiguration
De configuratie van de gegevensset in de query.
Name | Type | Description |
---|---|---|
columns |
string[] |
Matrix van kolomnamen die moeten worden opgenomen in de query. Elke geldige naam van de querykolom is toegestaan. Als deze niet is opgegeven, bevat de query alle kolommen. |
QueryDefinition
De definitie van een query.
Name | Type | Description |
---|---|---|
dataset |
Bevat definitie voor gegevens in deze query. |
|
timePeriod |
Heeft een periode voor het ophalen van gegevens voor de query. |
|
timeframe |
Het tijdsbestek voor het ophalen van gegevens voor de query. Als dit aangepast is, moet er een specifieke periode worden opgegeven. |
|
type |
Het type query. |
QueryFilter
De filterexpressie die moet worden gebruikt in de export.
Name | Type | Description |
---|---|---|
and |
De logische 'AND'-expressie. Moet ten minste 2 items bevatten. |
|
dimensions |
Heeft een vergelijkingsexpressie voor een dimensie |
|
or |
De logische 'OR'-expressie. Moet ten minste 2 items bevatten. |
|
tags |
Heeft een vergelijkingsexpressie voor een tag |
QueryGrouping
De groeperen op expressie die in de query moet worden gebruikt.
Name | Type | Description |
---|---|---|
name |
string |
De naam van de kolom die moet worden gegroepeerd. |
type |
Heeft het type kolom dat moet worden gegroepeerd. |
QueryOperatorType
De operator die moet worden gebruikt voor vergelijking.
Name | Type | Description |
---|---|---|
In |
string |
QueryResult
Resultaat van query. Het bevat alle kolommen die worden vermeld onder groeperingen en aggregatie.
Name | Type | Description |
---|---|---|
eTag |
string |
ETag van de resource. |
id |
string |
Resource-id. |
location |
string |
Locatie van de resource. |
name |
string |
Resourcenaam. |
properties.columns |
Matrix van kolommen |
|
properties.nextLink |
string |
De koppeling (URL) naar de volgende pagina met resultaten. |
properties.rows |
Rows[] |
Matrix met rijen |
sku |
string |
SKU van de resource. |
tags |
object |
Resourcetags. |
type |
string |
Resourcetype. |
QueryTimePeriod
De begin- en einddatum voor het ophalen van gegevens voor de query.
Name | Type | Description |
---|---|---|
from |
string |
De begindatum waaruit gegevens moeten worden opgehaald. |
to |
string |
De einddatum voor het ophalen van gegevens naar. |
TimeframeType
Het tijdsbestek voor het ophalen van gegevens voor de query. Als dit aangepast is, moet er een specifieke periode worden opgegeven.
Name | Type | Description |
---|---|---|
BillingMonthToDate |
string |
|
Custom |
string |
|
MonthToDate |
string |
|
TheLastBillingMonth |
string |
|
TheLastMonth |
string |
|
WeekToDate |
string |