Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AzureSqlServerResource

Handle
📦 Aspire.Hosting.Azure.Sql v17.0.0

Represents an Azure Sql Server resource.

type AzureSqlServerResource interface {
ExpressionValue
Resource
ResourceWithConnectionString
}

Properties

propertyAzureSqlDatabasesmap[string]AzureSqlDatabaseResourceget
A dictionary where the key is the resource name and the value is the Azure SQL database resource.
AzureSqlDatabases() (map[string]AzureSqlDatabaseResource, error)
propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection template for the manifest for the Azure SQL Server resource.
ConnectionStringExpression() *ReferenceExpression
propertyDatabasesmap[string]stringget
A dictionary where the key is the resource name and the value is the Azure SQL database name.
Databases() (map[string]string, error)
propertyFullyQualifiedDomainNameBicepOutputReferenceget
Gets the fully qualified domain name (FQDN) output reference from the bicep template for the Azure SQL Server resource.
FullyQualifiedDomainName() BicepOutputReference
propertyHostName*ReferenceExpressionget
Gets the host name for the SQL Server.
HostName() *ReferenceExpression
propertyIdBicepOutputReferenceget
Gets the "id" output reference for the resource.
Id() BicepOutputReference
propertyIsContainerboolget
Gets a value indicating whether the current resource represents a container. If so the actual resource is not running in Azure.
IsContainer() (bool, error)
propertyJdbcConnectionString*ReferenceExpressionget
Gets the JDBC connection string for the server.
JdbcConnectionString() *ReferenceExpression
propertyNameOutputReferenceBicepOutputReferenceget
Gets the "name" output reference for the resource.
NameOutputReference() BicepOutputReference
propertyPort*ReferenceExpressionget
Gets the port for the PostgreSQL server.
Port() *ReferenceExpression
propertyResourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
ResourceTypeDisplayName() (string, error)
propertyUriExpression*ReferenceExpressionget
Gets the connection URI expression for the SQL Server.
UriExpression() *ReferenceExpression

Methods

methodAddDatabasebuilder
Adds an Azure SQL Database to the application model. The Free Offer option will be used when deploying the resource in Azure
AddDatabase(
name string,
options ...*AddDatabaseOptions,
) AzureSqlDatabaseResource
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
options...*AddDatabaseOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddDatabaseOptions argument.

DatabaseName*stringThe name of the database. If not provided, this defaults to the same value as name.
AzureSqlDatabaseResource

The resource builder.

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

methodRunAsContainerbuilder
Configures an Azure SQL Database (server) resource to run locally in a container.
RunAsContainer(options ...*RunAsContainerOptions) AzureSqlServerResource
options...*RunAsContainerOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*RunAsContainerOptions argument.

ConfigureContainerfunc(obj SqlServerServerResource)callbackCallback that exposes underlying container to allow for customization.
AzureSqlServerResource

The resource builder.

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

Configures the Azure SQL Server to use the specified storage account for deployment script execution.
WithAdminDeploymentScriptStorage(storage AzureStorageResource) AzureSqlServerResource
storageAzureStorageResourceThe storage account to use for deployment scripts.
AzureSqlServerResource

The resource builder.

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

Configures the Azure SQL Server to use the specified subnet for deployment script execution.
WithAdminDeploymentScriptSubnet(subnet AzureSubnetResource) AzureSqlServerResource
subnetAzureSubnetResourceThe subnet to delegate for Azure Container Instances used by deployment scripts.
AzureSqlServerResource

The resource builder.

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