Posts

Showing posts from 2025

ASP.NET MVC , Azure AD integration using open id connect

  ASP.NET MVC , Azure AD integration using open id connect To integrate Azure Active Directory (Azure AD) with an ASP.NET MVC application using OpenID Connect , you can follow these core steps:   ✅ Prerequisites ·        Azure AD tenant and App Registration (client ID and tenant ID) ·        Visual Studio ·        ASP.NET MVC (.NET Framework, not .NET Core)   🔧 Step 1: Register Your App in Azure AD 1.        Go to Azure Portal 2.        Navigate to Azure Active Directory > App registrations 3.        Click New registration a.   Name: MyMvcApp b.        Redirect URI: https://localhost:44300/signin-oidc (or your app’s URL + /signin-oidc ) 4.        Once created, note down: a.    ...

Add Users in Azure AD Group

  Add Users in Azure AD groups using c#   Azure App Registration Steps Step 1: Go to Azure Portal Open: https://portal.azure.com Sign in with your Azure AD Admin account. Step 2: Open App Registrations In the search bar at the top, type "App registrations" and click it. Click "New registration". Step 3: Register the App Name: Enter a name like GraphApiApp or GroupManagerApp. Supported account types: Select "Accounts in this organizational directory only" (for your tenant). Redirect URI: Leave blank (not needed for backend apps) or add https://localhost (for testing). Click "Register". Step 4: Configure API Permissions After registration, in the app page: Go to API permissions → Click "Add a permission" → Microsoft Graph → Application permissions (Important!). Search and select these permissions: GroupMember.Rea...

Azure Function | Sharepoint List item | Call from Power Automate Flow

  🔹 Steps to Set Up an Azure Function for SharePoint List Item Creation 1️⃣ Create an Azure Function App Go to Azure Portal → Function Apps → Click Create . Choose: Subscription : Select your subscription. Resource Group : Create a new one or use an existing one. Function App Name : Enter a unique name. Runtime Stack : Choose .NET , Python , or Node.js . Region : Select a preferred region. Plan Type : Choose Consumption (Serverless) . Click Review + Create → Then Create . 2️⃣ Create a New Function Inside the Function App Open your Function App → Click Functions → + Add Function . Choose HTTP Trigger (for now, Power Automate will trigger this function). Name your function (e.g., SharePointNewItemTrigger ). Set Authorization Level to Function . Click Create . 3️⃣ Get SharePoint List Data Using Microsoft Graph API Since Azure Functions cannot directly detect SharePoint list changes, we use Power Automate to send data when an item is added. Modify the...

Custom Webhook Processing for SharePoint List Events Using Azure Functions

  Custom Webhook Processing for SharePoint List Events Using Azure Functions Use Case When an item is added, updated, or deleted in a SharePoint Online list , an Azure Function processes the event and updates an external system (e.g., a CRM, database, or sends notifications via Teams/Email) Solution Architecture SharePoint Webhook : Subscribes to list events (item added, updated, deleted). Azure Function (HTTP Trigger) : Receives the webhook notification. Graph API / SharePoint REST API : Retrieves item details. External System Update : Pushes data to SQL, CRM, or sends notifications. Steps to Implement Step 1: Create an Azure Function App Go to Azure Portal → Function App → Create Choose Runtime Stack → .NET / Node.js / Python (as per your preference) Select Hosting Plan → Consumption Plan (Pay-as-you-go) Deploy and get the Function URL Step 2: Create an Azure Function to Receive Webhook Events C# Code for Azure Function (HTTP Trigger):

Sites.Selected | Graph API SharePoint Permission

Image
  SharePoint Site Collection Permission   The "sites.selected" permission in Microsoft Graph API allows you to grant an application access to specific SharePoint sites instead of all SharePoint sites in the tenant.   Step1: To   Configure "Sites.Selected" Permission in Azure App Registration To use "sites.selected" , you need to: Register an App in Azure AD . Grant "Sites.Selected" Permission to the app. Manually Grant Access to the specific SharePoint site. Use Microsoft Graph API or PowerShell to assign the required role (Read/Write).   Step 1: Register an App in Azure AD Go to Azure Portal → Azure Active Directory → App Registrations . Click New registration . Provide a name (e.g., SharePointAccessApp). Choose Accounts in this organizational directory only . Click Register . Step 2: Add "Sites.Selected" API Permission Navigate ...