Skip to content

Instantly share code, notes, and snippets.

@terrajobst terrajobst/Program.cs Secret
Created Nov 7, 2019

Embed
What would you like to do?
using System;
using System.Collections.Generic;
using Pulumi;
using Pulumi.Azure.AppService;
using Pulumi.Azure.Core;
using Pulumi.Azure.CosmosDB;
class Program
{
static Task<int> Main(string[] args)
{
return Deployment.RunAsync(() => {
var locations = new[] { "WestUS", "WestEurope", "SouthEastAsia" };
var rg = new ResourceGroup("myapp-rg", new ResourceGroupArgs {
Location = locations[0],
});
var app = new CosmosApp("myapp", new CosmosAppArgs {
ResourceGroup = resourceGroup,
Locations = locations,
DatabaseName = "pricedb",
ContainerName = "prices",
Factory = (location, db) => {
var func = new ArchiveFunctionApp("myapp-func",
new ArchiveFunctionAppArgs {
Location = location,
Archive = new FileArchive("app"),
AppSettings = new Dictionary<string, string> {
["COSMOSDB_ENDPOINT"] = db.Endpoint,
},
},
);
return func.App.ID;
},
});
});
}
// Definitions of CosmosApp and ArchiveFunctionApp elided for brevity.
// Actual runtime application code is stored in the "app" directory.
// See link to the full example at the end of this article.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.