Open In App

Microsoft Azure – Application Security with Azure Active Directory

Last Updated : 30 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will look into how to secure a Blazor WebAssembly app with Azure Active Directory. Azure Active Directory, or AAD, provides an intelligent identity as a service that protects your application. 

In this article, we will use it to protect a Blazor WebAssembly app. To do so follow the below steps:

Step 1: First, go to the Menu, and click on Azure Active Directory. 

Step 2: Then we’ll go to “App Registrations”. 

Step 3: Then we will register a new application for our Blazor app.

Step 4: Then we will fill in the name for the app. We’ll leave the Redirect URI to Web and fill in this URI. This uses port 5001, which is the default port on IIS Express. If you use another port, you can change this, and “Register”.

Now we have an application in AAD. These are the things that we need later: 

  • Display name
  • Application Client ID
  • Directory Tenant ID

Step 5: We need to do one more thing. For that, go to “Authentication”.

Here we need to check the below-shown boxes for Implicit Grant and click on the Save button.

At this point, our AAD is configured.

Step 6: Now, let’s create the Blazor app in the command prompt. We use the below commands to create a standalone Blazor WebAssembly app. In this AAD we mention the app name, the client id, and the tenant id. 

dotnet new blazorwasm -au SingleOrg --client-id "YOUR_CLIENT_ID" -o YOUR_APP_NAME --tenant-id
"YOUR_TENENT_ID"

It created a new folder for the app with a standalone Blazor WebAssembly app.

Step 7: Now let’s build it with the following command:

dotnet build

Step 8: now run it with the below command:

dotnet run

The below images shows the URL that it is running on. 

Step 9: Now let’s open that in a browser. This is the Blazor app running on our local machine. This runs in WebAssembly in our browser. 

Here, we can authenticate it too. This will use your Azure accounts to which you are already logged. 

You can use Azure Active Directory to protect all sorts of applications, including a Blazor WebAssembly app. 


Previous Article
Next Article

Similar Reads

How To Configure Azure Active Directory?
Azure Active Directory is a cloud based service provided by Microsoft. It is a identity provider and access management (IAM) service. If you use any of the services like Microsoft 365, Outlook etc. you're already using Azure AD. When you log into these services, you're, in fact, logging into Azure AD. Uses of Azure ADService like Skype, Outlook and
4 min read
Azure Active Directory
Azure Active Directory (Azure AD) is a service for managing identities and access in the cloud. This solution facilitates access to thousands of additional SaaS applications, the Azure portal, and external resources like Microsoft 365 for your staff members. They can also access internal resources like apps on your business intranet network and any
8 min read
Azure Active Directory Authentication
Azure Active Directory is now Microsoft Entra ID. Microsoft Entra ID is a cloud-based identity provider and access management service. If you are using Skype, Outlook, or OneDrive, then you are already a customer of Microsoft Entra ID. To access these services, the necessary thing is that you have to log in with your username and password related t
6 min read
How to use Azure Active Directory to Manage User Authentication and Authorization?
Microsoft is currently replacing the cloud-based identity and access management service Azure Active Directory (Azure AD) with Microsoft Entra ID. It is an element of the Identity as a Service (IDaaS) class and serves as a refuge for user profiles, both individual and public. An extensive overview of Azure AD's features, benefits features, and fund
10 min read
Microsoft SQL Server Active Directory Authentication on Linux Machine
In this article, we will look into the process of connecting to an SQL Server running on Linux using a Kerberos-based identity provider. In this example, we'll use Active Directory as a Kerberos identity provider, but this will work with other Kerberos identity providers like Red Hats Identity Manager or Centrify too. Follow the below steps for the
2 min read
Microsoft Azure - Security Capabilities and Tasks of Azure SQL
In this article, we are going to dive into the security module of Azure SQL. The way we're going to approach this module is by looking at security capabilities and tasks. At a high level, if we look at some of the capabilities that are available in Azure SQL, you're going to see a lot of overlap with capabilities you're familiar with in SQL Server
2 min read
Microsoft Azure - Security in Azure SQL
Pre-requisite: Azure VM Microsoft Azure is a cloud computing service offered by Microsoft for the purpose of application management through Microsoft-managed data centers. Microsoft Azure provides users with numerous application management options, which helps them freely and conveniently manage their work. Azure SQL is a group of cloud services, p
7 min read
Microsoft Azure - Find Security Score by Controls in Azure Subscriptions
Pre-requisite: Azure In this article, we will show you how to find the security score for the specific azure subscription and also for all subscriptions by subscriptionId using the KQL resource graph query. In order to read resources in Azure using KQL (Kusto Query Language) one should have at least read access on the select subscriptions or "Azure
2 min read
Microsoft Azure - Query Application Event Log Data using Azure KQL
Here in this article, we will find the application event log data from log analytics data sources using the custom query language(KQL). Application Event Logs that are captured should be retrieved using the KQL event operator. This KQL Event operator helps users to troubleshoot the application failures, warnings, and other informational sources for
2 min read
Microsoft Azure - Azure Application Service Environments v2 Private PaaS Environments in the Cloud
Pre-requisite: Azure Microsoft Azure is a Cloud Computing Platform and Infrastructure created by Microsoft for building, deploying, and managing applications and services through a global network of Microsoft-managed data centers. Azure Application Service Environments (ASE) v2 is a private Platform as a Service (PaaS) environment in the cloud that
5 min read