# DevTunnelResource

- Module: [Aspire.Hosting.DevTunnels](/reference/api/typescript/aspire.hosting.devtunnels.md)
- Version: `13.4.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 tunnel endpoint reference for the specified target endpoint.
    ```typescript
  getTunnelEndpoint(targetEndpointReference: EndpointReference): EndpointReference
  ```
- [withAnonymousAccess](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withanonymousaccess.md) -- `method` -- Allows the tunnel to be publicly accessed without authentication.
    ```typescript
  withAnonymousAccess(): DevTunnelResource
  ```
- [withTunnelReference](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withtunnelreference.md) -- `method` -- Exposes the specified endpoint via the dev tunnel.
    ```typescript
  withTunnelReference(targetEndpoint: EndpointReference): DevTunnelResource
  ```
- [withTunnelReferenceAll](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withtunnelreferenceall.md) -- `method` -- Adds ports on the dev tunnel for all endpoints found on the referenced resource and sets whether anonymous access is allowed.
    ```typescript
  withTunnelReferenceAll(resourceBuilder: IResourceWithEndpoints, allowAnonymous: boolean): DevTunnelResource
  ```
- [withTunnelReferenceAnonymous](/reference/api/typescript/aspire.hosting.devtunnels/devtunnelresource/withtunnelreferenceanonymous.md) -- `method` -- Exposes the specified endpoint via the dev tunnel and sets whether anonymous access is allowed.
    ```typescript
  withTunnelReferenceAnonymous(targetEndpoint: EndpointReference, allowAnonymous: boolean): DevTunnelResource
  ```
