# IAzureResource

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

Represents an Azure resource, as a marker interface for {@ats-ref type:IResource}'s that can be deployed to an Azure resource group.

## Definition

```typescript
interface IAzureResource {
  asExisting(
      name: ParameterResource,
      resourceGroup?: ParameterResource): IAzureResource;
  clearDefaultRoleAssignments(): IAzureResource;
  getBicepIdentifier(): string;
  isExisting(): boolean;
  publishAsConnectionString(): IAzureResource;
  publishAsExisting(
      name: ParameterResource,
      resourceGroup?: ParameterResource): IAzureResource;
  runAsExisting(
      name: ParameterResource,
      resourceGroup?: ParameterResource): IAzureResource;
}
```

## Methods

- [asExisting](/reference/api/typescript/aspire.hosting.azure/iazureresource/asexisting.md) -- `method` -- Marks the resource as an existing resource in both run and publish modes.
    ```typescript
  asExisting(name: ParameterResource, resourceGroup?: ParameterResource): IAzureResource
  ```
- [clearDefaultRoleAssignments](/reference/api/typescript/aspire.hosting.azure/iazureresource/cleardefaultroleassignments.md) -- `method` -- Clears all default role assignments for the specified Azure resource.
    ```typescript
  clearDefaultRoleAssignments(): IAzureResource
  ```
- [getBicepIdentifier](/reference/api/typescript/aspire.hosting.azure/iazureresource/getbicepidentifier.md) -- `method` -- Gets the Bicep identifier for the Azure resource.
    ```typescript
  getBicepIdentifier(): string
  ```
- [isExisting](/reference/api/typescript/aspire.hosting.azure/iazureresource/isexisting.md) -- `method` -- Determines whether the Azure resource is marked as existing.
    ```typescript
  isExisting(): boolean
  ```
- [publishAsConnectionString](/reference/api/typescript/aspire.hosting.azure/iazureresource/publishasconnectionstring.md) -- `method` -- Changes the resource to be published as a connection string reference in the manifest.
    ```typescript
  publishAsConnectionString(): IAzureResource
  ```
- [publishAsExisting](/reference/api/typescript/aspire.hosting.azure/iazureresource/publishasexisting.md) -- `method` -- Marks the resource as an existing resource when the application is deployed.
    ```typescript
  publishAsExisting(name: ParameterResource, resourceGroup?: ParameterResource): IAzureResource
  ```
- [runAsExisting](/reference/api/typescript/aspire.hosting.azure/iazureresource/runasexisting.md) -- `method` -- Marks the resource as an existing resource when the application is running.
    ```typescript
  runAsExisting(name: ParameterResource, resourceGroup?: ParameterResource): IAzureResource
  ```
