# DevTunnelResource

- Module: [Aspire.Hosting.DevTunnels](/reference/api/typescript/aspire.hosting.devtunnels.md)
- Version: `13.2.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface DevTunnelResource
  extends IComputeResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport {
  getTunnelEndpoint(targetEndpointReference: EndpointReference): EndpointReference;
  withAnonymousAccess(): DevTunnelResource;
  withTunnelReference(targetEndpoint: EndpointReference): DevTunnelResource;
  withTunnelReferenceAll(
      resourceBuilder: IResourceWithEndpoints,
      allowAnonymous: boolean): DevTunnelResource;
  withTunnelReferenceAnonymous(
      targetEndpoint: EndpointReference,
      allowAnonymous: boolean): DevTunnelResource;
}
```

## Methods

- [getTunnelEndpoint](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/gettunnelendpoint.md) -- `method` -- Gets the public endpoint exposed by the dev tunnel.
    ```typescript
  getTunnelEndpoint(targetEndpointReference: EndpointReference): EndpointReference
  ```
- [withAnonymousAccess](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withanonymousaccess.md) -- `method` -- Configures the dev tunnel to allow anonymous access.
    ```typescript
  withAnonymousAccess(): DevTunnelResource
  ```
- [withTunnelReference](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withtunnelreference.md) -- `method` -- Configures the dev tunnel to expose a target endpoint.
    ```typescript
  withTunnelReference(targetEndpoint: EndpointReference): DevTunnelResource
  ```
- [withTunnelReferenceAll](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withtunnelreferenceall.md) -- `method` -- Configures the dev tunnel to expose all endpoints on the referenced resource.
    ```typescript
  withTunnelReferenceAll(resourceBuilder: IResourceWithEndpoints, allowAnonymous: boolean): DevTunnelResource
  ```
- [withTunnelReferenceAnonymous](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withtunnelreferenceanonymous.md) -- `method` -- Configures the dev tunnel to expose a target endpoint with access control.
    ```typescript
  withTunnelReferenceAnonymous(targetEndpoint: EndpointReference, allowAnonymous: boolean): DevTunnelResource
  ```
