Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

vrhovnik/azure-demo-serverless

Repository files navigation

Demo repository to demonstrate Azure Serverless solutions

Demo repository to demonstrate Azure Serverless solutions, which demonstrate how to leverage simple application and then extend it with the use of serverless.

Azure Serverless in a Nutshell

STRUCTURE

The demo solution is built with 3 parts in mind:

Demo solution structure

Each of them represents functionalities:

  1. Core - for common libraries and models to be used by functions and GUI
  2. Func - Azure Functions code for demonstrating different functionalities.
  3. Web - code for web user interface to be able to execute demo scenarios

INSTRUCTIONS

In order to run the project locally you will need to have .NET 6 installed and configured runtime for running Azure Functions. Follow the instructions here how to set it up.

You can pick whatever tool you fit appropriately. We do recommend Visual Studio or Visual Studio Code.

Open solution AzureServelessDemo.Web.sln in tool of your choice to see the code. In order to run it locally, you will need to setup environment variables in:

  1. AzureServerlessDemo.Functions:
    • SendEmail
      • SendGridApiKey - key for SendGrid service, which will be used for sending emails
      • default-emails - emails separated with ;
    • BetterWorkflow
      • SendGridApiKey - key for SendGrid service, which will be used for sending emails
      • default-emails - emails separated with ;
      • AzureWebJobsStorage - connection string for Azure Storage Account (or leave UseDevelopmentStorage=true for local development)
    • TighterIntegrationWorkflow:
      • EventGridNotificationEndpoint - endpoint url to handle notification for this scenario
      • EventGridKey - key to authenticate with Azure Event Grid
  2. AzureServerlessDemo.Web:
    • StorageOptions__ConnectionString - connection string to Azure Storage or local development storage UseDevelopmentStorage=true - check appsettings.json as well for additional requirements:
    • FunctionURL - url pointing to the base URL for Azure Function
    • SimpleWorkflowUrl - url pointing to workflow to execute simple scenarios
    • BetterWorkflowUrl - url pointing to workflow to execute showcase, how to do better scenario based on simple scenario
    • TighterWorkflowUrl - url pointing to workflow to execute scenario with tighter integration with Azure services
    • Azure__SignalR__ConnectionString - Azure SignalR connection string for realtime updates

When you have that configured, you can run web project and functions project separately to see the execution and GUI respectively.

How to run web project --> described here. How to run functions project --> described here.

CREDIT

In the application itself (for the presentation and for management) I used:

  1. HTMX for accessing modern browser features and helpers from Khalid Abuhmed
  2. Bootstrap 5 for CSS framework for GUI

Additional Information

  1. Azure Serverless
  2. Azure Functions
  3. Azure Samples