# PublishAsConnectionString

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

Changes the resource to be published as a connection string reference in the manifest.

## Remarks

This API only changes the manifest representation; it does not change the resource model used by other publishers.

## Definition

```go
func (AzureResource) PublishAsConnectionString() AzureResource
```

## Returns

[`AzureResource`](/reference/api/go/aspire.hosting.azure/azureresource.md) -- The resource builder.

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

## Applies to

- [`AzureBicepResource`](/reference/api/go/aspire.hosting.azure/azurebicepresource.md)
- [`AzureProvisioningResource`](/reference/api/go/aspire.hosting.azure/azureprovisioningresource.md)
- [`AzureUserAssignedIdentityResource`](/reference/api/go/aspire.hosting.azure/azureuserassignedidentityresource.md)
