Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Azure Functions Demo

This repository contains a demo project for Azure Functions using Java. The project includes a Queue and Blob based trigger, infrastructure deployment scripts, and configuration files.

Getting Started

Prerequisites

Tech I'm using

  • Bicep Azure Verified Modules to implement the IaC to support everything I need to demo this.
  • Coming Soon Github Actions - This will be used to automatically deploy everything on commit instead of having to manually run the deploy.<env>.sh script.

Deploying the Project to Azure

I have created a generic deploy.sh that can be used to deploy the project to azure by creating your own deploy.<env>.sh file. The simplest thing to do is to copy the deploy.sh to a new file based on the environment you are working with, so something like deploy.sandbox.sh and then replace all the values that are enclosed in <angle-brackets>.

This script will run the Bicep modules needed to create all the required resources to run this example and it will deploy the code to azure using the azure functionapp publish cli command. It supports three options: all, infra, and function.

./deploy.sh all|infra|function
  • all: Deploys both the infrastructure and the function.
  • infra: Deploys only the infrastructure.
  • function: Deploys only the function.

Configuration

  • host.json: Contains the configuration for the Azure Function host.
  • local.settings.json: Contains local settings for the Azure Functions project.
    • Here is an example local.settings.json file that you can use since it is in the .gitignore file so it won't be included. The A72151b_STORAGE connection is for the queue and blob trigger portion of the code.

      {
          "IsEncrypted": false,
          "Values": {
              "AzureWebJobsStorage": "UseDevelopmentStorage=true",
              "FUNCTIONS_WORKER_RUNTIME": "java"
          }
      }

Queue Triggered Function

This is the default queue based trigger that will just output some log information when it receives the message.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

My demo repo for all things java azure functions

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages