Posts

Showing posts from June, 2025

๐Ÿ‘ค Anonymous Role in Power Pages – What It Is and When to Use It

  When building public-facing websites with Power Pages , not every visitor will be a logged-in user. Some might just be browsing, some might want to ask a question, and others might be using your portal for the very first time. So how do we allow unregistered users to interact with our portal safely ? That’s where the Anonymous Users role comes in. ๐Ÿšช Who Are Anonymous Users? Anonymous users are visitors who haven’t logged in to your Power Pages portal. They: Have not signed in May not have an account Might be visiting for the first time And here’s the best part — Power Pages automatically assigns them the “Anonymous Users” web role. You don’t have to do anything special to give it. ๐Ÿ” What Can They Do? By default, anonymous users can see pages marked as "anonymous access allowed" , but they can't create or edit data unless you let them . To let anonymous users interact with your data (e.g., submit a form), you need to: Create table permissi...

⚡ Example: Rate Limiting in Azure API Management

  Scenario: You have a public API and want to limit each user to 5 calls per minute to prevent abuse or accidental overload. ๐Ÿ›ก️ What is Rate Limiting? Rate limiting controls how many requests a client can make to your API within a specific time window . It helps: Prevent API abuse Protect backend systems Fairly distribute API usage ๐Ÿ’ก Using the rate-limit-by-key Policy Azure APIM uses a policy called rate-limit-by-key . It limits requests based on a unique identifier — usually the caller's subscription key or IP address. ๐Ÿ”ง Example Policy (XML) Here’s how you can add this to your inbound policy : < inbound > < base /> < rate-limit-by-key calls = "5" renewal-period = "60" counter-key = "@(context.Subscription?.Key)" /> </ inbound > Explanation: Attribute Meaning calls="5" Maximum 5 calls allowed renewal-period="60" Time window of 60 seconds (1 minute...

๐Ÿงฉ What is Azure AD B2C?

  ๐Ÿงฉ What is Azure AD B2C? Imagine you're running a website where external people (like customers, vendors, or partners) need to log in — but they’re not part of your company . Azure AD B2C (Business to Consumer) is like a secure login gate that: Lets people sign in or sign up using their own email , Google , Facebook , or even Microsoft account Keeps their information safe Handles things like passwords, forgot password, two-step verification , etc. So basically: Azure AD B2C = A secure sign-in system for outsiders ๐ŸŒ What is Power Pages? Power Pages is Microsoft’s platform to create secure, public-facing websites — like: A vendor portal A customer support site A registration or booking platform It’s built so non-developers can design sites using a drag-and-drop editor, but it also supports pro-devs with full customization. ๐Ÿ”— Why Use Azure AD B2C in Power Pages? Because Power Pages are public websites , you often need to let external users log ...

๐Ÿ” Azure API Management Explained: Subscription Keys, Revisions, and Policies

  As organizations increasingly expose APIs to partners, developers, and applications, Azure API Management (APIM) becomes a powerful gateway to control and secure API access. In this blog, we’ll break down three fundamental concepts that every APIM user should know: ocp-apim-subscription-key (The gateway key) Revisions (Safe API evolution) Policies (Runtime customization) Let’s dive in. ๐Ÿ”‘ ocp-apim-subscription-key : Your Gateway Key When you expose your APIs through Azure API Management, you don’t want just anyone to call them. This is where the ocp-apim-subscription-key comes in. What Is It? It’s a subscription key that uniquely identifies and authenticates the API caller. Think of it as an API password. This key is passed in the HTTP header like this: GET https://your-apim.azure-api.net/products Headers: ocp-apim-subscription-key: your-subscription-key-here Why Do We Need It? Authentication : Confirms the caller is allowed to access the API ...

๐Ÿง  In-Process vs Isolated Worker Model in Azure Functions — Explained Simply

  If you’re new to Azure Functions or just curious about the terms “In-Proc” and “Isolated,” don’t worry — it’s not as complex as it sounds. Let’s break it down with some real-world analogies and simple language. ๐Ÿณ Imagine a Busy Restaurant Kitchen... Think of your Azure Function as a chef preparing a dish. Now there are two ways this chef can work: Inside the main restaurant kitchen (In-Process) In their own private kitchen (Isolated Worker) Each approach has its pros and cons — just like in the world of cloud apps! ๐Ÿ  What Is In-Process (In-Proc)? In this model, your function runs inside the same kitchen as the Azure Functions host. ๐Ÿงฑ Simple Terms: Tightly integrated with the Azure Functions runtime. Has direct access to everything in the main kitchen (like ingredients, tools, helpers). Faster to start , less setup . Ideal for lightweight, quick functions . ✅ Benefits: Lower startup time Easy debugging Works well with built-in featu...

☁️ Azure Functions: Understanding Launch Type Single (LTS) & Share Type Single (STS) – The Layman’s Guide

 When you start working with Azure Functions, you'll eventually come across a few technical terms like Launch Type Single (LTS) and Share Type Single (STS) . They sound complicated — but don’t worry. Let’s simplify them using everyday examples. ๐Ÿง  Imagine Azure Functions Like Smart Vending Machines Picture an Azure Function as a smart vending machine . It wakes up when someone presses a button (a trigger), gives what’s needed (executes the function), and then waits quietly for the next button press. But... how this machine is started and whether it's shared with others is what LTS and STS are all about. ๐Ÿš€ What Is Launch Type Single (LTS)? Launch Type describes how the function app is started and managed. ๐Ÿ” Think of It Like This: Do you want to spin up a new vending machine for each order , or keep one dedicated machine running just for you? Launch Type Single (LTS) means Azure creates a dedicated instance of your function app. It doesn’t mix it with othe...

In-Process vs Isolated Process Azure Functions: What’s the Difference?

 When building Azure Functions using .NET, one of the most important architectural choices you’ll face is deciding between In-Process and Isolated Process (Out-of-Process) hosting models. This decision impacts everything from startup time to dependency control and middleware capabilities. So let’s break it down. What is In-Process (InProc) Hosting? In the In-Process model: Your function code runs inside the same process as the Azure Functions runtime. It uses the same AppDomain and host environment . Benefits: Better performance (lower cold start time). Full access to features in the Microsoft.Azure.WebJobs SDK (like bindings, triggers, and logging). Easier to use existing .NET libraries and tools. Limitations: Tightly coupled to the Azure Functions runtime version. Less flexibility in middleware and custom startup configuration. Potential for dependency conflicts if runtime and your code use different versions of libraries. What is ...

Understanding Launch Type and Share Type in Azure Functions

 When working with Azure Functions , especially in a Premium or App Service Plan , you might encounter two settings that affect the hosting and execution behavior of your functions: Launch Type: Single Share Type: Single While these may seem like low-level technical configurations, understanding them helps when you're optimizing performance, scaling behavior, or debugging cold starts. What is Launch Type: Single ? Launch Type determines how Azure starts up the Azure Functions host process (the environment where your functions run). When set to Single , the system launches one instance of the function app's host process per worker. This ensures isolation per instance and reduces the chance of resource contention between multiple function apps. Why it matters: This is the default and safest approach when you want predictable resource usage. It helps avoid cross-function interference when you're running multiple function apps on the same plan. ...

Understanding Microsoft-hosted vs. Self-hosted Agents in Azure DevOps

 When working with Azure DevOps Pipelines , the concept of agents is fundamental. These agents are responsible for running your builds, tests, and deployments. Azure DevOps provides two main options: Microsoft-hosted agents Self-hosted agents Let’s explore both options in detail, compare them, and see when to use which. 1. What is an Agent in Azure DevOps? An agent is essentially a machine (VM or physical) that runs pipeline jobs. It checks out code, installs dependencies, runs scripts, and performs deployments. 2. Microsoft-hosted Agents These are virtual machines maintained by Microsoft , automatically spun up on demand. Key Features: No setup required – Just define the vmImage in your pipeline. Pre-installed tools like .NET, Node.js, Python, Java, Azure CLI, Docker, and more. Clean environment – Every run gets a fresh VM. Auto-scaled – No need to worry about parallelism or load balancing. Billing – Free tier available with limited minutes; ...

Building a Clean and Maintainable Azure Function with Dependency Injection and Upsert Logic

In this blog, we walk through building an event-based Azure Function that saves customer data into a SQL database using a clean architecture pattern with Dependency Injection (DI) , AutoMapper , and a reusable Base Service for Upsert operations. We’ll cover: Setting up the Azure Function Injecting dependencies cleanly Creating a generic upsert method Handling logging and error reporting 1. Overview of the Azure Function The Azure Function accepts customer data as JSON through an HTTP POST request and either inserts or updates the corresponding database record. [Function(nameof(SaveCustomer))] public class SaveCustomerFunction { private readonly SaveCustomer _customerService; private readonly Logger _logger; public SaveCustomerFunction(SaveCustomer customerService, Logger logger) { _customerService = customerService; _logger = logger; } [Function("SaveCustomer")] public async Task<IActionResult> Run( [Ht...