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

A solution for 25 days of serverless to implement a holiday registry using serverless Azure Functions and Durable Functions.

License

Notifications You must be signed in to change notification settings

JeremyLikness/Durable-Registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Durable Registry

This is a solution for Day 21 of the 25 Days of Serverless.

Free Azure Get your free Azure account

Quick Start

To run the solution locally, be sure you have installed:

Helpful, "good to have":

  1. Fork the repo (optional)
  2. Clone the repo: git clone https://github.com/JeremyLikness/durable-registry.git (change to your forked repo if necessary)
  3. Navigate to the src directory
  4. Add a local.settings.json and configure it to use the emulator:
    {
            "IsEncrypted": false,
            "Values": {
                    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
                    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
            }
    }
  5. Restore, build, and publish the app in one step, execute dotnet publish
  6. Change to the publish directory: cd bin\Debug\netcoreapp2.2\publish
  7. Copy the local settings: cp ../../../../local.settings.json .
  8. Start the Azure Storage Emulator
  9. Launch the functions app: func host start

Using the APIs

You can access the APIs directly from your browser or by using your favorite REST client tool (I prefer HTTP-REPL, listed above). All of the solution endpoints use the GET verb to make the example as easy as possible to use.

API Example

Open a new registry

http(s)://{endpoint}/api/Open

This will return a unique id. You have 5 minutes from the time you open a registry to add items and/or close it. A closed or timed out registry will not accept new entries.

Add an item to a registry

http(s)://{endpoint}/api/Add/{id}?item={item name}

You will receive 200 - OK if the registry is valid and open.

Finish (close) a registry

http(s)://{endpoint}/api/Finish/{id}

Once closed, you can no longer add items to the registry.

List the status and items in a registry

https(s)://{endpoint}/api/Peek/{id}

If a valid registry id is passed, this will return the status (open or closed) and items in the registry.

List overall status

http(s)://{endpoint}/api/Stats

This will show a count of all registries (open and closed) and a total count of items across all registries.

Learn More

You can learn more about the solution by reading the related blog post.

👉 Free Durable Functions Hands-on Lab

👉 Durable Functions Documentation

👉 Function Entities Documentation

Regards,

Jeremy Likness

About

A solution for 25 days of serverless to implement a holiday registry using serverless Azure Functions and Durable Functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages