Azure Functions

View Code Deploy

An example Pulumi program that deploys a TypeScript function to Azure Functions.

Running the App

  1. Create a new stack:

    $ pulumi stack init azure-fn
    
  2. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):

    $ az login
    
  3. Restore NPM dependencies:

    $ npm install
    
  4. Configure the location to deploy the example to:

    $ pulumi config set azure:location <location>
    
  5. Run pulumi up to preview and deploy changes:

    $ pulumi up
    Previewing changes:
    ...
    
    Performing changes:
    ...
    info: 9 changes performed:
        + 9 resources created
    Update duration: 1m20.493392283s
    
  6. Check the deployed function endpoint:

    $ pulumi stack output endpoint
    https://fn-app051a4f8b.azurewebsites.net/api/fn
    $ curl "$(pulumi stack output endpoint)"
    Greetings from Azure Functions!
    ...