MockableCostManagementArmClient.GetCostAllocationRuleAsync Method

Definition

Get a cost allocation rule by rule name and billing account or enterprise enrollment.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.CostManagement.CostAllocationRuleResource>> GetCostAllocationRuleAsync(Azure.Core.ResourceIdentifier scope, string ruleName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetCostAllocationRuleAsync : Azure.Core.ResourceIdentifier * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.CostManagement.CostAllocationRuleResource>>
override this.GetCostAllocationRuleAsync : Azure.Core.ResourceIdentifier * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.CostManagement.CostAllocationRuleResource>>
Public Overridable Function GetCostAllocationRuleAsync (scope As ResourceIdentifier, ruleName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of CostAllocationRuleResource))

Parameters

scope
ResourceIdentifier

The scope of the resource collection to get.

ruleName
String

Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

ruleName is null.

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

Applies to