共用方式為


ConsumptionBudgetCollection.CreateOrUpdateAsync Method

Definition

The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation.

  • Request Path: /{scope}/providers/Microsoft.Consumption/budgets/{budgetName}
  • Operation Id: Budgets_CreateOrUpdate
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Consumption.ConsumptionBudgetResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string budgetName, Azure.ResourceManager.Consumption.ConsumptionBudgetData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Consumption.ConsumptionBudgetData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Consumption.ConsumptionBudgetResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Consumption.ConsumptionBudgetData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Consumption.ConsumptionBudgetResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, budgetName As String, data As ConsumptionBudgetData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of ConsumptionBudgetResource))

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

budgetName
String

Budget Name.

data
ConsumptionBudgetData

Parameters supplied to the Create Budget operation.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

budgetName is an empty string, and was expected to be non-empty.

budgetName or data is null.

Applies to