To register an Azure AD app, you'll need to create a new app registration in the Azure portal. This is done by clicking on the "New registration" button and filling out the required information.
The app name and logo are the first things you'll need to provide. The name should be descriptive and easy to understand, while the logo will be displayed on the app's page in the Azure portal.
You'll also need to choose the type of account that will be used to sign in to the app. This can be a personal account, work or school account, or a Microsoft account.
Once you've filled out the required information, click the "Register" button to create the app registration.
Prerequisites
To register an Azure AD app, you'll need an existing Azure subscription. This is the foundation upon which you'll build your app registration.
To get started, you'll also need a basic understanding of Azure Active Directory (Azure AD). This will help you navigate the registration process.
Before diving in, make sure you have the following prerequisites:
- An existing Azure subscription.
- A basic understanding of Azure Active Directory (Azure AD).
This will give you a solid foundation to work from.
Registering an App
Registering an app in Azure AD is a straightforward process. Every app interacting with Azure AD needs to be registered. To start, locate Azure Active Directory in the Azure portal and navigate to the "App Registrations" section under "Manage".
You can register an application by clicking the "+ New registration" button. 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)" as the supported account types.
Azure automatically generates a secret for your app, which is visible in two places. You can register applications in the Azure portal or by calling Microsoft Graph application APIs.
As a developer, you need to register your apps that use the Microsoft identity platform. You might not have permission to create or modify an application registration, so ask your administrators for help if needed.
Application registration properties include the name, logo, and publisher, as well as redirect Uniform Resource Identifiers (URI), secrets, API dependencies, and app roles for role-based access control.
Here's a summary of the steps to register an app:
- Locate Azure Active Directory in the Azure portal
- Navigate to the "App Registrations" section under "Manage"
- Click the "+ New registration" button
- Provide a memorable name for your app and select supported account types
- Register your app in the Azure portal or by calling Microsoft Graph application APIs
Multi-Tenant Setup
When setting up a multi-tenant app, you have two options: Single-Tenant and Multi-Tenant. Single-Tenant apps are designed for users within a single organization, while Multi-Tenant apps are accessible by users across multiple Azure Entra ID tenants.
To set up a Multi-Tenant app, you'll want to explore API permissions in Azure Entra ID to fine-tune what your app can do on behalf of users. You can also add a custom domain name to your App Service for a more branded experience.
Here's a quick rundown of the key steps to enable multi-tenant authentication:
- Identity Provider: Select “Azure Active Directory”.
- App Registration: Choose “Pick an existing app registration in the directory” and select the app you registered.
- Authentication Actions: Configure how your app should handle users who haven’t signed in.
Multi-Tenant vs. Single-Tenant
When deciding on a multi-tenant setup, you'll need to consider the type of app you're creating. Single-Tenant apps are designed for users within a single organization, and only users from the same Azure Entra ID tenant as the app can access it.
This means that your app's user base is limited to a single company or entity.
Single-Tenant apps are often used for internal tools or apps that are only needed by a specific group of people within an organization.
Here are the key differences between Single-Tenant and Multi-Tenant apps:
A Multi-Tenant app, on the other hand, is designed to be accessible by users across multiple Azure Entra ID tenants, broadening your app's potential user base.
This allows you to reach a wider audience and increase your app's visibility and usage.
Enable Multi-Tenant Authentication
Enabling multi-tenant authentication is a crucial step in setting up your app for broad accessibility.
To start, you'll need to select Azure Active Directory as your identity provider. This is a straightforward process that will allow users from multiple Azure Entra ID tenants to access your app.
Next, you'll need to choose an existing app registration in the directory and select the app you registered in the initial setup. This ensures that your app is properly linked to the correct directory and can access the necessary permissions.
You'll also need to configure how your app handles users who haven't signed in. For most cases, restricting access with the "Require authentication" option is ideal.
Here's a summary of the key steps:
- Identity Provider: Select "Azure Active Directory".
- App Registration: Choose "Pick an existing app registration in the directory" and select the app you registered in the initial setup.
- 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.
Registration Process
The registration process for Azure AD app registration is a crucial step that every developer needs to take. To start, every app interacting with Azure AD needs to be registered, which can be done by navigating to the Azure portal and searching for Azure Active Directory.
Admins and users with the right permissions can create application objects by registering applications in the Azure portal. By default, all users in a directory can register application objects that they develop. To register an application, you'll need to provide a memorable name for your app and select the supported account types.
You can register your app in the Azure portal or by calling Microsoft Graph application APIs. Application registration properties might include the name, logo, and publisher, as well as secrets, API dependencies, and app roles for role-based access control. A required part of app registration is selecting supported account types to define who can use your app based on the user's account type.
Here are the steps to register an application on the Azure AD portal:
- Sign in to portal.azure.com with an Azure account with the right permission to register applications.
- Search “azure active directory” and open it.
- Click App registration and then + New registration.
- Enter the name of the application, select the supported account types, and specify a Redirect URI.
Capture Key Information
Once you've registered your app, it's time to capture some key information. This will help you configure and use your app properly.
You'll need to find the Application (Client) ID, which is a unique identifier for your app. This ID is used every time your app performs a transaction through the Microsoft identity platform.
The Directory (Tenant) ID identifies the Azure AD tenant where your app is registered. Think of it like a address for your app.
To find this information, navigate to your app's overview page in the Azure portal. From there, you can locate the necessary details.
Here are the key pieces of information you'll need to capture:
- Application (Client) ID: A unique identifier for your app.
- Directory (Tenant) ID: Identifies the Azure AD tenant where your app is registered.
These details are crucial for configuring your app and using it with the Microsoft identity platform.
Who Can Register
Admins can create application objects by registering applications in the Azure portal. Users and developers can also create application objects, but only if permitted by the tenant.
By default, all users in a directory can register application objects that they develop.
Those assigned at least the Application Administrator or Cloud Application Administrator role can perform specific application tasks.
Look Up Existing
Looking up existing resources is a crucial part of the registration process.
To get an existing Application resource's state, you need to provide its name, ID, and optional extra properties to qualify the lookup. This is a straightforward step that helps ensure accuracy and efficiency in the registration process.
The Application resource's state is retrieved using a specific method, which is designed to handle the given name, ID, and extra properties. This method is built to handle various scenarios and edge cases.
The lookup process is flexible and allows for the inclusion of extra properties to narrow down the search. This flexibility makes it easier to retrieve the desired information.
By understanding how to look up existing resources, you can streamline the registration process and avoid potential issues.
Configure Authentication and Secrets
To configure authentication and secrets for your Azure AD app registration, you need to allow the application to request tokens directly from the endpoint. This is done by checking the "Access tokens" and "ID tokens" checkboxes in the "Implicit grant and hybrid flows" section of the app's Authentication settings.
You'll also need to create an app secret by navigating to Certificates and secrets, then clicking the + New client secret button. This secret is used to authenticate users via Azure Active Directory.
To get started, you'll need to copy your app's client secret ID immediately after creating it, as it only shows once on the screen. You can do this by clicking the copy icon next to the Value of the client's secret ID.
You'll also need the Application ID, Application secret, and Directory ID to allow your app to communicate with Azure AD. The Application ID and Directory ID can be found in the app's Overview menu.
Here's a summary of the required settings:
Remember to test your app to ensure it works correctly after configuring authentication and secrets.
Frequently Asked Questions
What is the difference between app registration and service account?
App registration is a global instance that lives in your home tenant, while a service principal is a local representation used for management and identity purposes
Are Azure app registrations free?
Yes, Azure app registrations are free. You can register apps in Azure AD without incurring any costs, even if related services are hosted elsewhere.
How to check app registration in Azure?
To check app registration in Azure, navigate to the Azure AD service and click on "Sign-ins" or "Audit logs" under the "Monitoring" section. This will display the activity of your app registrations.
What is the difference between enterprise application and app registration?
App Registration is the global definition of an app, while an Enterprise Application is a local instance within a specific tenant, managing permissions and policies
What is the difference between service principal and app registration?
An App Registration holds the core details of an application, including its ID and credentials, while a Service Principal manages consent and scopes, allowing the application to be used across multiple tenants. In essence, App Registration is the foundation, and Service Principal is the key to unlocking its broader usage.
Sources
- https://talibilat.medium.com/configuring-multi-tenant-authentication-in-azure-app-services-f489a0231d0f
- https://learn.microsoft.com/en-us/security/zero-trust/develop/app-registration
- https://www.pulumi.com/registry/packages/azuread/api-docs/application/
- https://infrasos.com/how-to-create-azure-ad-application-registration-step-by-step/
- https://docs.alertlogic.com/prepare/azure-rbac-role-setup.htm
Featured Images: pexels.com