AzureUserAssignedIdentityExtensions.WithAzureUserAssignedIdentity<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attaches an existing AzureUserAssignedIdentityResource to a compute resource, setting it as the target identity for the builder.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<T> WithAzureUserAssignedIdentity<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T> builder, Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureUserAssignedIdentityResource> identityResourceBuilder) where T : Aspire.Hosting.ApplicationModel.IComputeResource;
static member WithAzureUserAssignedIdentity : Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IComputeResource)> * Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.Azure.AzureUserAssignedIdentityResource> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IComputeResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.IComputeResource)
<Extension()>
Public Function WithAzureUserAssignedIdentity(Of T As IComputeResource) (builder As IResourceBuilder(Of T), identityResourceBuilder As IResourceBuilder(Of AzureUserAssignedIdentityResource)) As IResourceBuilder(Of T)
Type Parameters
- T
Parameters
- builder
- IResourceBuilder<T>
The builder for the IComputeResource the identity will be associated with.
- identityResourceBuilder
- IResourceBuilder<AzureUserAssignedIdentityResource>
The builder for the AzureUserAssignedIdentityResource.
Returns
A reference to the IResourceBuilder<T> builder.
Examples
var identity = builder.AddAzureUserAssignedIdentity("myIdentity");
var app = builder.AddProject("myApp")
.WithAzureUserAssignedIdentity(identity);