AzureRecipes

C# Code snippets

General resources:

Contents

Service(s) Architecture Problem / Solution Related Link
Function, Storage Table, Cosmos DB Table API Serverless Reference for complete setup of model classes and usage in Azure Function including an Entity-Manager class to simplify access to data and usage - entitymanager-for-table-storage
Function, Cosmos DB Core SQL API - Reference for complete setup of Entity Framework Core with model classes and usage in Azure Function - ef-core-with-cosmos-db-sql
Function - Use built-in authentication of Functions to generate a token for Microsoft Graph (application based access) including the ability to run the Function locally. Can be adapted to App Services and also to generate tokens for other type of API’s where permissions can be managed with AAD App Registrations. - function-built-in-auth-token-for-graph-api
Function, Storage Account - Copy files from any source to Blob Storage including correct setting of content-type and Blob Metadata - copy-files-to-blob-storage
Function - General mapping functionality based on easy editable JSON configurations, including resolution based on multiple criterias, wildcard support and fallback / default mechanism. Typically used in integration scenarios for routing definitions or content transformations. Blueprint Integration Pipeline mapping-configuration
Service Bus, Durable Function, Logic App - In integration scenarios, a common pattern is to use a Service Bus to manage asynchronous processing of integration tasks (realised with e.g. Logic Apps). When using the more robust peek-lock mechanism, the lock duration may end before before a long during process has completed (which leads to concurrent re-handling of the message). With this handler running in the background, this is efficiently avoided, as the lock is renewed before expiry. Blueprint Integration Pipeline service-bus-lock-handler
Function, Storage Account - Provide SAS download URL’s for files in a Blob Storage container - provide-download-of-blob-storage-files
Function Bot or Search Solutions Ingest data from crawled website to QnA Maker knowledge base Blueprint Virtual Agent qna-maker-data-ingestion-from-website
Function, Service Bus General PaaS / Serverless A simple, cost-efficient and scalable event scheduler on the basis of a Service Bus queue (or topic, if multiple consumers shall be served) - service-bus-based-event-scheduler
Function - A very simple in-memory cache for data values with limited validity (such as e.g. access tokens) - function-memory-cache
Function, App Service - Injectable service to manage users in AAD by checking its existence and creating invitations to become a guest user. Sample bases on the built-in authentication, but can be easily adapted. function-built-in-auth-token-for-graph-api invite-guest-users-to-aad