Category .NET Core

Using encrypted access tokens in Azure with Microsoft.Identity.Web and Azure App registrations

This post shows how to use encrypted access tokens with Azure AD App registrations using Microsoft.Identity.Web. By using encrypted access tokens, only applications with access to the private key can decrypt the tokens. When using encrypted tokens, you can prevent access tokens data being used or read by such tools as https://jwt.ms or https://jwt.io and […]

Implement a full text search using Azure Cognitive Search in ASP.NET Core

This article shows how to implement a full text search in ASP.NET Core using Azure Cognitive Search. The search results are returned using paging and the search index can be created, deleted from an ASP.NET Core Razor Page UI. Code: https://github.com/damienbod/AspNetCoreAzureSearch Creating the Search in the Azure Portal In the Azure Portal, search for Azure […]

Using Key Vault certificates with Microsoft.Identity.Web and ASP.NET Core applications

This post shows how Azure Key Vault certificates can be used with Microsoft.Identity.Web in an ASP.NET Core application which requires a downstream “access_as_user” API. The Azure AD App Registrations requires a certificate instead of a client secret. Code: https://github.com/damienbod/AzureADAuthRazorUiServiceApiCertificate Posts in this series Implement Azure AD Client credentials flow using Client Certificates for service APIs […]

Encrypting texts for an Identity in ASP.NET Core Razor Pages using AES and RSA

The article shows how encrypted texts can be created for specific users in an ASP.NET Core Razor page application. Symmetric encryption is used to encrypt the text or the payload. Asymmetric encryption is used to encrypt the AES key and the IV of the symmetric encryptions. Each ASP.NET Core Identity has an associated X509Certificate2 with […]

Symmetric and Asymmetric Encryption in .NET Core

This post looks at symmetric and asymmetric encryption and how this could be implemented in .NET Core. Symmetric encryption is fast and can encrypt or decrypt large amounts of text, streams or files but requires a shared key. Asymmetric encryption can be used without shared a key, but can only encrypt or decrypt small texts […]

Securing Azure Functions using API Keys

This article shows how to secure Azure Functions using API Keys. This is useful, if you have no control over the API client implementation, the client code base cannot be easily changed or the client is not Azure hosted. This should only be used with trusted clients and is for machine to machine usage. Code: […]

Retry Error Handling for Activities and Orchestrations in Azure Durable Functions

Azure Durable Functions provides a rich set of Error Handling APIs. This post shows how Activities or Sub-Orchestrations can be re-run with the different retry options. Activities in a workflow can call an API or run a code flow which might fail due to connection problems, network timeouts or other similar problems. If it was […]

Azure Durable Functions Monitoring and Diagnostics

The post shows some of the possibilities to monitor Azure Durable Functions and how diagnostic APIs could be implemented. Code: https://github.com/damienbod/AzureDurableFunctions Posts in this series Using External Inputs in Azure Durable functions Azure Functions Configuration and Secrets Management Using Key Vault and Managed Identities with Azure Functions Waiting for Azure Durable Functions to complete Azure […]

Waiting for Azure Durable Functions to complete

The article show how an Azure Durable Function can be used to process a HTTP API request which waits for the completion result. This can be required when you have no control over the client application calling the API and the process requires asynchronous operations like further API calls and so on. The Azure Durable […]

Using Key Vault and Managed Identities with Azure Functions

This article shows how Azure Key Vault could be used together with Azure Functions. The Azure Functions can use the system assigned identity to access the Key Vault. This needs to be configured in the Key Vault access policies using the service principal. By using the Microsoft.Azure.KeyVault and the Microsoft.Extensions.Configuration.AzureKeyVault nuget packages, defining direct references […]