Create an Azure-Native.sql.Database Resource
This Pulumi program will create an Azure SQL Database using the azure-native provider in TypeScript. The key services involved include Azure SQL Server and Azure SQL Database. The program will first create an Azure SQL Server, and then create an Azure SQL Database within that server.
Full Code Example
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure-native";
// Create an Azure Resource Group
const resourceGroup = new azure.resources.ResourceGroup("resourceGroup", {
resourceGroupName: "sql-rg",
location: "West US",
});
// Create an Azure SQL Server
const sqlServer = new azure.sql.Server("sqlServer", {
resourceGroupName: resourceGroup.name,
serverName: "sqlserver1234",
location: resourceGroup.location,
administratorLogin: "sqladmin",
administratorLoginPassword: "P@ssw0rd1234",
version: "12.0",
});
// Create an Azure SQL Database
const sqlDatabase = new azure.sql.Database("sqlDatabase", {
resourceGroupName: resourceGroup.name,
serverName: sqlServer.name,
databaseName: "sqldatabase1",
location: resourceGroup.location,
sku: {
name: "S0",
tier: "Standard",
},
});
export const sqlServerName = sqlServer.name;
export const sqlDatabaseName = sqlDatabase.name;
Deploy this code
Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.
Sign upNew to Pulumi?
Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.
Sign upThank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.