The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default?api-version=2020-05-01
URI Parameters
Name |
In |
Required |
Type |
Description |
billingAccountName
|
path |
True
|
string
|
The ID that uniquely identifies a billing account.
|
billingProfileName
|
path |
True
|
string
|
The ID that uniquely identifies a billing profile.
|
api-version
|
query |
True
|
string
|
The version of the API to be used with the client request. The current version is 2020-05-01.
|
Responses
Name |
Type |
Description |
200 OK
|
AvailableBalance
|
OK. The request has succeeded.
|
Other Status Codes
|
ErrorResponse
|
Error response describing why the operation failed.
|
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
AvailableBalanceByBillingProfile
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default?api-version=2020-05-01
/** Samples for AvailableBalances Get. */
public final class Main {
/*
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json
*/
/**
* Sample code: AvailableBalanceByBillingProfile.
*
* @param manager Entry point to BillingManager.
*/
public static void availableBalanceByBillingProfile(com.azure.resourcemanager.billing.BillingManager manager) {
manager
.availableBalances()
.getWithResponse("{billingAccountName}", "{billingProfileName}", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billing
# USAGE
python available_balance_by_billing_profile.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.available_balances.get(
billing_account_name="{billingAccountName}",
billing_profile_name="{billingProfileName}",
)
print(response)
# x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbilling_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json
func ExampleAvailableBalancesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAvailableBalancesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AvailableBalance = armbilling.AvailableBalance{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/availableBalance"),
// ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default"),
// Properties: &armbilling.AvailableBalanceProperties{
// Amount: &armbilling.Amount{
// Currency: to.Ptr("USD"),
// Value: to.Ptr[float32](500),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingManagementClient } = require("@azure/arm-billing");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
*
* @summary The available credit balance for a billing profile. This is the balance that can be used for pay now to settle due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json
*/
async function availableBalanceByBillingProfile() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const billingAccountName = "{billingAccountName}";
const billingProfileName = "{billingProfileName}";
const credential = new DefaultAzureCredential();
const client = new BillingManagementClient(credential, subscriptionId);
const result = await client.availableBalances.get(billingAccountName, billingProfileName);
console.log(result);
}
availableBalanceByBillingProfile().catch(console.error);
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
{
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default",
"name": "default",
"type": "Microsoft.Billing/billingAccounts/billingProfiles/availableBalance",
"properties": {
"amount": {
"currency": "USD",
"value": 500
}
}
}
Definitions
Name |
Description |
Amount
|
The amount.
|
AvailableBalance
|
The latest Azure credit balance. This is the balance available for pay now.
|
ErrorDetails
|
The details of the error.
|
ErrorResponse
|
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
|
ErrorSubDetails
|
|
Amount
The amount.
Name |
Type |
Description |
currency
|
string
|
The currency for the amount value.
|
value
|
number
|
Amount value.
|
AvailableBalance
The latest Azure credit balance. This is the balance available for pay now.
Name |
Type |
Description |
id
|
string
|
Resource Id.
|
name
|
string
|
Resource name.
|
properties.amount
|
Amount
|
Balance amount.
|
type
|
string
|
Resource type.
|
ErrorDetails
The details of the error.
Name |
Type |
Description |
code
|
string
|
Error code.
|
details
|
ErrorSubDetails[]
|
The sub details of the error.
|
message
|
string
|
Error message indicating why the operation failed.
|
target
|
string
|
The target of the particular error.
|
ErrorResponse
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
Name |
Type |
Description |
error
|
ErrorDetails
|
The details of the error.
|
ErrorSubDetails
Name |
Type |
Description |
code
|
string
|
Error code.
|
message
|
string
|
Error message indicating why the operation failed.
|
target
|
string
|
The target of the particular error.
|