Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AzureResource

Interfacemarker
📦 Aspire.Hosting.Azure v17.0.0

Represents an Azure resource, as a marker interface for IResource's that can be deployed to an Azure resource group.

type AzureResource interface{}

Methods

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

methodAsExistingbuilder
Marks the resource as an existing resource in both run and publish modes.
AsExisting(
name any,
options ...*AsExistingOptions,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
options...*AsExistingOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AsExistingOptions argument.

ResourceGroupanyThe name of the existing resource group as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the resource as an existing resource in a specific resource group and subscription in both run and publish modes.
AsExistingInResourceGroup(
name any,
resourceGroup any,
subscription any,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
resourceGroupanyThe resource group containing the existing resource as a string or parameter resource.
subscriptionanyThe subscription identifier containing the resource group as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the subscription-scoped resource as an existing resource in both run and publish modes.
AsExistingInSubscription(
name any,
subscription any,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
subscriptionanyThe subscription identifier containing the resource as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

methodAsExistingInTenantbuilder
Marks the current-tenant-scoped resource as an existing resource in both run and publish modes.
AsExistingInTenant(name any) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Clears all default role assignments for the specified Azure resource.
ClearDefaultRoleAssignments() AzureResource
AzureResource

The resource builder.

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

Gets the Bicep identifier for the Azure resource.
GetBicepIdentifier() (string, error)
(string, error)

A valid Bicep identifier.

Returns (string, error).

Determines whether the Azure resource is marked as existing.
IsExisting() (bool, error)
(bool, error)

true if the resource is marked as existing; otherwise, false.

Returns (bool, error).

Changes the resource to be published as a connection string reference in the manifest.
PublishAsConnectionString() AzureResource
AzureResource

The resource builder.

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

methodPublishAsExistingbuilder
Marks the resource as an existing resource when the application is deployed.
PublishAsExisting(
name any,
options ...*PublishAsExistingOptions,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
options...*PublishAsExistingOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*PublishAsExistingOptions argument.

ResourceGroupanyThe name of the existing resource group as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the resource as an existing resource in a specific resource group and subscription when the application is deployed.
PublishAsExistingInResourceGroup(
name any,
resourceGroup any,
subscription any,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
resourceGroupanyThe resource group containing the existing resource as a string or parameter resource.
subscriptionanyThe subscription identifier containing the resource group as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the subscription-scoped resource as an existing resource when the application is deployed.
PublishAsExistingInSubscription(
name any,
subscription any,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
subscriptionanyThe subscription identifier containing the resource as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the current-tenant-scoped resource as an existing resource when the application is deployed.
PublishAsExistingInTenant(name any) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

methodRunAsExistingbuilder
Marks the resource as an existing resource when the application is running.
RunAsExisting(
name any,
options ...*RunAsExistingOptions,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
options...*RunAsExistingOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*RunAsExistingOptions argument.

ResourceGroupanyThe name of the existing resource group as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the resource as an existing resource in a specific resource group and subscription when the application is running.
RunAsExistingInResourceGroup(
name any,
resourceGroup any,
subscription any,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
resourceGroupanyThe resource group containing the existing resource as a string or parameter resource.
subscriptionanyThe subscription identifier containing the resource group as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the subscription-scoped resource as an existing resource when the application is running.
RunAsExistingInSubscription(
name any,
subscription any,
) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
subscriptionanyThe subscription identifier containing the resource as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Marks the current-tenant-scoped resource as an existing resource when the application is running.
RunAsExistingInTenant(name any) AzureResource
nameanyThe name of the existing resource as a string or parameter resource.
AzureResource

The resource builder with the existing resource annotation added.

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

Applies to

This interface applies to the following types: