Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later.
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
With optional parameters:
GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01&$filter={$filter}&$top={$top}&$skiptoken={$skiptoken}
URI Parameters
| Name |
In |
Required |
Type |
Description |
|
scope
|
path |
True
|
string
|
The fully qualified Azure Resource manager identifier of the resource.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
|
$filter
|
query |
|
string
|
May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.
|
|
$skiptoken
|
query |
|
string
|
Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.
|
|
$top
|
query |
|
integer
(int32)
minimum: 1 maximum: 1000
|
May be used to limit the number of results to the most recent N marketplaces.
|
Responses
| Name |
Type |
Description |
|
200 OK
|
MarketplacesListResult
|
The request has succeeded.
|
|
204 No Content
|
|
Operation completed successfully.
|
|
Other Status Codes
|
ErrorResponse
|
An unexpected error response.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name |
Description |
|
user_impersonation
|
impersonate your user account
|
Examples
BillingAccountMarketplacesList
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByBillingAccountList.json
func ExampleMarketplacesClient_NewListPager_billingAccountMarketplacesList() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("providers/Microsoft.Billing/billingAccounts/123456", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplaceId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan1"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplaceId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan1",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
BillingAccountMarketplacesListForBillingPeriod
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByBillingAccountListForBillingPeriod.json
func ExampleMarketplacesClient_NewListPager_billingAccountMarketplacesListForBillingPeriod() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("providers/Microsoft.Billing/billingAccounts/123456", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
DepartmentMarketplacesList
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByDepartmentList.json
func ExampleMarketplacesClient_NewListPager_departmentMarketplacesList() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("providers/Microsoft.Billing/departments/123456", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
DepartmentMarketplacesListForBillingPeriod
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByDepartment_ListByBillingPeriod.json
func ExampleMarketplacesClient_NewListPager_departmentMarketplacesListForBillingPeriod() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("providers/Microsoft.Billing/departments/123456", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/providers/Microsoft.Billing/departments/123456/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
EnrollmentAccountMarketplacesList
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByEnrollmentAccountList.json
func ExampleMarketplacesClient_NewListPager_enrollmentAccountMarketplacesList() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("providers/Microsoft.Billing/enrollmentAccounts/123456", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
EnrollmentAccountMarketplacesListForBillingPeriod
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json
func ExampleMarketplacesClient_NewListPager_enrollmentAccountMarketplacesListForBillingPeriod() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("providers/Microsoft.Billing/enrollmentAccounts/123456", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/providers/Microsoft.Billing/enrollmentAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
ManagementGroupMarketplacesList
Sample request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByManagementGroupList.json
func ExampleMarketplacesClient_NewListPager_managementGroupMarketplacesList() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201810/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201810"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// {
// Name: to.Ptr("marketplacesId2"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201810/providers/Microsoft.Consumption/marketplaces/marketplaceId2"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account2"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201810"),
// CostCenter: to.Ptr("Center2"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department2"),
// InstanceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared2"),
// InstanceName: to.Ptr("shared2"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("11111111-1111-1111-1111-111111111111"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-10-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201810/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201810",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2018-10-13T23:59:59Z",
"usageStart": "2018-10-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
},
{
"name": "marketplacesId2",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201810/providers/Microsoft.Consumption/marketplaces/marketplaceId2",
"properties": {
"accountName": "Account2",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201810",
"consumedQuantity": 0.00328,
"costCenter": "Center2",
"currency": "USD",
"departmentName": "Department2",
"instanceId": "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared2",
"instanceName": "shared2",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "11111111-1111-1111-1111-111111111111",
"offerName": "offer1",
"orderNumber": "11111111-1111-1111-1111-111111111111",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "11111111-1111-1111-1111-111111111111",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2018-10-13T23:59:59Z",
"usageStart": "2018-10-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
ManagementGroupMarketplacesListForBillingPeriod
Sample request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesByManagementGroup_ListForBillingPeriod.json
func ExampleMarketplacesClient_NewListPager_managementGroupMarketplacesListForBillingPeriod() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201808/providers/Microsoft.Consumption/marketplaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201808"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// {
// Name: to.Ptr("marketplacesId2"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201808/providers/Microsoft.Consumption/marketplaces/marketplaceId2"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account2"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201810"),
// CostCenter: to.Ptr("Center2"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department2"),
// InstanceID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared2"),
// InstanceName: to.Ptr("shared2"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("11111111-1111-1111-1111-111111111111"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201808/providers/Microsoft.Consumption/marketplaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201808",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2018-08-13T23:59:59Z",
"usageStart": "2018-08-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
},
{
"name": "marketplacesId2",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201808/providers/Microsoft.Consumption/marketplaces/marketplaceId2",
"properties": {
"accountName": "Account2",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/subscriptions/11111111-1111-1111-1111-111111111111/providers/Microsoft.Billing/billingPeriods/201810",
"consumedQuantity": 0.00328,
"costCenter": "Center2",
"currency": "USD",
"departmentName": "Department2",
"instanceId": "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared2",
"instanceName": "shared2",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "11111111-1111-1111-1111-111111111111",
"offerName": "offer1",
"orderNumber": "11111111-1111-1111-1111-111111111111",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "11111111-1111-1111-1111-111111111111",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2018-08-13T23:59:59Z",
"usageStart": "2018-08-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
SubscriptionMarketplacesList
Sample request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesList.json
func ExampleMarketplacesClient_NewListPager_subscriptionMarketplacesList() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplaceId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketPlaces/marketplaceId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan1"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplaceId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketPlaces/marketplaceId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan1",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
SubscriptionMarketplacesListForBillingPeriod
Sample request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/marketplaces?api-version=2024-08-01
package armconsumption_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption/v2"
)
// Generated from example definition: 2024-08-01/MarketplacesListForBillingPeriod.json
func ExampleMarketplacesClient_NewListPager_subscriptionMarketplacesListForBillingPeriod() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armconsumption.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMarketplacesClient().NewListPager("subscriptions/00000000-0000-0000-0000-000000000000", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armconsumption.MarketplacesClientListResponse{
// MarketplacesListResult: armconsumption.MarketplacesListResult{
// Value: []*armconsumption.Marketplace{
// {
// Name: to.Ptr("marketplacesId1"),
// Type: to.Ptr("Microsoft.Consumption/marketPlaces"),
// ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketPlaces/marketplacesId1"),
// Properties: &armconsumption.MarketplaceProperties{
// AccountName: to.Ptr("Account1"),
// AdditionalProperties: to.Ptr("additionalProperties"),
// BillingPeriodID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702"),
// CostCenter: to.Ptr("Center1"),
// Currency: to.Ptr("USD"),
// DepartmentName: to.Ptr("Department1"),
// InstanceID: to.Ptr("/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1"),
// InstanceName: to.Ptr("shared1"),
// IsEstimated: to.Ptr(false),
// IsRecurringCharge: to.Ptr(false),
// MeterID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// OfferName: to.Ptr("offer1"),
// OrderNumber: to.Ptr("00000000-0000-0000-0000-000000000000"),
// PlanName: to.Ptr("plan2"),
// PublisherName: to.Ptr("xyz"),
// ResourceGroup: to.Ptr("TEST"),
// SubscriptionGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// SubscriptionName: to.Ptr("azure subscription"),
// UnitOfMeasure: to.Ptr("10 Hours"),
// UsageEnd: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T23:59:59Z"); return t}()),
// UsageStart: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-02-13T00:00:00Z"); return t}()),
// },
// Tags: map[string]*string{
// "dev": to.Ptr("tools"),
// "env": to.Ptr("newcrp"),
// },
// },
// },
// },
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"value": [
{
"name": "marketplacesId1",
"type": "Microsoft.Consumption/marketPlaces",
"id": "/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/marketPlaces/marketplacesId1",
"properties": {
"accountName": "Account1",
"additionalProperties": "additionalProperties",
"billingPeriodId": "/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702",
"consumedQuantity": 0.00328,
"costCenter": "Center1",
"currency": "USD",
"departmentName": "Department1",
"instanceId": "/subscriptions/subid/resourceGroups/Default-Web-eastasia/providers/Microsoft.Web/sites/shared1",
"instanceName": "shared1",
"isEstimated": false,
"isRecurringCharge": false,
"meterId": "00000000-0000-0000-0000-000000000000",
"offerName": "offer1",
"orderNumber": "00000000-0000-0000-0000-000000000000",
"planName": "plan2",
"pretaxCost": 0.67,
"publisherName": "xyz",
"resourceGroup": "TEST",
"resourceRate": 0.24,
"subscriptionGuid": "00000000-0000-0000-0000-000000000000",
"subscriptionName": "azure subscription",
"unitOfMeasure": "10 Hours",
"usageEnd": "2017-02-13T23:59:59Z",
"usageStart": "2017-02-13T00:00:00Z"
},
"tags": {
"dev": "tools",
"env": "newcrp"
}
}
]
}
Definitions
createdByType
Enumeration
The type of identity that created the resource.
| Value |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorAdditionalInfo
Object
The resource management error additional info.
| Name |
Type |
Description |
|
info
|
object
|
The additional info.
|
|
type
|
string
|
The additional info type.
|
ErrorDetail
Object
The error detail.
| Name |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
|
code
|
string
|
The error code.
|
|
details
|
ErrorDetail[]
|
The error details.
|
|
message
|
string
|
The error message.
|
|
target
|
string
|
The error target.
|
ErrorResponse
Object
Error response
| Name |
Type |
Description |
|
error
|
ErrorDetail
|
The error object.
|
Marketplace
Object
A marketplace resource.
| Name |
Type |
Description |
|
etag
|
string
|
The etag for the resource.
|
|
id
|
string
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
name
|
string
|
The name of the resource
|
|
properties.accountName
|
string
|
Account name.
|
|
properties.additionalInfo
|
string
|
Additional information.
|
|
properties.additionalProperties
|
string
|
Additional details of this usage item. By default this is not populated, unless it's specified in $expand.
|
|
properties.billingPeriodId
|
string
|
The id of the billing period resource that the usage belongs to.
|
|
properties.consumedQuantity
|
number
(decimal)
|
The quantity of usage.
|
|
properties.consumedService
|
string
|
Consumed service name.
|
|
properties.costCenter
|
string
|
The cost center of this department if it is a department and a costcenter exists
|
|
properties.currency
|
string
|
The ISO currency in which the meter is charged, for example, USD.
|
|
properties.departmentName
|
string
|
Department name.
|
|
properties.instanceId
|
string
|
The uri of the resource instance that the usage is about.
|
|
properties.instanceName
|
string
|
The name of the resource instance that the usage is about.
|
|
properties.isEstimated
|
boolean
|
The estimated usage is subject to change.
|
|
properties.isRecurringCharge
|
boolean
|
Flag indicating whether this is a recurring charge or not.
|
|
properties.meterId
|
string
(uuid)
|
The meter id (GUID).
|
|
properties.offerName
|
string
|
The type of offer.
|
|
properties.orderNumber
|
string
|
The order number.
|
|
properties.planName
|
string
|
The name of plan.
|
|
properties.pretaxCost
|
number
(decimal)
|
The amount of cost before tax.
|
|
properties.publisherName
|
string
|
The name of publisher.
|
|
properties.resourceGroup
|
string
|
The name of resource group.
|
|
properties.resourceRate
|
number
(decimal)
|
The marketplace resource rate.
|
|
properties.subscriptionGuid
|
string
(uuid)
|
Subscription guid.
|
|
properties.subscriptionName
|
string
|
Subscription name.
|
|
properties.unitOfMeasure
|
string
|
The unit of measure.
|
|
properties.usageEnd
|
string
(date-time)
|
The end of the date time range covered by the usage detail.
|
|
properties.usageStart
|
string
(date-time)
|
The start of the date time range covered by the usage detail.
|
|
systemData
|
systemData
|
Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
|
tags
|
object
|
Resource tags.
|
|
type
|
string
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
MarketplacesListResult
Object
Result of listing marketplaces. It contains a list of available marketplaces in reverse chronological order by billing period.
| Name |
Type |
Description |
|
nextLink
|
string
|
The link (url) to the next page of results.
|
|
value
|
Marketplace[]
|
The list of marketplaces.
|
systemData
Object
Metadata pertaining to creation and last modification of the resource.
| Name |
Type |
Description |
|
createdAt
|
string
(date-time)
|
The timestamp of resource creation (UTC).
|
|
createdBy
|
string
|
The identity that created the resource.
|
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
|
lastModifiedAt
|
string
(date-time)
|
The timestamp of resource last modification (UTC)
|
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|