# PublishAsAzureSandbox

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

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`
