Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

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:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set azure-ts-functions-many
cd pulumi-examples/azure-ts-functions-many

Azure 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:

Please remove the corresponding resources from the program in case you don’t need those runtimes.

Prerequisites#

  1. Install Pulumi
  2. Configure Azure credentials
  3. Install Node.js
  4. Install .NET (for the .NET Function App)
  5. Install Apache Maven (for the Java Function App)

Deploying the example#

  1. Build and publish the .NET Function App project:

    Terminal window
    dotnet publish dotnet
  2. Build and publish the Java Function App project:

    Terminal window
    mvn clean package -f java
  3. Create a new stack:

    Terminal window
    pulumi stack init dev
  4. Log in to the Azure CLI (you will be prompted to do this during deployment if you forget this step):

    Terminal window
    az login
  5. Set the Azure region to deploy into:

    Terminal window
    pulumi config set azure-native:location <location>
  6. Install dependencies:

    Terminal window
    npm install
  7. Run pulumi up to preview and deploy changes:

    Terminal window
    pulumi up
    Updating (dev):
    ...
    Resources:
    + 20 created
    Duration: 2m42s
  8. Check the deployed function endpoints:

    Terminal window
    pulumi stack output dotnetEndpoint
    curl "$(pulumi stack output dotnetEndpoint)"
    https://http-dotnet1a2d3e4d.azurewebsites.net/api/HelloDotnet?name=Pulumi
    Hello from .NET, Pulumi

Cleaning up#

Once you are done, you can destroy all of the resources, and the stack:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.