# AzureResource

- Module: [Aspire.Hosting.Azure](/reference/api/go/aspire.hosting.azure.md)
- Version: `17.0.0`
- Kind: `interface`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

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

## Definition

```go
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.

- [AsExisting](/reference/api/go/aspire.hosting.azure/azureresource/asexisting.md) -- `method` -- Marks the resource as an existing resource in both run and publish modes.
  ```go
  AsExisting(name any, options ...*AsExistingOptions) AzureResource
  ```
- [AsExistingInResourceGroup](/reference/api/go/aspire.hosting.azure/azureresource/asexistinginresourcegroup.md) -- `method` -- Marks the resource as an existing resource in a specific resource group and subscription in both run and publish modes.
  ```go
  AsExistingInResourceGroup(name any, resourceGroup any, subscription any) AzureResource
  ```
- [AsExistingInSubscription](/reference/api/go/aspire.hosting.azure/azureresource/asexistinginsubscription.md) -- `method` -- Marks the subscription-scoped resource as an existing resource in both run and publish modes.
  ```go
  AsExistingInSubscription(name any, subscription any) AzureResource
  ```
- [AsExistingInTenant](/reference/api/go/aspire.hosting.azure/azureresource/asexistingintenant.md) -- `method` -- Marks the current-tenant-scoped resource as an existing resource in both run and publish modes.
  ```go
  AsExistingInTenant(name any) AzureResource
  ```
- [ClearDefaultRoleAssignments](/reference/api/go/aspire.hosting.azure/azureresource/cleardefaultroleassignments.md) -- `method` -- Clears all default role assignments for the specified Azure resource.
  ```go
  ClearDefaultRoleAssignments() AzureResource
  ```
- [GetBicepIdentifier](/reference/api/go/aspire.hosting.azure/azureresource/getbicepidentifier.md) -- `method` -- Gets the Bicep identifier for the Azure resource.
  ```go
  GetBicepIdentifier() (string, error)
  ```
- [IsExisting](/reference/api/go/aspire.hosting.azure/azureresource/isexisting.md) -- `method` -- Determines whether the Azure resource is marked as existing.
  ```go
  IsExisting() (bool, error)
  ```
- [PublishAsConnectionString](/reference/api/go/aspire.hosting.azure/azureresource/publishasconnectionstring.md) -- `method` -- Changes the resource to be published as a connection string reference in the manifest.
  ```go
  PublishAsConnectionString() AzureResource
  ```
- [PublishAsExisting](/reference/api/go/aspire.hosting.azure/azureresource/publishasexisting.md) -- `method` -- Marks the resource as an existing resource when the application is deployed.
  ```go
  PublishAsExisting(name any, options ...*PublishAsExistingOptions) AzureResource
  ```
- [PublishAsExistingInResourceGroup](/reference/api/go/aspire.hosting.azure/azureresource/publishasexistinginresourcegroup.md) -- `method` -- Marks the resource as an existing resource in a specific resource group and subscription when the application is deployed.
  ```go
  PublishAsExistingInResourceGroup(name any, resourceGroup any, subscription any) AzureResource
  ```
- [PublishAsExistingInSubscription](/reference/api/go/aspire.hosting.azure/azureresource/publishasexistinginsubscription.md) -- `method` -- Marks the subscription-scoped resource as an existing resource when the application is deployed.
  ```go
  PublishAsExistingInSubscription(name any, subscription any) AzureResource
  ```
- [PublishAsExistingInTenant](/reference/api/go/aspire.hosting.azure/azureresource/publishasexistingintenant.md) -- `method` -- Marks the current-tenant-scoped resource as an existing resource when the application is deployed.
  ```go
  PublishAsExistingInTenant(name any) AzureResource
  ```
- [RunAsExisting](/reference/api/go/aspire.hosting.azure/azureresource/runasexisting.md) -- `method` -- Marks the resource as an existing resource when the application is running.
  ```go
  RunAsExisting(name any, options ...*RunAsExistingOptions) AzureResource
  ```
- [RunAsExistingInResourceGroup](/reference/api/go/aspire.hosting.azure/azureresource/runasexistinginresourcegroup.md) -- `method` -- Marks the resource as an existing resource in a specific resource group and subscription when the application is running.
  ```go
  RunAsExistingInResourceGroup(name any, resourceGroup any, subscription any) AzureResource
  ```
- [RunAsExistingInSubscription](/reference/api/go/aspire.hosting.azure/azureresource/runasexistinginsubscription.md) -- `method` -- Marks the subscription-scoped resource as an existing resource when the application is running.
  ```go
  RunAsExistingInSubscription(name any, subscription any) AzureResource
  ```
- [RunAsExistingInTenant](/reference/api/go/aspire.hosting.azure/azureresource/runasexistingintenant.md) -- `method` -- Marks the current-tenant-scoped resource as an existing resource when the application is running.
  ```go
  RunAsExistingInTenant(name any) AzureResource
  ```

## Applies to

- [`AzureBicepResource`](/reference/api/go/aspire.hosting.azure/azurebicepresource.md)
- [`AzureProvisioningResource`](/reference/api/go/aspire.hosting.azure/azureprovisioningresource.md)
- [`AzureUserAssignedIdentityResource`](/reference/api/go/aspire.hosting.azure/azureuserassignedidentityresource.md)
