MockableCostManagementArmClient.GetCostAllocationRule Method

Definition

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

public virtual Azure.Response<Azure.ResourceManager.CostManagement.CostAllocationRuleResource> GetCostAllocationRule(Azure.Core.ResourceIdentifier scope, string ruleName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetCostAllocationRule : Azure.Core.ResourceIdentifier * string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.CostManagement.CostAllocationRuleResource>
override this.GetCostAllocationRule : Azure.Core.ResourceIdentifier * string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.CostManagement.CostAllocationRuleResource>
Public Overridable Function GetCostAllocationRule (scope As ResourceIdentifier, ruleName As String, Optional cancellationToken As CancellationToken = Nothing) As 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