Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithFoundryRoleAssignments

Method
📦 Aspire.Hosting.Foundry v17.0.0-preview.1.26565.2
func (Resource) WithFoundryRoleAssignments(
target FoundryResource,
roles []FoundryRole,
) Resource

Signature

methodWithFoundryRoleAssignmentsbuilder
Assigns the specified roles to the given resource, granting it the necessary permissions on the target Microsoft Foundry resource. This replaces the default role assignments for the resource.
WithFoundryRoleAssignments(
target FoundryResource,
roles []FoundryRole,
) Resource
targetFoundryResourceThe target Microsoft Foundry resource.
roles[]FoundryRoleThe Microsoft Foundry roles to be assigned (for example, CognitiveServicesOpenAIUser).
Resource

The resource builder.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: