Azure Functions in all supported languages
Azure Functions created from raw deployment packages in all supported languages
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set azure-ts-functions-manycd pulumi-examples/azure-ts-functions-manyAzure Functions created from raw deployment packages in all supported languages.
.NET and Java are precompiled languages, and the deployment artifact contains compiled binaries. You will need the following tools to build these projects:
- .NET Core SDK for the .NET Function App
- Apache Maven for the Java Function App
Please remove the corresponding resources from the program in case you don’t need those runtimes.
Prerequisites#
- Install Pulumi
- Configure Azure credentials
- Install Node.js
- Install .NET (for the .NET Function App)
- Install Apache Maven (for the Java Function App)
Deploying the example#
-
Build and publish the .NET Function App project:
Terminal window dotnet publish dotnet -
Build and publish the Java Function App project:
Terminal window mvn clean package -f java -
Create a new stack:
Terminal window pulumi stack init dev -
Log in to the Azure CLI (you will be prompted to do this during deployment if you forget this step):
Terminal window az login -
Set the Azure region to deploy into:
Terminal window pulumi config set azure-native:location <location> -
Install dependencies:
Terminal window npm install -
Run
pulumi upto preview and deploy changes:Terminal window pulumi upUpdating (dev):...Resources:+ 20 createdDuration: 2m42s -
Check the deployed function endpoints:
Terminal window pulumi stack output dotnetEndpointcurl "$(pulumi stack output dotnetEndpoint)"https://http-dotnet1a2d3e4d.azurewebsites.net/api/HelloDotnet?name=PulumiHello from .NET, Pulumi
Cleaning up#
Once you are done, you can destroy all of the resources, and the stack:
pulumi destroypulumi stack rm