1. Packages
  2. Azure Native
  3. API Docs
  4. web
  5. StaticSiteBuildDatabaseConnection
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

azure-native.web.StaticSiteBuildDatabaseConnection

Explore with Pulumi AI

Static Site Database Connection resource.

Uses Azure REST API version 2024-04-01. In version 2.x of the Azure Native provider, it used API version 2022-09-01.

Other available API versions: 2022-09-01, 2023-01-01, 2023-12-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native web [ApiVersion]. See the version guide for details.

Example Usage

Create or update a database connection for a static site build

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var staticSiteBuildDatabaseConnection = new AzureNative.Web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnection", new()
    {
        ConnectionIdentity = "SystemAssigned",
        ConnectionString = "AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;",
        DatabaseConnectionName = "default",
        EnvironmentName = "default",
        Name = "testStaticSite0",
        Region = "West US 2",
        ResourceGroupName = "rg",
        ResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName",
    });

});
Copy
package main

import (
	web "github.com/pulumi/pulumi-azure-native-sdk/web/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := web.NewStaticSiteBuildDatabaseConnection(ctx, "staticSiteBuildDatabaseConnection", &web.StaticSiteBuildDatabaseConnectionArgs{
			ConnectionIdentity:     pulumi.String("SystemAssigned"),
			ConnectionString:       pulumi.String("AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;"),
			DatabaseConnectionName: pulumi.String("default"),
			EnvironmentName:        pulumi.String("default"),
			Name:                   pulumi.String("testStaticSite0"),
			Region:                 pulumi.String("West US 2"),
			ResourceGroupName:      pulumi.String("rg"),
			ResourceId:             pulumi.String("/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.web.StaticSiteBuildDatabaseConnection;
import com.pulumi.azurenative.web.StaticSiteBuildDatabaseConnectionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var staticSiteBuildDatabaseConnection = new StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnection", StaticSiteBuildDatabaseConnectionArgs.builder()
            .connectionIdentity("SystemAssigned")
            .connectionString("AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;")
            .databaseConnectionName("default")
            .environmentName("default")
            .name("testStaticSite0")
            .region("West US 2")
            .resourceGroupName("rg")
            .resourceId("/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const staticSiteBuildDatabaseConnection = new azure_native.web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnection", {
    connectionIdentity: "SystemAssigned",
    connectionString: "AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;",
    databaseConnectionName: "default",
    environmentName: "default",
    name: "testStaticSite0",
    region: "West US 2",
    resourceGroupName: "rg",
    resourceId: "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

static_site_build_database_connection = azure_native.web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnection",
    connection_identity="SystemAssigned",
    connection_string="AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;",
    database_connection_name="default",
    environment_name="default",
    name="testStaticSite0",
    region="West US 2",
    resource_group_name="rg",
    resource_id="/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName")
Copy
resources:
  staticSiteBuildDatabaseConnection:
    type: azure-native:web:StaticSiteBuildDatabaseConnection
    properties:
      connectionIdentity: SystemAssigned
      connectionString: AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;
      databaseConnectionName: default
      environmentName: default
      name: testStaticSite0
      region: West US 2
      resourceGroupName: rg
      resourceId: /subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName
Copy

Create StaticSiteBuildDatabaseConnection Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new StaticSiteBuildDatabaseConnection(name: string, args: StaticSiteBuildDatabaseConnectionArgs, opts?: CustomResourceOptions);
@overload
def StaticSiteBuildDatabaseConnection(resource_name: str,
                                      args: StaticSiteBuildDatabaseConnectionArgs,
                                      opts: Optional[ResourceOptions] = None)

@overload
def StaticSiteBuildDatabaseConnection(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      environment_name: Optional[str] = None,
                                      name: Optional[str] = None,
                                      region: Optional[str] = None,
                                      resource_group_name: Optional[str] = None,
                                      resource_id: Optional[str] = None,
                                      connection_identity: Optional[str] = None,
                                      connection_string: Optional[str] = None,
                                      database_connection_name: Optional[str] = None,
                                      kind: Optional[str] = None)
func NewStaticSiteBuildDatabaseConnection(ctx *Context, name string, args StaticSiteBuildDatabaseConnectionArgs, opts ...ResourceOption) (*StaticSiteBuildDatabaseConnection, error)
public StaticSiteBuildDatabaseConnection(string name, StaticSiteBuildDatabaseConnectionArgs args, CustomResourceOptions? opts = null)
public StaticSiteBuildDatabaseConnection(String name, StaticSiteBuildDatabaseConnectionArgs args)
public StaticSiteBuildDatabaseConnection(String name, StaticSiteBuildDatabaseConnectionArgs args, CustomResourceOptions options)
type: azure-native:web:StaticSiteBuildDatabaseConnection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. StaticSiteBuildDatabaseConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. StaticSiteBuildDatabaseConnectionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. StaticSiteBuildDatabaseConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. StaticSiteBuildDatabaseConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. StaticSiteBuildDatabaseConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var staticSiteBuildDatabaseConnectionResource = new AzureNative.Web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnectionResource", new()
{
    EnvironmentName = "string",
    Name = "string",
    Region = "string",
    ResourceGroupName = "string",
    ResourceId = "string",
    ConnectionIdentity = "string",
    ConnectionString = "string",
    DatabaseConnectionName = "string",
    Kind = "string",
});
Copy
example, err := web.NewStaticSiteBuildDatabaseConnection(ctx, "staticSiteBuildDatabaseConnectionResource", &web.StaticSiteBuildDatabaseConnectionArgs{
	EnvironmentName:        pulumi.String("string"),
	Name:                   pulumi.String("string"),
	Region:                 pulumi.String("string"),
	ResourceGroupName:      pulumi.String("string"),
	ResourceId:             pulumi.String("string"),
	ConnectionIdentity:     pulumi.String("string"),
	ConnectionString:       pulumi.String("string"),
	DatabaseConnectionName: pulumi.String("string"),
	Kind:                   pulumi.String("string"),
})
Copy
var staticSiteBuildDatabaseConnectionResource = new StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnectionResource", StaticSiteBuildDatabaseConnectionArgs.builder()
    .environmentName("string")
    .name("string")
    .region("string")
    .resourceGroupName("string")
    .resourceId("string")
    .connectionIdentity("string")
    .connectionString("string")
    .databaseConnectionName("string")
    .kind("string")
    .build());
Copy
static_site_build_database_connection_resource = azure_native.web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnectionResource",
    environment_name="string",
    name="string",
    region="string",
    resource_group_name="string",
    resource_id="string",
    connection_identity="string",
    connection_string="string",
    database_connection_name="string",
    kind="string")
Copy
const staticSiteBuildDatabaseConnectionResource = new azure_native.web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnectionResource", {
    environmentName: "string",
    name: "string",
    region: "string",
    resourceGroupName: "string",
    resourceId: "string",
    connectionIdentity: "string",
    connectionString: "string",
    databaseConnectionName: "string",
    kind: "string",
});
Copy
type: azure-native:web:StaticSiteBuildDatabaseConnection
properties:
    connectionIdentity: string
    connectionString: string
    databaseConnectionName: string
    environmentName: string
    kind: string
    name: string
    region: string
    resourceGroupName: string
    resourceId: string
Copy

StaticSiteBuildDatabaseConnection Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The StaticSiteBuildDatabaseConnection resource accepts the following input properties:

EnvironmentName
This property is required.
Changes to this property will trigger replacement.
string
The stage site identifier.
Name
This property is required.
Changes to this property will trigger replacement.
string
Name of the static site
Region This property is required. string
The region of the database resource.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the resource group to which the resource belongs.
ResourceId This property is required. string
The resource id of the database.
ConnectionIdentity string
If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
ConnectionString string
The connection string to use to connect to the database.
DatabaseConnectionName Changes to this property will trigger replacement. string
Name of the database connection.
Kind string
Kind of resource.
EnvironmentName
This property is required.
Changes to this property will trigger replacement.
string
The stage site identifier.
Name
This property is required.
Changes to this property will trigger replacement.
string
Name of the static site
Region This property is required. string
The region of the database resource.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the resource group to which the resource belongs.
ResourceId This property is required. string
The resource id of the database.
ConnectionIdentity string
If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
ConnectionString string
The connection string to use to connect to the database.
DatabaseConnectionName Changes to this property will trigger replacement. string
Name of the database connection.
Kind string
Kind of resource.
environmentName
This property is required.
Changes to this property will trigger replacement.
String
The stage site identifier.
name
This property is required.
Changes to this property will trigger replacement.
String
Name of the static site
region This property is required. String
The region of the database resource.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the resource group to which the resource belongs.
resourceId This property is required. String
The resource id of the database.
connectionIdentity String
If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
connectionString String
The connection string to use to connect to the database.
databaseConnectionName Changes to this property will trigger replacement. String
Name of the database connection.
kind String
Kind of resource.
environmentName
This property is required.
Changes to this property will trigger replacement.
string
The stage site identifier.
name
This property is required.
Changes to this property will trigger replacement.
string
Name of the static site
region This property is required. string
The region of the database resource.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
Name of the resource group to which the resource belongs.
resourceId This property is required. string
The resource id of the database.
connectionIdentity string
If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
connectionString string
The connection string to use to connect to the database.
databaseConnectionName Changes to this property will trigger replacement. string
Name of the database connection.
kind string
Kind of resource.
environment_name
This property is required.
Changes to this property will trigger replacement.
str
The stage site identifier.
name
This property is required.
Changes to this property will trigger replacement.
str
Name of the static site
region This property is required. str
The region of the database resource.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the resource group to which the resource belongs.
resource_id This property is required. str
The resource id of the database.
connection_identity str
If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
connection_string str
The connection string to use to connect to the database.
database_connection_name Changes to this property will trigger replacement. str
Name of the database connection.
kind str
Kind of resource.
environmentName
This property is required.
Changes to this property will trigger replacement.
String
The stage site identifier.
name
This property is required.
Changes to this property will trigger replacement.
String
Name of the static site
region This property is required. String
The region of the database resource.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
Name of the resource group to which the resource belongs.
resourceId This property is required. String
The resource id of the database.
connectionIdentity String
If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
connectionString String
The connection string to use to connect to the database.
databaseConnectionName Changes to this property will trigger replacement. String
Name of the database connection.
kind String
Kind of resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the StaticSiteBuildDatabaseConnection resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
ConfigurationFiles List<Pulumi.AzureNative.Web.Outputs.StaticSiteDatabaseConnectionConfigurationFileOverviewResponse>
A list of configuration files associated with this database connection.
Id string
The provider-assigned unique ID for this managed resource.
Type string
Resource type.
AzureApiVersion string
The Azure API version of the resource.
ConfigurationFiles []StaticSiteDatabaseConnectionConfigurationFileOverviewResponse
A list of configuration files associated with this database connection.
Id string
The provider-assigned unique ID for this managed resource.
Type string
Resource type.
azureApiVersion String
The Azure API version of the resource.
configurationFiles List<StaticSiteDatabaseConnectionConfigurationFileOverviewResponse>
A list of configuration files associated with this database connection.
id String
The provider-assigned unique ID for this managed resource.
type String
Resource type.
azureApiVersion string
The Azure API version of the resource.
configurationFiles StaticSiteDatabaseConnectionConfigurationFileOverviewResponse[]
A list of configuration files associated with this database connection.
id string
The provider-assigned unique ID for this managed resource.
type string
Resource type.
azure_api_version str
The Azure API version of the resource.
configuration_files Sequence[StaticSiteDatabaseConnectionConfigurationFileOverviewResponse]
A list of configuration files associated with this database connection.
id str
The provider-assigned unique ID for this managed resource.
type str
Resource type.
azureApiVersion String
The Azure API version of the resource.
configurationFiles List<Property Map>
A list of configuration files associated with this database connection.
id String
The provider-assigned unique ID for this managed resource.
type String
Resource type.

Supporting Types

StaticSiteDatabaseConnectionConfigurationFileOverviewResponse
, StaticSiteDatabaseConnectionConfigurationFileOverviewResponseArgs

Contents This property is required. string
The Base64 encoding of the file contents.
FileName This property is required. string
The name of the configuration file.
Type This property is required. string
The type of configuration file.
Contents This property is required. string
The Base64 encoding of the file contents.
FileName This property is required. string
The name of the configuration file.
Type This property is required. string
The type of configuration file.
contents This property is required. String
The Base64 encoding of the file contents.
fileName This property is required. String
The name of the configuration file.
type This property is required. String
The type of configuration file.
contents This property is required. string
The Base64 encoding of the file contents.
fileName This property is required. string
The name of the configuration file.
type This property is required. string
The type of configuration file.
contents This property is required. str
The Base64 encoding of the file contents.
file_name This property is required. str
The name of the configuration file.
type This property is required. str
The type of configuration file.
contents This property is required. String
The Base64 encoding of the file contents.
fileName This property is required. String
The name of the configuration file.
type This property is required. String
The type of configuration file.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:web:StaticSiteBuildDatabaseConnection default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/databaseConnections/{databaseConnectionName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0