• Stars
    star
    176
  • Rank 216,987 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This solution is a personal knowledge management system and it allows users to upload text, images, and audio into categories. Each of these types of data is managed by a dedicated microservice built on Azure serverless technologies including Azure Functions and Cognitive Services. The web front-end communicates with the microservices through a SignalR-to-Event Grid bridge, allowing for real-time reactive UI updates based on the microservice updates. Each microservice is built and deployed independently using VSTS’s build and release management system, and use a variety of Azure-native data storage technologies.
page_type languages products description urlFragment
sample
csharp
typescript
html
powershell
javascript
azure
In this sample, we have built four microservices that use an Event Grid custom topic for inter-service eventing,
Serverless-Eventing-Platform-for-Microservices

Content Reactor: Serverless Microservice Sample for Azure

In this sample, we have built four microservices that use an Event Grid custom topic for inter-service eventing, and a front-end Angular.js app that uses SignalR to forward Event Grid events to the user interface in real time.

The application itself is a personal knowledge management system, and it allows users to upload text, images, and audio and for these to be placed into categories. Each of these types of data is managed by a dedicated microservice built on Azure serverless technologies including Azure Functions and Cognitive Services. The web front-end communicates with the microservices through a SignalR-to-Event Grid bridge, allowing for real-time reactive UI updates based on the microservice updates. Each microservice is built and deployed independently using Azure DevOps’s build and release management system, and use a variety of Azure-native data storage technologies.

The sample can be built and run by following the instructions in the setup.md file.

Microservices

The back-end components of this sample are written as microservices. Microservice architectures have the benefit that complex systems can be be decomposed into modular, granular, independently written and deployable pieces. Each microservice has a defined domain of responsibility, and can be designed and written using appropriate technologies and architectural patterns that make sense for that particular domain. In a large organisation, different teams may be responsible for different microservices, allowing for each microservice to be built in parallel.

Microservice architectures have a number of characteristics, including:

  • Defined domain: Each microservice has a defined domain of responsibility (sometimes referred to as a bounded context). The microservice manages this domain itself, without concerning itself about other domains.
  • Self-contained: Each microservice is a self-contained unit. It may contain multiple components that all work together.
  • Independently deployable: Each microservice can be built and deployed as an independent entity. Deploying one microservice does not affect another microservice.
  • Manages data stores: The data store or stores used by each microservice should be contained within the microservice boundary, thereby ensuring that there are no hidden dependencies caused by data stores being shared.
  • Loosely coupled: Microservices should be loosely coupled, and ideally communication will occur asynchronously using event sourcing or queues.
  • Highly automated: The build, deployment, and ongoing management of microservices should emphasise automation wherever possible.
  • Uses appropriate technologies: The developers of each microservice can select the appropriate technologies that make sense for its domain. Some microservices may best be built with functional languages while others use imperative or general-purpose languages; some may be built using container technology or Service Fabric while others make sense to be built using serverless and PaaS technology. This sample demonstrates how a loosely coupled microservice architecture can be built using Azure Functions and other Azure platform-as-a-service (PaaS) and serverless components.

More information on the overall philosophy behind microservices is available from Sam Newman's Principles of Microservices talk.

Communication Between Microservices

A key tenet of microservice architecture is that microservices are loosely coupled. While microservices can communicate together, communication should be fairly lightweight and should be conducted in a well-defined manner. If synchronous (real-time) communication is necessary then it should take place through well-known, published APIs and should not involve direct remote procedure calls or direct access to data stores or internal components of the microservice. Where possible, asynchronous communication should be used to choreograph multiple microservices.

Azure provides a number of different asynchronous messaging services, including queues (e.g. Azure Storage queues and Service Bus queues and topics), streams (e.g. Event Hubs), and events (e.g. Event Grid). An event-based architecture is a common way to allow microservices to inform other microservices of their activities, and in this sample we use Event Grid.

Event Grid allows for events to be published to a common store (topic), and distributed to any interested parties (subscribers) who may need to know about the events. Communication - both publishing and subscribing - occurs using HTTP, which means that Event Grid messages can be published and consumed by clients on virtually any platform, including on Azure Functions. Events contain a common set of metadata as well as any custom data relevant to the business domain, and Event Grid provides the ability to apply filters to subscriptions so that only relevant events are forwarded to each microservice. Finally, as a managed service, Event Grid provides a strong SLA and automatically handles data integrity as well as retries failed deliveries.

Sample Architecture

The sample contains four microservices, each with defined responsibilities: one for managing categories, one for audio notes, one for image notes, and one for text notes. The microservices each contain:

  • A front-end API for users to manage their data, built on Azure Functions and using many RESTful design principles;
  • A data store, owned and managed by the microservice itself, that is appropriate for the data being stored;
  • Back-end APIs as needed, with Event Grid subscription triggers.

Event Grid is used to allow for loosely coupled communication between the microservices. The sample contains an Event Grid custom topic, and each microservice publishes events to the topic as they occur. The back-end APIs subscribe to particular types of events from the topic and process them according to their own business rules.

Additionally, there is a single Azure Functions Proxies application that exposes the microservices' front-end APIs.

The sample also contains an Angular.js application that is bundled within an ASP.NET WebApp which serves as a middleware to enable bi-directional communication between the front end browser and the Azure functions backend.

Architecture Diagram

Each microservice and other components within the sample are designed to be built and deployed in a fully automated manner. We used Azure DevOps, although any other build and release management systems could also be used. We used Azure DevOps's Build YAML feature to declaratively specify our build process and used Azure DevOps Release Management to define our release process and publish the built components to Azure. Please see the setup.md file for more information on how to build and release the sample components for yourself.

Components

Event Grid Topic

Event Grid is the messaging technology used by the microservices for orchestration. Each microservice publishes events onto an Event Grid custom topic. Microservices, and the front end components, subscribe to this Event Grid custom topic and perform their own business logic based on the events they process.

In this sample, the Event Grid custom topic is in its own resource group, ContentReactor-Events.

Categories Microservice

The categories microservice is responsible for tracking the categories that notes are placed in, as well as providing an index of the notes within each category. The microservice provides an API for creating and managing categories, and the category data is stored within a Cosmos DB collection.

When a new category is created, or the name of a category is updated, the categories API processes the change and publishes an event onto the Event Grid custom topic. Event Grid then forwards these events to the categories microservice's worker API, which has two Event Grid subscribers: the UpdateCategorySynonyms function will communicate with Big Huge Thesaurus's API to find a set of synonyms for the category, and the AddCategoryImage function will communicate with the Bing Image Search API to conduct an image search and randomly choose an image to represent the category.

When notes are created, updated, or deleted in other microservices, the categories worker API has Event Grid subscriber functions to update the item list for that category.

The categories microservice maintains a preview for each note. For image notes, this is a link to the preview image. For text notes, this is the first 100 characters of the note. For audio notes, this is the first 100 characters of the audio transcript.

The categories microservice components are in a resource group named ContentReactor-Categories.

Images Microservice

The images microservice maintains the image notes that a user creates. Images up to 4MB in size can be uploaded to the microservice's API. The images microservice takes responsibility for creating a small preview of the image, and for obtaining a description of the image from Azure Cognitive Services. Images are stored within an Azure Storage blob collection.

When an image is uploaded, the images API stores the image in the fullimages blob collection, and also creates a preview image to store in a separate previewimages blob collection. An ImageCreated event is then published onto the Event Grid custom topic. Event Grid forwards the event to the categories microservice, as well as to the images microservice's worker API, which has a function UpdateImageCaption that uses Azure Cognitive Services' Computer Vision API to obtain a caption for the image. This is then saved to the blob metadata and is returned in subsequent requests to the microservice's API.

When images are updated (e.g. when the caption is updated) or deleted, the microservice publishes events that are used by the categories microservice as well as any other interested components.

The images microservice components are in a resource group named ContentReactor-Images.

Audio Microservice

The audio microservice maintains the audio notes that a user creates. Short audio files of less than 15 seconds duration can be uploaded to the microservice's API. The audio microservice stores the files within an Azure Storage blob collection and then takes responsibility for transcribing the audio to text.

When an audio file is uploaded, the audio API stores the file in the audio blob collection, and publishes an AudioCreated event to the Event Grid custom topic. Event Grid then forwards the event to the categories microservice, as well as the audio microservice's worker API, which has a function UpdateAudioTranscript that uses the Bing Speech API to obtain a transcript for the audio. This is then saved to the blob metadata and is returned in subsequent requests to the microservice's API.

When audio files are uploaded (i.e. when the transcript is updated) or deleted, the microservice publishes events that are used by the categories microservice as well as any other interested components.

The audio microservice components are in a resource group named ContentReactor-Audio.

Text Microservice

The text microservice maintains the text notes that a user creates. Text can be uploaded to the microservice's API, and the microservice stores it in a Cosmos DB collection.

When a text note is submitted to the API, the text API stores the text and then publishes a TextCreated event to the Event Grid custom topic. Event Grid then forwards the event to the categories microservice.

When text notes are updated or deleted, the microservice publishes events that are used by the text microservice as well as any other interested components.

The audio microservice components are in a resource group named ContentReactor-Text.

Proxies

Each of the microservices presents a public-facing API for working with the resources they manage. In keeping with best practices for exposing multiple microservice-hosted APIs, the sample includes an API proxy that presents the four APIs at a single hostname. This simplifies the client side, ensuring it only has to know about a single base URL. The API proxy is built using Azure Functions Proxies.

Front-End

The front-end is built as an Angular application that is bundled inside an ASP.NET web app. The ASP.NET web app plays the following roles:

  • Uses SignalR to push notifications from Event Grid up to the front-end Angular app served in a browser.
  • Provides APIs that in turn call the Microservices APIs.

The front-end uses the @aspnet/signalr NPM package, which encapsulates connections to the SignalR Hub.

In order to remove dependencies between UI component frameworks and Angular, the front end HTML/CSS uses plain and simple Bootstrap and is built with Angular 5 using the Angular CLI. This reduces dependency restrictions on any UI component frameworks.

The front-end Angular application is built as a standalone application using npm commands and then bundled with the ASP.NET web app through MSBuild scripts. This way, the front-end framework can be easily swapped with another framework (e.g. React.js) in future. No coupling exists between the front-end and the ASP.NET Middleware through code dependencies.

The front-end is designed to expect responses as part of CRUD operations and listen to events that are consequences of the operations. Alternately, it can also be used in a 'fire and forget' fashion, where the front-end can fire any CRUD event and then wait for SignalR/Event Grid notifications that it uses to update itself.

The front-end consists of the following scaffolding from Angular CLI and the app folder is further customized:

  • Login Component: This component is responsible for logging in a user, by setting up connections to the SignalR Hub for the user. It also deals with routing to the next page after a successful login. See the User Authentication and Authorization section below for more information.
  • Category Component: This deals with category CRUD operations and uses observables to bind the items within a category.
  • Item Component: This component represents image, text, and audio items where each item is represented by its own model classes.
  • Hub Service: This service is responsible for creating the connection to the SignalR hub and serves as an injectable service to any component.
  • Data Service: This service holds data that needs to be shared among components, as observables. For example, once a user is successfully logged in, the userId is stored in this service as an observable and can be accessed by other components and services.

The app.module.ts file bootstraps the application.

Note: The front end is not optimized for mobile browsers.

Middleware

The front-end and the Azure Functions/Event Grid backend are connected by ASP.NET middleware that uses the latest preview version of .NET Core.

The ASP.NET web app maintains a list of users and a list of connection IDs per user, as a user could be logged in from multiple devices. It registers itself as a webhook-based Event Grid subscription and pushes notifications to the front end through a SignalR Hub called the EventHub.

The Hub Context is then used by other applications to send and receive data from the hub.

The connection between the SignalR front-end and backend is refreshed on each disconnection event to enable a fully connected scenario. After reconnection, the connection IDs for a user are updated by the middleware.

Note:

  • The latest ASP.NET Core 2.1 preview version bundles the SignalR library, within the AspNetCore.All NuGet package.
  • The ASP.NET SignalR component is wired for bidirectional communication. The front-end-to-backend call is designed as a typical controller API call, but it is also possible to invoke the backend directly via SignalR.
  • The front end/middleware and backend can be substituted with other frameworks. For example, React.js/Socket.io and Node.js can also be a combination respectively.

User Authentication and Authorization

This sample allows for multiple users to store and retrieve notes. Each microservice is responsible for using the appropriate tools at its disposal for ensuring separation between users; the categories and text microservices use Cosmos DB's partitioned collections feature to store each user's data on a separate partition, while the images and audio microservices use Azure Storage's blob folders to achieve a similar goal. The front-end APIs on each microservice accept the user's ID in their query strings and perform operations on the data in the context of that user.

We have not implemented a user management system, nor any form of true authentication. In the sample, the front-end UI prompts the user to create an account and assigns a user ID, but there is no validation of users (e.g. using a password or federated identity). The microservice APIs assume that the user's identity has been fully verified by the front-end UI, which is not in keeping with best security practices and would need to be updated before being production ready.

While it's out of the scope of this sample, it would certainly be possible to build authentication and user identity handling into the system. There are a number of approaches that could be used including adding federated identity and using Azure AD B2C.

Approach 1: Federated Identity

A number of public identity providers, such as Facebook, Twitter, Google, or Microsoft's Live ID, can be used to provide identity services to the Content Reactor system. In general, the following steps could be followed to use this type of federated identity approach:

  1. Set up a client application within the relevant identity provider. For example, this page contains instructions on creating a Facebook application.
  2. Update the front-end application to obtain a token from the identity provider, using the relevant OpenID Connect flow, and attach it to all API requests.
  3. Set up each microservice's front-end API Functions app to check for authorization. This blog post provides some helpful advice on how to authenticate tokens from within an Azure Functions app.
  4. Update each microservice's front-end API Functions app to use the subject ID or a user ID claim as the user ID within the Content Reactor system, and remove the userId query string parameter from each API operation.

Approach 2: Azure AD B2C

Azure AD B2C is a fully managed identity system for consumer-facing apps. It uses open standards, including JSON Web Tokens (JWTs) and OpenID Connect, allowing for interoperability across a range of client and server platforms. It also provides additional features including federation with other identity providers, and advanced policies and claims.

Integrating Content Reactor with Azure AD B2C is conceptually similar to working with any other identity provider described above. However, there are a few small differences to be aware of.

  1. Set up an Azure AD B2C tenant and link it to your Azure subscription.
  2. Register your instance of the Content Reactor web app with the Azure AD B2C tenant.
  3. Update the front-end application to obtain a token from Azure AD B2C.
  4. Set up each microservice's front-end API Functions app to check for authorization. This blog post provides specific instructions on using Azure AD B2C with Azure Functions.
  5. Update each microservice's front-end API Functions app to use the subject ID or a user ID claim as the user ID within the Content Reactor system, and remove the userId query string parameter from each API operation.

Event Types Reference

Event Type Publisher Published When Microservice Subscribers
AudioCreated Audio microservice New audio has been created (after the call to the CompleteCreateAudio function)
  • Audio microservice's UpdateAudioTranscript function
  • Categories microservice’s AddCategoryItem function
AudioDeleted Audio microservice Audio note has been deleted
  • Categories microservice’s DeleteCategoryItem function
AudioTranscriptUpdated Audio microservice Audio note’s transcript has been modified
CategoryCreated Categories microservice Category has been created
  • Categories microservice’s UpdateCategorySynonyms function
  • Categories microservice’s AddCategoryImage function
CategoryDeleted Categories microservice Category has been deleted
CategoryImageUpdated Categories microservice Image for a category has been created
CategoryItemsUpdated Categories microservice Any items have been added to or removed from a category (note: this event does not include details of items in category; issue a GET to get this list)
CategoryNameUpdated Categories microservice The name of a category has been changed
CategorySynonymsUpdated Categories microservice The synonyms have been added or updated for a category (i.e. after the category is added or the name is updated)
ImageCaptionUpdated Images microservice The caption for an image has been updated (i.e. after the image has been created)
ImageCreated Images microservice New image note has been created (after the call to the CompleteCreateImage function)
  • Images microservice’s UpdateImageCaption function
  • Categories microservice’s AddCategoryItem function
ImageDeleted Images microservice Image note has been deleted
  • Categories microservice’s DeleteCategoryItem function
TextCreated Text microservice New text note has been created
  • Categories microservice’s AddCategoryItem function
TextDeleted Text microservice Text note has been deleted
  • Categories microservice’s DeleteCategoryItem function
TextUpdated Text microservice Whenever the contents of a text note has been changed

Sample Requests

Note that these sample requests use the hostname crprodapiproxy.azurewebsites.net. You should replace this with your proxy app's hostname.

Categories Microservice's API

Create Category

POST https://crprodapiproxy.azurewebsites.net/api/categories?userId={userId} HTTP/1.1

{
  "name": "{name}"
}

Should return an HTTP 200 OK with an ‘id’.

Get Category

GET https://crprodapiproxy.azurewebsites.net/api/categories/{categoryId}?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the category details, including (after a short period of time) the image URL and synonyms, and any items added to the category.

List Categories for User

GET https://crprodapiproxy.azurewebsites.net/api/categories?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the category summary – the name and ID of the category.

Update Category Name

PATCH https://crprodapiproxy.azurewebsites.net/api/categories/{categoryId}?userId={userId} HTTP/1.1

{
  "name": "{newName}"
}

Should return an HTTP 204 No Content.

Delete Category

DELETE https://crprodapiproxy.azurewebsites.net/api/categories/{categoryId}?userId={userId} HTTP/1.1

Should return an HTTP 204 No Content.

Audio Microservice's API

Create Audio Note

Note that creating an audio note is done in three parts. First, the client should issue a request to the audio API without a payload:

POST https://crprodapiproxy.azurewebsites.net/audio?userId={userId} HTTP/1.1

This will return an HTTP 200 OK with a response body that includes an id (the audio note's ID) and an url (an Azure Storage blob URL with a SAS token allowing the client to upload the audio file to this location).

Second, the client should use the url parameter they obtained to upload the audio file as a blob using the Azure Storage SDK or a REST API.

Third, the client should make the following request to the audio API:

POST https://crprodapiproxy.azurewebsites.net/audio/{audioId}?userId={userId} HTTP/1.1

{
  "categoryId": "{categoryId}"
}

The id parameter they obtained should be included in the URL, and they should also include the ID for the category that this note should be placed into. Should return an HTTP 204 No Content.

Get Audio Note

GET https://crprodapiproxy.azurewebsites.net/audio/{audioId}?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the audio note details, including the audio file's URL, and (after a short time) the transcript. The URL includes a time-limited SAS token allowing the client to read the blob.

List Audio Notes for User

GET https://crprodapiproxy.azurewebsites.net/audio?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the audio notes summary – the ID of each audio note and preview of its transcript, if known.

Delete Audio Note

DELETE https://crprodapiproxy.azurewebsites.net/audio/{audioId}?userId={userId} HTTP/1.1

Should return an HTTP 204 No Content.

Images Microservice's API

Create Image Note

Note that creating an image note is done in three parts. First, the client should issue a request to the images API without a payload:

POST https://crprodapiproxy.azurewebsites.net/images?userId={userId} HTTP/1.1

This will return an HTTP 200 OK with a response body that includes an id (the image note's ID) and a url (an Azure Storage blob URL with a SAS token allowing the client to upload the image to this location).

Second, the client should use the url parameter they obtained to upload the image file as a blob using the Azure Storage SDK or a REST API.

Third, the client should make the following request to the images API:

POST https://crprodapiproxy.azurewebsites.net/images/{imageId}?userId={userId} HTTP/1.1

{
  "categoryId": "{categoryId}"
}

The id parameter they obtained should be included in the URL, and they should also include the ID for the category that this note should be placed into. Should return an HTTP 200 OK with the preview URL included.

Get Image Note

GET https://crprodapiproxy.azurewebsites.net/images/{imageId}?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the image note details, including the full-size image URL and preview URL, and (after a short time) the image caption. The URLs include a time-limited SAS token allowing the client to read the blob.

List Image Notes for User

GET https://crprodapiproxy.azurewebsites.net/images?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the image notes summary – the ID of each image note and preview of the caption, if known.

Delete Image Note

DELETE https://crprodapiproxy.azurewebsites.net/images/{imageId}?userId={userId} HTTP/1.1

Should return an HTTP 204 No Content.

Text Microservice's API

Create Text Note

POST https://crprodapiproxy.azurewebsites.net/text?userId={userId} HTTP/1.1 

{
  "text": "{text}",
  "categoryId": "{categoryId}"
}

Should return an HTTP 200 OK with the text note's ID.

Get Text Note

GET https://crprodapiproxy.azurewebsites.net/text/{textId}?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the text note details, including the full text content.

List Text Notes for User

GET https://crprodapiproxy.azurewebsites.net/text?userId={userId} HTTP/1.1

Should return an HTTP 200 OK with the text notes summary – the ID of each text note and the first 100 characters.

Update Text Note

Note that the text microservice is the only one that provides an update API endpoint.

PATCH https://crprodapiproxy.azurewebsites.net/text/{textId}?userId={userId} HTTP/1.1

{

  "text": "{newText}"

}

Should return an HTTP 204 No Content.

Delete Text Note

DELETE https://crprodapiproxy.azurewebsites.net/text/{textId}?userId={userId} HTTP/1.1

Should return an HTTP 204 No Content.

UI Screenshots

Here are some sample screenshots from the front end that covers all scenarios and most screens.

Login Screen

Screen 1

Category CRUD screens

Category Create

Screen 3

Category Image/Synonym Update Event

Screen 4

Category Name Update and Image change notification

Screen 5

Image CRUD and notification screens

Image Create

Screen 6

Image Caption Updated through Event Grid notification

Screen 7

Screen 11

Text CRUD and notification screens

Text Note create

Screen 8

Text Note show

Screen 10

Audio CRUD and notification screens

Audio create

Screen 12

Audio processing

Screen 13

Audio transcript event grid notification

Screen 14

Audio show

Screen 15

Events at category level

Events are displayed as notifications against a category.

Screen 16

More Repositories

1

azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
Python
5,707
star
2

cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
C#
1,955
star
3

graphrag-accelerator

One-click deploy of a Knowledge Graph powered RAG (GraphRAG) in Azure
Python
1,730
star
4

active-directory-aspnetcore-webapp-openidconnect-v2

An ASP.NET Core Web App which lets sign-in users (including in your org, many orgs, orgs + personal accounts, sovereign clouds) and call Web APIs (including Microsoft Graph)
PowerShell
1,366
star
5

openai

The repository for all Azure OpenAI Samples complementing the OpenAI cookbook.
Jupyter Notebook
1,090
star
6

contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.
JavaScript
881
star
7

Cognitive-Speech-TTS

Microsoft Text-to-Speech API sample code in several languages, part of Cognitive Services.
C#
870
star
8

chat-with-your-data-solution-accelerator

A Solution Accelerator for the RAG pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences. This includes most common requirements and best practices.
Python
816
star
9

blockchain

Azure Blockchain Content and Samples
HTML
786
star
10

serverless-chat-langchainjs

Build your own serverless AI Chat with Retrieval-Augmented-Generation using LangChain.js, TypeScript and Azure
Bicep
694
star
11

azure-search-openai-demo-csharp

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
C#
638
star
12

Serverless-microservices-reference-architecture

This reference architecture walks you through the decision-making process involved in designing, developing, and delivering a serverless application using a microservices architecture through hands-on instructions for configuring and deploying all of the architecture's components along the way. The goal is to provide practical hands-on experience in working with several Azure services and the technologies that effectively use them in a cohesive and unified way to build a serverless-based microservices architecture.
C#
493
star
13

modern-data-warehouse-dataops

DataOps for the Modern Data Warehouse on Microsoft Azure. https://aka.ms/mdw-dataops.
Shell
486
star
14

openai-plugin-fastapi

A simple ChatGPT Plugin running in Codespaces for dev and Azure for production.
Bicep
432
star
15

Azure-MachineLearning-DataScience

HTML
407
star
16

raspberry-pi-web-simulator

Raspberry Pi web simulator. Demo address:
JavaScript
406
star
17

contoso-chat

This sample has the full End2End process of creating RAG application with Prompt Flow and AI Studio. It includes GPT 3.5 Turbo LLM application code, evaluations, deployment automation with AZD CLI, GitHub actions for evaluation and deployment and intent mapping for multiple LLM task mapping.
Jupyter Notebook
400
star
18

MyDriving

Building IoT or Mobile solutions are fun and exciting. This year for Build, we wanted to show the amazing scenarios that can come together when these two are combined. So, we went and developed a sample application. MyDriving uses a wide range of Azure services to process and analyze car telemetry data for both real-time insights and long-term patterns and trends. The following features are supported in the current version of the mobile app.
C#
387
star
19

azure-voting-app-redis

Azure voting app used in docs.
Shell
370
star
20

azure-search-knowledge-mining

Azure Search Knowledge Mining Accelerator
CSS
370
star
21

azure-cli-samples

Contains Azure CLI scripts samples used for documentation at https://docs.microsoft.com
Shell
353
star
22

Synapse

Samples for Azure Synapse Analytics
Jupyter Notebook
348
star
23

nodejs-docs-hello-world

A simple nodejs application for docs
JavaScript
347
star
24

cognitive-services-quickstart-code

Code Examples used by the Quickstarts in the Cognitive Services Documentation
Jupyter Notebook
346
star
25

saga-orchestration-serverless

An orchestration-based saga implementation reference in a serverless architecture
C#
340
star
26

container-apps-store-api-microservice

Sample microservices solution using Azure Container Apps, Dapr, Cosmos DB, and Azure API Management
Shell
323
star
27

azure-sdk-for-go-samples

Examples of how to utilize Azure services from Go.
Go
296
star
28

AzureMapsCodeSamples

A set of code samples for the Azure Maps web control.
JavaScript
293
star
29

active-directory-dotnet-native-aspnetcore-v2

Calling a ASP.NET Core Web API from a WPF application using Azure AD v2.0
C#
280
star
30

jp-azureopenai-samples

Python
270
star
31

active-directory-b2c-custom-policy-starterpack

Azure AD B2C now allows uploading of a Custom Policy which allows full control and customization of the Identity Experience Framework
268
star
32

azureai-samples

Official community-driven Azure AI Examples
Jupyter Notebook
260
star
33

azure-batch-samples

Azure Batch and HPC Code Samples
C#
256
star
34

active-directory-b2c-dotnet-webapp-and-webapi

A combined sample for a .NET web application that calls a .NET web API, both secured using Azure AD B2C
JavaScript
244
star
35

openai-dotnet-samples

Azure OpenAI .NET Samples
Jupyter Notebook
236
star
36

streaming-at-scale

How to implement a streaming at scale solution in Azure
C#
234
star
37

azure-files-samples

This repository contains supporting code (PowerShell modules/scripts, ARM templates, etc.) for deploying, configuring, and using Azure Files.
PowerShell
231
star
38

azure-search-openai-javascript

A TypeScript sample app for the Retrieval Augmented Generation pattern running on Azure, using Azure AI Search for retrieval and Azure OpenAI and LangChain large language models (LLMs) to power ChatGPT-style and Q&A experiences.
TypeScript
231
star
39

service-fabric-dotnet-getting-started

Get started with Service Fabric with these simple introductory sample projects.
CSS
230
star
40

ansible-playbooks

Ansible Playbook Samples for Azure
226
star
41

iot-edge-opc-plc

Sample OPC UA server with nodes that generate random and increasing data, anomalies and much more ...
C#
222
star
42

cognitive-services-REST-api-samples

This is a repo for cognitive services REST API samples in 4 languages: C#, Java, Node.js, and Python.
HTML
217
star
43

active-directory-dotnetcore-daemon-v2

A .NET Core daemon console application calling Microsoft Graph or your own WebAPI with its own identity
PowerShell
215
star
44

active-directory-b2c-advanced-policies

Sample for use with Azure AD B2C with Custom Policies.
C#
215
star
45

powerbi-powershell

Samples for calling the Power BI REST API via PowerShell
PowerShell
207
star
46

ms-identity-python-webapp

A Python web application calling Microsoft graph that is secured using the Microsoft identity platform
PowerShell
207
star
47

ms-identity-javascript-react-tutorial

A chapterwise tutorial that will take you through the fundamentals of modern authentication with Microsoft identity platform in React using MSAL React
JavaScript
204
star
48

SpeechToText-WebSockets-Javascript

SDK & Sample to do speech recognition using websockets in Javascript
TypeScript
200
star
49

azure-iot-samples-csharp

Provides a set of easy-to-understand samples for using Azure IoT Hub and Azure IoT Hub Device Provisioning Service and Azure IoT Plug and Play using C# SDK.
C#
196
star
50

digital-twins-explorer

A code sample for visualizing Azure Digital Twins graphs as a web application to create, edit, view, and diagnose digital twins, models, and relationships.
JavaScript
184
star
51

AI-Gateway

APIM ❤️ OpenAI - this repo contains a set of experiments on using GenAI capabilities of Azure API Management with Azure OpenAI and other services
Jupyter Notebook
182
star
52

Custom-vision-service-iot-edge-raspberry-pi

Sample showing how to deploy a AI model from the Custom Vision service to a Raspberry Pi 3 device using Azure IoT Edge
Python
176
star
53

active-directory-angularjs-singlepageapp

An AngularJS based single page app, implemented with an ASP.NET Web API backend, that signs in users and calls web APIs using Azure AD
JavaScript
171
star
54

IoTDemos

Demos created by the IoT Engineering team that showcase IoT services in an end-to-end solution
CSS
171
star
55

ms-identity-aspnet-webapp-openidconnect

A sample showcasing how to develop a web application that handles sign on via the unified Azure AD and MSA endpoint, so that users can sign in using both their work/school account or Microsoft account. The sample also shows how to use MSAL to obtain a token for invoking the Microsoft Graph, as well as incrementental consent.
170
star
56

cosmos-db-design-patterns

A collection of design pattern samples for building applications and services with Azure Cosmos DB for NoSQL.
C#
167
star
57

ms-identity-javascript-angular-tutorial

A chapterwise tutorial that will take you through the fundamentals of modern authentication with Microsoft identity platform in Angular using MSAL Angular v2
TypeScript
165
star
58

azure-python-labs

Labs demonstrating how to use Python with Azure, Visual Studio Code, GitHub, Windows Subsystem for Linux, and more!
Python
164
star
59

active-directory-b2c-javascript-msal-singlepageapp

A single page application (SPA) calling a Web API. Authentication is done with Azure AD B2C by leveraging MSAL.js
JavaScript
164
star
60

cosmosdb-chatgpt

Sample application that combines Azure Cosmos DB with Azure OpenAI ChatGPT service
HTML
163
star
61

active-directory-b2c-dotnetcore-webapp

An ASP.NET Core web application that can sign in a user using Azure AD B2C, get an access token using MSAL.NET and call an API.
C#
160
star
62

active-directory-xamarin-native-v2

This is a simple Xamarin Forms app showcasing how to use MSAL.NET to authenticate work or school and Microsoft personal accounts with the Microsoft identity platform, and access the Microsoft Graph with the resulting token.
C#
160
star
63

cognitive-services-python-sdk-samples

Learn how to use the Cognitive Services Python SDK with these samples
Python
159
star
64

active-directory-dotnet-webapp-openidconnect

A .NET MVC web application that uses OpenID Connect to sign-in users from a single Azure Active Directory tenant.
JavaScript
159
star
65

NVIDIA-Deepstream-Azure-IoT-Edge-on-a-NVIDIA-Jetson-Nano

This is a sample showing how to do real-time video analytics with NVIDIA DeepStream connected to Azure via Azure IoT Edge. It uses a NVIDIA Jetson Nano device that can process up to 8 real-time video streams concurrently.
C++
158
star
66

openhack-devops-team

DevOps OpenHack Team environment APIs
C#
153
star
67

semantic-kernel-rag-chat

Tutorial for ChatGPT + Enterprise Data with Semantic Kernel, OpenAI, and Azure Cognitive Search
C#
147
star
68

azure-search-power-skills

A collection of useful functions to be deployed as custom skills for Azure Cognitive Search
C#
146
star
69

azure-spring-boot-samples

Spring Cloud Azure Samples
JavaScript
146
star
70

service-fabric-dotnet-web-reference-app

An end-to-end Service Fabric application that demonstrates patterns and features in a web application scenario.
C#
144
star
71

aks-store-demo

Sample microservices app for AKS demos, tutorials, and experiments
Bicep
142
star
72

active-directory-b2c-javascript-nodejs-webapi

A small Node.js Web API for Azure AD B2C that shows how to protect your web api and accept B2C access tokens using Passport.js.
JavaScript
141
star
73

Serverless-APIs

Guidance for building serverless APIs with Azure Functions and API Management.
C#
139
star
74

blockchain-devkit

Samples of how to integrate, connect and use devops to interact with Azure blockchain
Kotlin
138
star
75

storage-blob-dotnet-getting-started

The getting started sample demonstrates how to perform common tasks using the Azure Blob Service in .NET including uploading a blob, CRUD operations, listing, as well as blob snapshot creation.
C#
135
star
76

active-directory-dotnet-webapp-openidconnect-aspnetcore

An ASP.NET Core web application that signs-in Azure AD users from a single Azure AD tenant.
HTML
132
star
77

power-bi-embedded-integrate-report-into-web-app

A Power BI Embedded sample that shows you how to integrate a Power BI report into your own web app
JavaScript
131
star
78

azure-event-grid-viewer

Live view of events from Azure Event Grid with ASP.NET Core and SignalR
HTML
130
star
79

active-directory-dotnet-webapi-manual-jwt-validation

How to manually process a JWT access token in a web API using the JSON Web Token Handler For the Microsoft .Net Framework 4.5.
C#
129
star
80

azure-opensource-labs

Azure Open Source Labs (https://aka.ms/oss-labs)
Bicep
128
star
81

azure-video-indexer-samples

Contains the Azure Media Services Video Indexer samples
Python
128
star
82

active-directory-lab-hybrid-adfs

Create a full AD/CA/ADFS/WAP lab environment with Azure AD Connect installed
PowerShell
125
star
83

service-fabric-dotnet-quickstart

Service Fabric quickstart .net application sample
C#
125
star
84

jmeter-aci-terraform

Scalable cloud load/stress testing pipeline solution with Apache JMeter and Terraform to dynamically provision and destroy the required infrastructure on Azure.
HCL
120
star
85

active-directory-dotnet-desktop-msgraph-v2

Sample showing how a Windows desktop .NET (WPF) application can get an access token using MSAL.NET and call the Microsoft Graph API or other APIs protected by the Microsoft identity platform (Azure Active Directory v2)
C#
120
star
86

active-directory-dotnet-webapp-webapi-openidconnect-aspnetcore

An ASP.NET Core web application that authenticates Azure AD users and calls a web API using OAuth 2.0 access tokens.
C#
119
star
87

ms-identity-aspnet-daemon-webapp

A web application that sync's data from the Microsoft Graph using the identity of the application, instead of on behalf of a user.
C#
117
star
88

active-directory-dotnet-webapp-multitenant-openidconnect

A sample .NET 4.5 MVC web app that signs-up and signs-in users from any Azure AD tenant using OpenID Connect.
JavaScript
116
star
89

azure-intelligent-edge-patterns

Samples for Intelligent Edge Patterns
JavaScript
114
star
90

cognitive-services-sample-data-files

Cognitive Services sample data files
113
star
91

python-docs-hello-world

A simple python application for docs
Python
113
star
92

azure-ai

A hub with a curated awesome list of all Azure AI samples
112
star
93

Cognitive-Speech-STT-Windows

Windows SDK for the Microsoft Speech-to-Text API, part of Cognitive Services
111
star
94

durablefunctions-apiscraping-dotnet

Build an Azure Durable Functions that will scrape GitHub for opened issues and store them on Azure Storage.
C#
111
star
95

active-directory-b2c-xamarin-native

This is a simple Xamarin Forms app showcasing how to use MSAL to authenticate users via Azure Active Directory B2C, and access a Web API with the resulting tokens.
C#
110
star
96

cognitive-services-dotnet-sdk-samples

Learn how to use the Cognitive Services SDKs with these samples
C#
108
star
97

active-directory-dotnet-daemon

A Windows console application that calls a web API using its app identity (instead of a user's identity) to get access tokens in an unattended job or process.
C#
107
star
98

azure-samples-python-management

This repo contains sample code for management libraries of Azure SDK for Python
Python
105
star
99

private-aks-cluster-terraform-devops

This sample shows how to create a private AKS cluster using Terraform and Azure DevOps.
HCL
105
star
100

ms-identity-java-webapp

A Java web application calling Microsoft graph that is secured using the Microsoft identity platform
Java
105
star