Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const username = "pulumi";
// Get the password to use for SQL from config.
const config = new pulumi.Config();
const pwd = config.require("sqlPassword");
const sqlServer = new azure.sql.SqlServer(`${prefix}-sql`, {
...resourceGroupArgs,
administratorLogin: username,
administratorLoginPassword: pwd,
version: "12.0",
});
const database = new azure.sql.Database(`${prefix}-db`, {
...resourceGroupArgs,
serverName: sqlServer.name,
requestedServiceObjectiveName: "S0",
});
const app = new azure.appservice.AppService(`${prefix}-as`, {
...resourceGroupArgs,
appServicePlanId: appServicePlan.id,
appSettings: {
"WEBSITE_RUN_FROM_ZIP": codeBlobUrl,
"ApplicationInsights:InstrumentationKey": appInsights.instrumentationKey,
"APPINSIGHTS_INSTRUMENTATIONKEY": appInsights.instrumentationKey,
},storageAccountName: storageAccount.name,
containerAccessType: "private",
});
// Azure SQL Server that we want to access from the application
const administratorLoginPassword = new random.RandomPassword("password", { length: 16, special: true }).result;
const sqlServer = new azure.sql.SqlServer("sqlserver", {
resourceGroupName: resourceGroup.name,
// The login and password are required but won't be used in our application
administratorLogin: "manualadmin",
administratorLoginPassword,
version: "12.0",
});
// Azure SQL Database that we want to access from the application
const database = new azure.sql.Database("sqldb", {
resourceGroupName: resourceGroup.name,
serverName: sqlServer.name,
requestedServiceObjectiveName: "S0",
});
// The connection string that has no credentials in it: authertication will come through MSI
const connectionString = pulumi.interpolate`Server=tcp:${sqlServer.name}.database.windows.net;Database=${database.name};`;
// A file in Blob Storage that we want to access from the application
const textBlob = new azure.storage.Blob("text", {
storageAccountName: storageAccount.name,
storageContainerName: storageContainer.name,
type: "block",
source: "./README.md",
});const codeBlobUrl = azure.storage.signedBlobReadUrl(blob, storageAccount);
const appInsights = new azure.appinsights.Insights(`${prefix}-ai`, {
...resourceGroupArgs,
applicationType: "Web",
});
// Get the password to use for SQL from config.
const config = new pulumi.Config();
const username = config.require("sqlUsername");
const pwd = config.require("sqlPassword");
const sqlServer = new azure.sql.SqlServer(`${prefix}-sql`, {
...resourceGroupArgs,
administratorLogin: username,
administratorLoginPassword: pwd,
version: "12.0",
});
const database = new azure.sql.Database(`${prefix}-db`, {
...resourceGroupArgs,
serverName: sqlServer.name,
requestedServiceObjectiveName: "S0",
});
const app = new azure.appservice.AppService(`${prefix}-as`, {
...resourceGroupArgs,// Get the password to use for SQL from config.
const config = new pulumi.Config();
const username = config.require("sqlUsername");
const pwd = config.require("sqlPassword");
const sqlServer = new azure.sql.SqlServer(`${prefix}-sql`, {
...resourceGroupArgs,
administratorLogin: username,
administratorLoginPassword: pwd,
version: "12.0",
});
const database = new azure.sql.Database(`${prefix}-db`, {
...resourceGroupArgs,
serverName: sqlServer.name,
requestedServiceObjectiveName: "S0",
});
const app = new azure.appservice.AppService(`${prefix}-as`, {
...resourceGroupArgs,
appServicePlanId: appServicePlan.id,
appSettings: {
"WEBSITE_RUN_FROM_ZIP": codeBlobUrl,
"ApplicationInsights:InstrumentationKey": appInsights.instrumentationKey,
"APPINSIGHTS_INSTRUMENTATIONKEY": appInsights.instrumentationKey,
"ASPNETCORE_ENVIRONMENT": "Development",// Create a storage account for Blobs
const storageAccount = new azure.storage.Account("storage", {
resourceGroupName: resourceGroup.name,
accountReplicationType: "LRS",
accountTier: "Standard",
});
// The container to put our files into
const storageContainer = new azure.storage.Container("files", {
storageAccountName: storageAccount.name,
containerAccessType: "private",
});
// Azure SQL Server that we want to access from the application
const administratorLoginPassword = new random.RandomPassword("password", { length: 16, special: true }).result;
const sqlServer = new azure.sql.SqlServer("sqlserver", {
resourceGroupName: resourceGroup.name,
// The login and password are required but won't be used in our application
administratorLogin: "manualadmin",
administratorLoginPassword,
version: "12.0",
});
// Azure SQL Database that we want to access from the application
const database = new azure.sql.Database("sqldb", {
resourceGroupName: resourceGroup.name,
serverName: sqlServer.name,
requestedServiceObjectiveName: "S0",
});
// The connection string that has no credentials in it: authertication will come through MSI
const connectionString = pulumi.interpolate`Server=tcp:${sqlServer.name}.database.windows.net;Database=${database.name};`;const codeBlobUrl = azure.storage.signedBlobReadUrl(blob, storageAccount);
const appInsights = new azure.appinsights.Insights(`${prefix}-ai`, {
...resourceGroupArgs,
applicationType: "Web",
});
const username = "pulumi";
// Get the password to use for SQL from config.
const config = new pulumi.Config();
const pwd = config.require("sqlPassword");
const sqlServer = new azure.sql.SqlServer(`${prefix}-sql`, {
...resourceGroupArgs,
administratorLogin: username,
administratorLoginPassword: pwd,
version: "12.0",
});
const database = new azure.sql.Database(`${prefix}-db`, {
...resourceGroupArgs,
serverName: sqlServer.name,
requestedServiceObjectiveName: "S0",
});
const app = new azure.appservice.AppService(`${prefix}-as`, {
...resourceGroupArgs,