# WithAdminDeploymentScriptSubnet

- Module: [Aspire.Hosting.Azure.Sql](/reference/api/go/aspire.hosting.azure.sql.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureSqlServerResource`](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the Azure SQL Server to use the specified subnet for deployment script execution.

## Remarks

When an Azure SQL Server has a private endpoint, deployment scripts that add database role assignments
run inside Azure Container Instances (ACI). This method allows you to provide an explicit subnet for those
containers instead of having one auto-created.
The specified subnet will be automatically delegated to `Microsoft.ContainerInstance/containerGroups`.
Ensure the subnet has outbound network security rules allowing access to Azure Active Directory (port 443)
and SQL (port 443) service tags.

## Definition

```go
func (AzureSqlServerResource) WithAdminDeploymentScriptSubnet(subnet AzureSubnetResource) AzureSqlServerResource
```

## Parameters

- `subnet` ([`AzureSubnetResource`](/reference/api/go/aspire.hosting.azure.sql/azuresubnetresource.md)) -- The subnet to delegate for Azure Container Instances used by deployment scripts.

## Returns

[`AzureSqlServerResource`](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource.md) -- The resource builder.

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

## Applies to

- [`AzureSqlServerResource`](/reference/api/go/aspire.hosting.azure.sql/azuresqlserverresource.md)
