An example of a SQLServer on Azure PaaS
ADD
azure-cs-sqlserver/MyStack.cs
+// Copyright 2016-2022, Pulumi Corporation. All rights reserved.
+
+using System;
+using Pulumi;
+using AzureNative = Pulumi.AzureNative;
+using Resources = Pulumi.AzureNative.Resources;
+using Sql = Pulumi.AzureNative.Sql;
+using Pulumi.Random;
+
+class MyStack : Stack
+{
+ public MyStack()
+ {
+ var resourceGroup = new Resources.ResourceGroup("resourceGroup");
+
+ var password = new Pulumi.Random.RandomPassword("admin-password", new Pulumi.Random.RandomPasswordArgs { Length = 20 });
+
+ Sql.Server server = new Sql.Server(
+ "server",
+ new Sql.ServerArgs
+ {
+ AdministratorLogin = "admin-user",
+ AdministratorLoginPassword = password.Result,
+ ResourceGroupName = resourceGroup.Name,
+ ServerName = $"{Pulumi.Deployment.Instance.StackName}",
+ MinimalTlsVersion = "1.2",
+ PublicNetworkAccess = "Enabled"
+ });
+
+ this.ServerName = server.Name.Apply(servername => $"{servername}.database.windows.net");
+
+ Sql.Database database = new Sql.Database(
+ "db",
+ new Sql.DatabaseArgs
+ {
+ DatabaseName = "database",
+ ServerName = server.Name,
+ Collation = "SQL_Latin1_General_CP1_CI_AI",
+ ResourceGroupName = resourceGroup.Name,
+ Sku = new AzureNative.Sql.Inputs.SkuArgs
+ {
+ Capacity = 2,
+ Family = "Gen5",
+ Name = "GP_S", /*Serverless*/
+ }
+ });
+ }
+
+ [Output("serverName")]
+ public Output<string> ServerName { get; set; }
+
+}

ADD
azure-cs-sqlserver/Pulumi.yaml
+name: azure-cs-sqlserver
+runtime: dotnet
+description: An example of a SQLServer on Azure PaaS

ADD
azure-cs-sqlserver/README.md
+[![Deploy](https://get.pulumi.com/new/button.svg)](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/blob/master/azure-cs-sqlserver/README.md)
+
+# Static Website Using Azure Blob Storage and CDN
+
+This example configures [An example of a SQLServer on Azure PaaS](https://docs.microsoft.com/en-us/azure/azure-sql/database/logical-servers).
+
+In addition to the server itself, a database is configured
+
+## Running the App
+
+1. Create a new stack:
+
+ ```
+ $ pulumi stack init dev
+ ```
+
+1. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
+
+ ```
+ $ az login
+ ```
+1. Set the Azure region location to use:
+
+ ```
+ $ pulumi config set azure-native:location westus
+ ```
+
+1. Run `pulumi up` to preview and deploy changes:
+
+ ```
+ $ pulumi up
+ Previewing changes:
+ ...
+
+ Performing changes:
+ ...
+ Resources:
+ + 5 created
+ Duration: 3m16s
+ ```
+
+1. Check the deployed sql server and database

An example of a SQLServer on Azure PaaS