Skip to content
Docs Try Aspire

ExistingAzureResourceExtensions Methods

Class Methods 6 members
Extension methods for interacting with resources that are not managed by Aspire's provisioning or container management layer.
AsExisting(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>) Section titled AsExisting(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>) extension IResourceBuilder<T>
Marks the resource as an existing resource in both run and publish modes.
public static class ExistingAzureResourceExtensions
{
public static IResourceBuilder<T> AsExisting<T>(
this IResourceBuilder<T> builder,
IResourceBuilder<ParameterResource> nameParameter,
IResourceBuilder<ParameterResource>? resourceGroupParameter)
{
// ...
}
}
builder IResourceBuilder<T> The resource builder.
nameParameter IResourceBuilder<ParameterResource> The name of the existing resource.
resourceGroupParameter IResourceBuilder<ParameterResource> The name of the existing resource group, or null to use the current resource group.
IResourceBuilder<T> The resource builder with the existing resource annotation added.
IsExisting(IResource) Section titled IsExisting(IResource) extension bool
Determines if the resource is an existing resource.
public static class ExistingAzureResourceExtensions
{
public static bool IsExisting(
this IResource resource)
{
// ...
}
}
resource IResource The resource to check.
bool True if the resource is an existing resource, otherwise false.
This method is not available in polyglot app hosts. Use the Azure resource-specific polyglot surface instead.
PublishAsExisting(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>) Section titled PublishAsExisting(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>) extension IResourceBuilder<T>
Marks the resource as an existing resource when the application is deployed.
public static class ExistingAzureResourceExtensions
{
public static IResourceBuilder<T> PublishAsExisting<T>(
this IResourceBuilder<T> builder,
IResourceBuilder<ParameterResource> nameParameter,
IResourceBuilder<ParameterResource>? resourceGroupParameter)
{
// ...
}
}
builder IResourceBuilder<T> The resource builder.
nameParameter IResourceBuilder<ParameterResource> The name of the existing resource.
resourceGroupParameter IResourceBuilder<ParameterResource> The name of the existing resource group, or null to use the current resource group.
IResourceBuilder<T> The resource builder with the existing resource annotation added.
PublishAsExisting(IResourceBuilder<T>, string, string?) Section titled PublishAsExisting(IResourceBuilder<T>, string, string?) extension IResourceBuilder<T>
Marks the resource as an existing resource when the application is deployed.
public static class ExistingAzureResourceExtensions
{
public static IResourceBuilder<T> PublishAsExisting<T>(
this IResourceBuilder<T> builder,
string name,
string? resourceGroup)
{
// ...
}
}
builder IResourceBuilder<T> The resource builder.
name string The name of the existing resource.
resourceGroup string? The name of the existing resource group, or null to use the current resource group.
IResourceBuilder<T> The resource builder with the existing resource annotation added.
RunAsExisting(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>) Section titled RunAsExisting(IResourceBuilder<T>, IResourceBuilder<ParameterResource>, IResourceBuilder<ParameterResource>) extension IResourceBuilder<T>
Marks the resource as an existing resource when the application is running.
public static class ExistingAzureResourceExtensions
{
public static IResourceBuilder<T> RunAsExisting<T>(
this IResourceBuilder<T> builder,
IResourceBuilder<ParameterResource> nameParameter,
IResourceBuilder<ParameterResource>? resourceGroupParameter)
{
// ...
}
}
builder IResourceBuilder<T> The resource builder.
nameParameter IResourceBuilder<ParameterResource> The name of the existing resource.
resourceGroupParameter IResourceBuilder<ParameterResource> The name of the existing resource group, or null to use the current resource group.
IResourceBuilder<T> The resource builder with the existing resource annotation added.
RunAsExisting(IResourceBuilder<T>, string, string?) Section titled RunAsExisting(IResourceBuilder<T>, string, string?) extension IResourceBuilder<T>
Marks the resource as an existing resource when the application is running.
public static class ExistingAzureResourceExtensions
{
public static IResourceBuilder<T> RunAsExisting<T>(
this IResourceBuilder<T> builder,
string name,
string? resourceGroup)
{
// ...
}
}
builder IResourceBuilder<T> The resource builder.
name string The name of the existing resource.
resourceGroup string? The name of the existing resource group, or null to use the current resource group.
IResourceBuilder<T> The resource builder with the existing resource annotation added.