# PublishAsAzureSandbox

- Module: [Aspire.Hosting.Azure.Sandboxes](/reference/api/go/aspire.hosting.azure.sandboxes.md)
- Version: `17.0.0-preview.1.26565.2`
- Kind: `method`
- Defined on: `IComputeResource`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the specified compute resource when it is published as an Azure sandbox container.

## Remarks

When the application model contains a single compute environment, Aspire assigns the resource to that environment
automatically. When multiple compute environments exist, call `WithComputeEnvironment` before this method.

## Definition

```go
func (IComputeResource) PublishAsAzureSandbox(options ...*AzureSandboxOptions) IComputeResource
```

## Parameters

- `options` (`...*AzureSandboxOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed as the existing [`*AzureSandboxOptions`](/reference/api/go/aspire.hosting.azure.sandboxes/azuresandboxoptions.md) struct.

## Returns

`IComputeResource` -- The resource builder.

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

## Applies to

- `CSharpAppResource`
- `ContainerResource`
- `DotnetToolResource`
- `ExecutableResource`
- `ProjectResource`
