Watch Aspire live streamsDocsTry Aspire

AzureSandboxesExtensions Methods

ClassMethods7 members
Extension methods for adding Azure Container Apps sandbox resources to the application model.
AddAzureSandboxGroup(IDistributedApplicationBuilder, string)Section titled AddAzureSandboxGroup(IDistributedApplicationBuilder, string)extensionIResourceBuilder<AzureSandboxGroupResource>
Adds an Azure Container Apps sandbox group resource to the application model.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<AzureSandboxGroupResource> AddAzureSandboxGroup(
this IDistributedApplicationBuilder builder,
string name)
{
// ...
}
}
builderIDistributedApplicationBuilderThe distributed application builder.
namestringThe name of the resource.
IResourceBuilder<AzureSandboxGroupResource>A resource builder for the sandbox group.
PublishAsAzureSandbox(IResourceBuilder<T>, AzureSandboxOptions?)Section titled PublishAsAzureSandbox(IResourceBuilder<T>, AzureSandboxOptions?)extensionIResourceBuilder<T>
Configures the specified compute resource when it is published as an Azure sandbox container.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<T> PublishAsAzureSandbox<T>(
this IResourceBuilder<T> builder,
AzureSandboxOptions? options = null)
{
// ...
}
}
builderIResourceBuilder<T>The compute resource builder.
optionsAzureSandboxOptions?optionalThe sandbox runtime options.
IResourceBuilder<T>The resource builder.
ArgumentNullExceptionThrown when builder is null.
ArgumentExceptionThrown when a configured option is invalid.
When the application model contains a single compute environment, Aspire assigns the resource to that environment automatically. When multiple compute environments exist, call WithComputeEnvironment before this method.
PublishAsAzureSandbox(IResourceBuilder<T>, Action<AzureSandboxOptions>)Section titled PublishAsAzureSandbox(IResourceBuilder<T>, Action<AzureSandboxOptions>)extensionIResourceBuilder<T>
Configures the specified compute resource when it is published as an Azure sandbox container.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<T> PublishAsAzureSandbox<T>(
this IResourceBuilder<T> builder,
Action<AzureSandboxOptions> configure)
{
// ...
}
}
builderIResourceBuilder<T>The compute resource builder.
configureAction<AzureSandboxOptions>The callback that configures sandbox runtime options.
IResourceBuilder<T>The resource builder.
ArgumentNullExceptionThrown when builder or configure is null.
ArgumentExceptionThrown when a configured option is invalid.
WithAcrPullIdentity(IResourceBuilder<AzureSandboxGroupResource>, IResourceBuilder<AzureUserAssignedIdentityResource>)Section titled WithAcrPullIdentity(IResourceBuilder<AzureSandboxGroupResource>, IResourceBuilder<AzureUserAssignedIdentityResource>)extensionIResourceBuilder<AzureSandboxGroupResource>
Configures the user-assigned managed identity that Azure Dev Compute uses to pull sandbox images from the configured Azure Container Registry.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<AzureSandboxGroupResource> WithAcrPullIdentity(
this IResourceBuilder<AzureSandboxGroupResource> builder,
IResourceBuilder<AzureUserAssignedIdentityResource> identity)
{
// ...
}
}
builderIResourceBuilder<AzureSandboxGroupResource>The sandbox group resource builder.
identityIResourceBuilder<AzureUserAssignedIdentityResource>The user-assigned managed identity resource.
IResourceBuilder<AzureSandboxGroupResource>The resource builder.
The supplied identity must be attached to an existing sandbox group and have the AcrPull role on its registry. For sandbox groups created by Aspire, the identity is attached automatically, but the caller remains responsible for granting AcrPull.
WithNoManagedIdentity(IResourceBuilder<AzureSandboxGroupResource>)Section titled WithNoManagedIdentity(IResourceBuilder<AzureSandboxGroupResource>)extensionIResourceBuilder<AzureSandboxGroupResource>
Clears the managed identities explicitly configured for sandbox workloads.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<AzureSandboxGroupResource> WithNoManagedIdentity(
this IResourceBuilder<AzureSandboxGroupResource> builder)
{
// ...
}
}
builderIResourceBuilder<AzureSandboxGroupResource>The sandbox group resource builder.
IResourceBuilder<AzureSandboxGroupResource>The resource builder.
Workload identities requested by individual compute resources are added to the sandbox group during deployment preparation. Image pulls require a separate user-assigned identity. Aspire creates one by default for new groups; callers can select one with WithAcrPullIdentity and must do so for existing groups.
WithSystemAssignedIdentity(IResourceBuilder<AzureSandboxGroupResource>)Section titled WithSystemAssignedIdentity(IResourceBuilder<AzureSandboxGroupResource>)extensionIResourceBuilder<AzureSandboxGroupResource>
Configures a system-assigned managed identity for sandbox workloads.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<AzureSandboxGroupResource> WithSystemAssignedIdentity(
this IResourceBuilder<AzureSandboxGroupResource> builder)
{
// ...
}
}
builderIResourceBuilder<AzureSandboxGroupResource>The sandbox group resource builder.
IResourceBuilder<AzureSandboxGroupResource>The resource builder.
Image pulls require a separate user-assigned identity. Aspire creates one by default for new groups; callers can select one with WithAcrPullIdentity and must do so for existing groups. Workload identities requested by individual compute resources may add more user-assigned identities.
WithUserAssignedIdentity(IResourceBuilder<AzureSandboxGroupResource>, IResourceBuilder<AzureUserAssignedIdentityResource>)Section titled WithUserAssignedIdentity(IResourceBuilder<AzureSandboxGroupResource>, IResourceBuilder<AzureUserAssignedIdentityResource>)extensionIResourceBuilder<AzureSandboxGroupResource>
Adds a user-assigned managed identity for sandbox workloads.
public static class AzureSandboxesExtensions
{
public static IResourceBuilder<AzureSandboxGroupResource> WithUserAssignedIdentity(
this IResourceBuilder<AzureSandboxGroupResource> builder,
IResourceBuilder<AzureUserAssignedIdentityResource> identity)
{
// ...
}
}
builderIResourceBuilder<AzureSandboxGroupResource>The sandbox group resource builder.
identityIResourceBuilder<AzureUserAssignedIdentityResource>The user-assigned managed identity resource.
IResourceBuilder<AzureSandboxGroupResource>The resource builder.
Image pulls require a separate user-assigned identity. Aspire creates one by default for new groups; callers can select one with WithAcrPullIdentity and must do so for existing groups.