-
-
Save terrajobst/d3c82a5df99de1f10de81fd13d4f605a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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