Configuring Multi-Tenant Authentication in Azure App Services (2024)

Understanding Azure Entra ID(former Active Directory/AD)

At the heart of this process lies Azure, a cloud-based identity and access management system. Key concepts to understand:

  • Tenants: A tenant in Azure Entra ID represents an organization. Each organization usually has its own dedicated tenant.
  • Users: Individual accounts reside within a tenant, representing employees, guests, etc.
  • Applications: Software services like your web app need to be registered in Azure Entra ID for it to manage their access and authentication.
  • Permissions: These define what actions your app can perform on behalf of a signed-in user (e.g., reading their profile, accessing files).

Multi-Tenant vs. Single-Tenant

  • Single-Tenant: Apps designed for users within a single organization. Only users from the same Azure Entra ID tenant as the app can access it.
  • Multi-Tenant: Apps accessible by users across multiple Azure Entra ID tenants, broadening your app’s potential user base.

Setting Up Your Multi-Tenant App

Prerequisites

  • An existing Azure subscription.
  • A basic understanding of Azure Active Directory (Azure AD).

Step 1: Registering Your Application in AzureAD

Every app interacting with Azure AD needs to be registered.

  • Locate Azure Active Directory: Search for it in the Azure portal.
  • App Registrations: Navigate to “App Registrations” under the “Manage” section.
  • New Registration: Click “+ New registration”.

Configuring Multi-Tenant Authentication in Azure App Services (1)

  • Name and Tenant Type: Provide a memorable name for your app and select “Accounts in any organisational directory (Any Azure AD directory — Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)”.
  • Register: Click the “Register” button.

Configuring Multi-Tenant Authentication in Azure App Services (2)

Step 2: Capture Key Information

Once registered, you’ll need the following from your app’s overview page:

  • Application (Client) ID: A unique identifier for your app.
  • Directory (Tenant) ID: Identifies the Azure AD tenant where your app is registered.

Configuring Multi-Tenant Authentication in Azure App Services (3)

Step 3: Create Your AppService

You’ll need an App Service Plan and an App Service Web App. The transcript nicely details this, but I’ll summarise the key points:

  • Create App Service Plan: Choose your resource group, operating system (Windows or Linux), and region.
  • Create App Service Web App: Give your app a name (this becomes part of the URL), select your App Service Plan, and configure the runtime stack.

Recommended by LinkedIn

Securing APIs with Azure Active Directory Mohammad Tarem 1 year ago
Azure Active Directory Kajal Kiran 1 year ago
Configuring Active Directory authentication over SMB… Toby Skerritt 4 years ago
Configuring Multi-Tenant Authentication in Azure App Services (7)

Step 4: Enable Multi-Tenant Authentication

  • Azure Portal: Navigate to your newly created App Service.
  • Authentication (Under “Settings”): Locate the Authentication settings.

Configuring Multi-Tenant Authentication in Azure App Services (8)

  • Identity Provider: Select “Azure Active Directory”.
  • App Registration: Choose “Pick an existing app registration in the directory” and select the app you registered in Step 1.
  • Authentication Actions: Configure how your app should handle users who haven’t signed in. For most cases, “Restrict access” with the “Require authentication” option is ideal.

Configuring Multi-Tenant Authentication in Azure App Services (9)

  • Save: Click “Add” and then “Save” to apply your changes.

Step 5. Configure the RedirectURI

Azure AD needs to know where to send users after authentication:

  • Back to Azure AD: Go to “App Registrations” and find your app.
  • Authentication: Select “Authentication” under “Manage”.
  • Add a Platform: Click “+ Add a platform” and choose “Web”.
  • Redirect URI: Paste the base URL of your App Service Web App, followed by /.auth/login/aad/callback (Example: https://demo-app-multitenant.azurewebsites.net/.auth/login/aad/callback).
  • Implicit Grant: Select “ID tokens” only.
  • Configure: Click “Configure” to save the redirect URI.

Step 6: Understanding the Client Secret (Optional)

Azure automatically generates a secret for your app and it’s visible in two places:

  • App Registrations -> Certificates & Secrets: View and manage the secret.
  • App Service -> Configuration -> Application Settings: Automatically stored under the setting name “Microsoft_Provider_Authentication_Secret”.

Configuring Multi-Tenant Authentication in Azure App Services (10)

It’s Time to Test!

  1. Incognito/Private Window: Open a private browsing window in your browser.
  2. App URL: Paste your app’s URL.
  3. Login: You should be redirected to a Microsoft login page and prompted to sign in with an account from a different Azure AD tenant than the one where the app is registered.
  4. Consent: Users might be prompted to consent to your app accessing their information.

Troubleshooting: “Reply URL does not match…”

If you get this error, double-check your redirect URI settings in Azure Entra ID. Ensure it’s exactly as described in Step 5.

Beyond the Basics

  • Permissions: Explore API permissions in Azure Entra ID to fine-tune what your app can do on behalf of users.
  • Custom Domains: For a more branded experience, you can add a custom domain name to your App Service.

Configuring Multi-Tenant Authentication in Azure App Services (2024)
Top Articles
How To Buy Zilliqa (ZIL) Coin — CEX.IO
Will iMessage Say Delivered if Blocked? Understanding Message Delivery Status
Qbs.team Ehub.com
K2 Spice Diablo
Secondary Action Required Va Claim
The Eye Doctors North Topeka
Pixel Combat Unblocked
Basis Phoenix Primary Calendar
Yahoo Sports Pga Leaderboard
Reading Craigslist Pa
DLNET Login - DLNET.DELTA.COM - Delta’s Employee Portal
Oldeuboi Showtimes Near Marcus Ronnie's Cinema
Knox County 24 Hour List
Fed meeting recap: Chair Jerome Powell defends central bank's decision to go big with first cut
Xlauriexkimx
Jimmy John's Order Delivery
How to find cash from balance sheet?
M&M Imports Fontana
Check From Po Box 1111 Charlotte Nc 28201
Wieting Funeral Home '' Obituaries
Farsi1Tv Hd
Leyla Star Session
Baptist Medical Center Yazoo Photos
Max Tl Nails
What Do Noom Coins Get Me
Tar Heels Baseball Schedule
Busted Campbell County
Craigs List High Rockies
Madewell Valley Fair
Candy Crush Saga: Impossible Levels - UXP2: Dark Patterns
Roblox Mathsspot Now.gg
Scratch Off Remaining Prizes Nc
Bridgeport Police Blotter Today
516-263-5626
Top 10 SEO Copywriting Service PowerPoint Presentation Templates in 2024
Dress Border Nyt Crossword
Amy Riley Electric Video
Fuuuuck*
Where To Cook In Gerudo Town
Espn Wnba Stats
Craigslist Gigs Galveston
Antiterrorism Level 1 Pretest Answers
844-793-3456
Bbq Near Me Open Late
Victoria Tortilla & Tamales Factory Menu
U-Haul Moving & Storage At Valley Blvd
Driving Directions To Gamestop Near Me
Extended User Access And Restriction Superbadge Unit
Perani's Columbus Ohio
The Star Beacon Obituaries
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 5662

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.