GithubHelp home page GithubHelp logo

dltanglin / serverless-reference-implementation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mspnp/serverless-reference-implementation

0.0 1.0 0.0 590 KB

Serverless reference implementation guidance

License: MIT License

JavaScript 9.68% C# 73.66% TypeScript 16.66%

serverless-reference-implementation's Introduction

Drone Delivery Serverless

This project contains a reference implementation for two serverless application architectures.

Serverless web application

The application serves static content from Azure Blob Storage, and implements an API using Azure Functions. The API reads data from Cosmos DB and returns the results to the web app.

Serverless event processing

The application ingests a stream of data, processes the data, and writes the results to a back-end database (Cosmos DB).

For more information about these architectures, including guidance about best practices, see the following articles in the Azure Architecture Center:

Deployment

Follow steps here to deploy this reference implementation.

Drone Status Function App CI/CD with Azure DevOps

Add CI/CD to Drone Status using Azure Pipelines with YAML and Azure Functions Slots.

Prerequistes

  1. Create Azure DevOps account
  2. Add Azure subscription as service connection
  3. Optionally, assign service connection application to role, so it is allowed to create new azure resources
  4. Create a Github or Azure Repos repository.

Configure CI/CD using Azure Pipelines

Clone and add remote

git clone https://github.com/mspnp/serverless-reference-implementation.git && \
cd serverless-reference-implementation && \
git remote add <remote-name> <remote-url> # this remote url corresponds to the prerequisite step 4th

Export the following environment variables

export SERVICECONNECTION=<service-connection-name> # use the name configured in the 2nd prerequisite step
export LOCATION=<location>
export RESOURCEGROUP=<resource-group>
export APPNAME=<app-name> # less or equal than 6 chars
export SLOTNAME=<slot-name>

Replace Azure Pipeline place holders

sed -i "s#ServiceConnectionName: '<serviceconnection>'#ServiceConnectionName: '$SERVICECONNECTION'#g" azure-pipelines.yml && \
sed -i "s#Location: '<location>'#Location: '$LOCATION'#g"  azure-pipelines.yml && \
sed -i "s#ResourceGroup: '<resourcegroup>'#ResourceGroup: '$RESOURCEGROUP'#g" azure-pipelines.yml && \
sed -i "s#AppName: '<appName>'#AppName: '$APPNAME'#g" azure-pipelines.yml && \
sed -i "s#SlotName: '<slotName>'#SlotName: '$SLOTNAME'#g" azure-pipelines.yml

Push changes to azure repos or github

git push <remote-name> master

Follow instructions below to configure your first Azure Pipeline

Get your first build with Azure Pipelines

Note: this first build will attemp to execute the azurepipeline.yml against master

Trigger the CI/CD pipeline by pushing to staging

git checkout -b staging && \
git push <remote-name> staging

Note: also feature branches are going through the CI pipeline.

Follow CI/CD from Azure Pipelines

open https://dev.azure.com/<organization-name>/<project-name>/_build

serverless-reference-implementation's People

Contributors

kirpasingh avatar veronicawasson avatar fsimonazzi avatar ckittel avatar jocontr avatar dependabot[bot] avatar dsk-2015 avatar eivindarvesen avatar francischeung avatar rgardler-msft avatar carstenplemm avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.