Skip to content

Instantly share code, notes, and snippets.

@terrajobst
Created November 7, 2019 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save terrajobst/d3c82a5df99de1f10de81fd13d4f605a to your computer and use it in GitHub Desktop.
Save terrajobst/d3c82a5df99de1f10de81fd13d4f605a to your computer and use it in GitHub Desktop.
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