Budgets - Get

予算名でスコープの予算を取得します。

GET https://management.azure.com/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}?api-version=2023-05-01

URI パラメーター

名前 / 必須 説明
budgetName
path True

string

予算名。

scope
path True

string

予算運用に関連付けられているスコープ。 これには、サブスクリプション スコープの場合は '/subscriptions/{subscriptionId}/'、resourceGroup スコープの場合は '/subscriptionId}/resourceGroup}/{resourceGroupName}' が含まれます。 '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccountId}/{billingAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.

api-version
query True

string

クライアント要求で使用される API のバージョン。 現在のバージョンは 2023-03-01 です。

応答

名前 説明
200 OK

Budget

OK です。 要求は成功しました。

Other Status Codes

ErrorResponse

操作に失敗した理由を説明するエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名前 説明
user_impersonation ユーザー アカウントの借用

Budget

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget?api-version=2023-05-01

Sample Response

{
  "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget",
  "name": "TestBudget",
  "type": "Microsoft.Consumption/budgets",
  "eTag": "\"1d34d012214157f\"",
  "properties": {
    "category": "Cost",
    "amount": 100.65,
    "timeGrain": "Monthly",
    "timePeriod": {
      "startDate": "2017-10-01T00:00:00Z",
      "endDate": "2018-10-31T00:00:00Z"
    },
    "filter": {
      "and": [
        {
          "dimensions": {
            "name": "ResourceId",
            "operator": "In",
            "values": [
              "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2",
              "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"
            ]
          }
        },
        {
          "tags": {
            "name": "category",
            "operator": "In",
            "values": [
              "Dev",
              "Prod"
            ]
          }
        },
        {
          "tags": {
            "name": "department",
            "operator": "In",
            "values": [
              "engineering",
              "sales"
            ]
          }
        }
      ]
    },
    "currentSpend": {
      "amount": 80.89,
      "unit": "USD"
    },
    "notifications": {
      "Actual_GreaterThan_80_Percent": {
        "enabled": true,
        "operator": "GreaterThan",
        "threshold": 80,
        "contactEmails": [
          "johndoe@contoso.com",
          "janesmith@contoso.com"
        ],
        "contactRoles": [
          "Contributor",
          "Reader"
        ],
        "contactGroups": [
          "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup"
        ],
        "thresholdType": "Actual"
      }
    }
  }
}

定義

名前 説明
Budget

予算リソース。

BudgetComparisonExpression

予算で使用する比較式。

BudgetFilter

リソース グループ、リソース、またはメーターで予算をフィルター処理するために使用できます。

BudgetFilterProperties

予算をフィルター処理するディメンションまたはタグ。

BudgetOperatorType

比較に使用する演算子。

BudgetTimePeriod

予算の開始日と終了日。

CategoryType

予算のカテゴリ。予算がコストと使用量のどちらを追跡するか。

CultureCode

受信者が通知を受け取る言語

CurrentSpend

予算に対して追跡されている現在のコストの量。

ErrorDetails

エラーの詳細。

ErrorResponse

エラー応答は、サービスが受信要求を処理できないことを示します。 理由は、エラー メッセージに示されています。

いくつかのエラー応答:

  • 429 TooManyRequests - 要求が調整されました。 "x-ms-ratelimit-microsoft.consumption-retry-after" ヘッダーで指定された時間を待ってから再試行します。

  • 503 ServiceUnavailable - サービスは一時的に使用できません。 "Retry-After" ヘッダーで指定された時刻まで待ってから、再試行してください。

ForecastSpend

予算に対して追跡されている予測コスト。

Notification

予算に関連付けられている通知。

OperatorType

比較演算子。

ThresholdType

しきい値の種類

TimeGrainType

予算の対象となる時間。 量の追跡は、時間グレインに基づいてリセットされます。 BillingMonth、BillingQuarter、BillingAnnual は WD のお客様のみがサポートしています

Budget

予算リソース。

名前 説明
eTag

string

リソースの eTag。 同時更新シナリオを処理するために、このフィールドを使用して、ユーザーが最新バージョンを更新しているかどうかを判断します。

id

string

リソース ID。

name

string

リソース名。

properties.amount

number

予算で追跡するコストの合計

properties.category

CategoryType

予算のカテゴリ。予算がコストと使用量のどちらを追跡するか。

properties.currentSpend

CurrentSpend

予算に対して追跡されている現在のコストの量。

properties.filter

BudgetFilter

ユーザー指定のディメンションやタグで予算をフィルター処理するために使用できます。

properties.forecastSpend

ForecastSpend

予算に対して追跡されている予測コスト。

properties.notifications

<string,  Notification>

予算に関連付けられている通知の辞書。 予算には最大 5 つの通知を設定できます。

properties.timeGrain

TimeGrainType

予算の対象となる時間。 量の追跡は、時間グレインに基づいてリセットされます。 BillingMonth、BillingQuarter、BillingAnnual は WD のお客様のみがサポートしています

properties.timePeriod

BudgetTimePeriod

予算の開始日と終了日を指定します。 開始日は月の最初の日付にする必要があり、終了日より小さくする必要があります。 予算開始日は、2017 年 6 月 1 日以降である必要があります。 将来の開始日は 12 か月を超えてはなりません。 過去の開始日は、タイムグレイン期間内に選択する必要があります。 終了日に制限はありません。

type

string

リソースの種類。

BudgetComparisonExpression

予算で使用する比較式。

名前 説明
name

string

比較に使用する列の名前。

operator

BudgetOperatorType

比較に使用する演算子。

values

string[]

比較に使用する値の配列

BudgetFilter

リソース グループ、リソース、またはメーターで予算をフィルター処理するために使用できます。

名前 説明
and

BudgetFilterProperties[]

論理 "AND" 式。 少なくとも 2 つの項目が必要です。

dimensions

BudgetComparisonExpression

ディメンションの比較式がある

tags

BudgetComparisonExpression

タグの比較式がある

BudgetFilterProperties

予算をフィルター処理するディメンションまたはタグ。

名前 説明
dimensions

BudgetComparisonExpression

ディメンションの比較式がある

tags

BudgetComparisonExpression

タグの比較式がある

BudgetOperatorType

比較に使用する演算子。

名前 説明
In

string

BudgetTimePeriod

予算の開始日と終了日。

名前 説明
endDate

string

予算の終了日。 指定しない場合、既定値は開始日から 10 年です。

startDate

string

予算の開始日。

CategoryType

予算のカテゴリ。予算がコストと使用量のどちらを追跡するか。

名前 説明
Cost

string

CultureCode

受信者が通知を受け取る言語

名前 説明
cs-cz

string

da-dk

string

de-de

string

en-gb

string

en-us

string

es-es

string

fr-fr

string

hu-hu

string

it-it

string

ja-jp

string

ko-kr

string

nb-no

string

nl-nl

string

pl-pl

string

pt-br

string

pt-pt

string

ru-ru

string

sv-se

string

tr-tr

string

zh-cn

string

zh-tw

string

CurrentSpend

予算に対して追跡されている現在のコストの量。

名前 説明
amount

number

予算によって追跡されているコストの合計金額。

unit

string

予算金額の数量単位。

ErrorDetails

エラーの詳細。

名前 説明
code

string

エラー コード。

message

string

操作が失敗した理由を示すエラー メッセージ。

ErrorResponse

エラー応答は、サービスが受信要求を処理できないことを示します。 理由は、エラー メッセージに示されています。

いくつかのエラー応答:

  • 429 TooManyRequests - 要求が調整されました。 "x-ms-ratelimit-microsoft.consumption-retry-after" ヘッダーで指定された時間を待ってから再試行します。

  • 503 ServiceUnavailable - サービスは一時的に使用できません。 "Retry-After" ヘッダーで指定された時刻まで待ってから、再試行してください。

名前 説明
error

ErrorDetails

エラーの詳細。

ForecastSpend

予算に対して追跡されている予測コスト。

名前 説明
amount

number

予算によって追跡されている合計期間の予測コスト。 この値は、予算に予測アラートの種類が含まれている場合にのみ提供されます。

unit

string

予算金額の数量単位。

Notification

予算に関連付けられている通知。

名前 既定値 説明
contactEmails

string[]

しきい値を超えたときに予算通知を送信するアドレスをEmailします。 サブスクリプションまたはリソース グループのスコープで、少なくとも 1 つの連絡先メールまたは連絡先グループを指定する必要があります。 他のすべてのスコープには、少なくとも 1 つの連絡先メールが指定されている必要があります。

contactGroups

string[]

しきい値を超えたときに予算通知を送信するアクション グループ。 完全修飾 Azure リソース ID として指定する必要があります。サブスクリプションまたはリソース グループのスコープでのみサポートされます。

contactRoles

string[]

しきい値を超えたときに予算通知を送信する連絡先ロール。

enabled

boolean

通知が有効かどうか。

locale

CultureCode

受信者が通知を受け取る言語

operator

OperatorType

比較演算子。

threshold

number

通知に関連付けられているしきい値。 コストがしきい値を超えると通知が送信されます。 これは常にパーセントであり、0 から 1000 の間である必要があります。

thresholdType

ThresholdType

Actual

しきい値の種類

OperatorType

比較演算子。

名前 説明
EqualTo

string

評価されたコストがしきい値と同じ場合、アラートがトリガーされます。 注: コストがしきい値とまったく同じになる可能性が低く、アラートが見つからないため、この OperatorType を使用することはお勧めしません。 この OperatorType は今後非推奨になります。

GreaterThan

string

評価されたコストがしきい値より大きい場合、アラートがトリガーされます。 注: これは、予算アラートの構成時に推奨される OperatorType です。

GreaterThanOrEqualTo

string

評価されたコストがしきい値以上の場合、アラートがトリガーされます。

ThresholdType

しきい値の種類

名前 説明
Actual

string

実績コスト予算アラートは、実績計上コストが割り当てられた予算 を超えたときに通知します。

Forecasted

string

予測コスト予算アラートは、予測コストの予測に依存するため、支出傾向が割り当てられた予算を超える可能性が高いという高度な通知を提供します。

TimeGrainType

予算の対象となる時間。 量の追跡は、時間グレインに基づいてリセットされます。 BillingMonth、BillingQuarter、BillingAnnual は WD のお客様のみがサポートしています

名前 説明
Annually

string

BillingAnnual

string

BillingMonth

string

BillingQuarter

string

Monthly

string

Quarterly

string