Skip to content

[resource-manager] more structural support in Extension.ExternalResource #3414

@ArcturusZhang

Description

@ArcturusZhang

I think this is because we are not able to define an external resource for this:
/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}

Possible syntax could be:

alias ManagementGroupBillingPeriod = Extension.ExternalResource<
	"Microsoft.Billing",
	"billingPeriods",
	"billingPeriodName",
	ParentType = ManagementGroup
;

where ParentType here should be able to reference another external resource so that this could be recusive.

Originally posted by @ArcturusZhang in #37162

The uri of the operation looks like this:

/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost

We should consider this as an extension provider action of /providers/Microsoft.Consumption/aggregatedCost on external resource /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}

If we plan just to fix for this case, it is also fine, in this case, we should add ManagementGroup into ParentType's valid values, and this could look like:

alias ManagementGroupBillingPeriod = Extension.ExternalResource<
  "Microsoft.Billing",
  "billingPeriods",
  "billingPeriodName",
  ParentType = "ManagementGroup"
>;

Metadata

Metadata

Labels

design:neededA design request has been raised that needs a proposallib:azure-resource-managerIssues for @azure-tools/typespec-azure-core libraryneeds-infoMark an issue that needs reply from the author or it will be closed automatically

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions