#Create a User in Entra ID
Explore tagged Tumblr posts
Text
How to Create a User and Custom Domain in Entra ID
Since Microsoft Entra (formerly Azure Active Directory) tenants come with an initial domain name like “<name>.onmicrosoft.com” that you can not change or delete. But you can add your organization’s DNS name as a custom domain and set it as the primary domain. Therefore, in this article, I will show you how to create a User and Custom Domain in Entra ID. Please see AADSTS50020: User from Identity…
#Azure#Azure Active Directory#Azure AD#Create a User in Azure AD#Create a User in Entra ID#Entra ID#Entra ID Custom Domain#Entra ID Tenant#Microsoft Entra ID
0 notes
Text
Power Apps: Latest Features and Updates 2025
Power Apps: Latest Features and Updates 2025
In today’s rapidly evolving digital landscape, organizations are constantly seeking agile solutions to streamline operations and enhance productivity. Power Apps, Microsoft’s powerful low-code platform, empowers users to build custom applications with minimal coding effort. From automating tasks to integrating with diverse data sources, Power Apps enables both technical and non-technical users to innovate and deliver impactful business solutions.
With each release wave, Microsoft introduces new features and enhancements to help users create smarter, faster, and more scalable applications. This blog highlights the most exciting new and planned features for Power Apps, scheduled for release between April and September 2025.
For businesses looking to stay ahead of the curve—especially those exploring affordable Power Apps solutions in Noida—these updates offer valuable insights into what’s coming next in the Power Platform ecosystem.
It’s important to note that Microsoft’s release timelines are flexible—features listed in this blog may evolve, and some functionalities may be released later than expected. For the latest updates and rollout schedules, Microsoft’s official release plan should be consulted.
2. Building Modern Apps
Feature
Enabled for
Public preview
Early access*
General availability
Select columns downloaded on mobile devices
Admins, makers, marketers, or analysts, automatically
-
-
Aug 2025
Use Entra auth for external Tenants in Power Apps
Users, automatically
-
-
Apr 2025
Use the SQL Decimal Type in Power Apps
Users, automatically
-
-
May 2025
Re-edit data sources with stored procedures
Users, automatically
-
-
Apr 2025
In today’s mobile-first world, businesses demand applications that are not only powerful but also responsive and capable of functioning offline. Power Apps continues to evolve by introducing features that help developers and businesses build modern, efficient, and user-friendly applications across devices.
a. Responsive and Offline-Capable Apps
Modern apps need to adapt seamlessly to various screen sizes, devices, and connectivity scenarios. With this in mind, Microsoft is rolling out a set of features aimed at improving mobile usability, boosting app performance, and providing greater design flexibility. These enhancements are especially beneficial for organizations seeking Hire Power Apps developer India that cater to on-the-go business needs.
🔑 Key Features:
Select Columns Downloaded on Mobile Devices (General Availability: August 2025) → This feature improves mobile performance by allowing apps to download only the necessary data columns. It reduces data load and speeds up access on mobile devices, making apps more efficient in low-bandwidth environments.
Use Entra Auth for External Tenants (GA: April 2025) → Now, users from external organizations can securely access apps using Microsoft Entra ID. This improves collaboration and extends app usability beyond your internal team without compromising on security.
SQL Decimal Type Support (GA: May 2025) → With the addition of support for SQL’s decimal data type, Power Apps now allows more accurate calculations and data entry, especially important for financial and data-intensive applications.
Re-edit Data Sources with Stored Procedures (GA: April 2025) → This feature brings greater flexibility to developers by enabling them to reconfigure or modify data sources that use stored procedures, making app updates easier and more dynamic.
These updates mark a significant step forward in empowering developers to build high-performance, cross-platform apps that are tailored to the specific needs of modern businesses.
3. Copilot for Power Apps Makers and Users
Feature
Enabled for
Public preview
Early access*
General availability
Find records and filter views using natural language
Users by admins, makers, or analysts
-
Apr 2025
Fill forms faster with smart paste
Users by admins, makers, or analysts
-
Apr 2025
Copilot helps you plan out solutions to business problems
Admins, makers, marketers, or analysts, automatically
-
May 2025
Enhanced experience for form filling with Copilot
Users by admins, makers, or analysts
Feb 2, 2025
-
Apr 2025
a. AI-Enhanced App Development
Artificial Intelligence is transforming the way applications are built and used, and Power Apps is leading the charge with its growing suite of Copilot features. Designed to boost productivity and simplify app creation, Copilot enables makers and end-users to interact with apps more intuitively—using natural language and smart automation.
Whether you're a developer building solutions or an end-user entering data, AI is making the experience smarter, faster, and more efficient. These advancements are particularly useful for businesses looking for Top Power Apps consultants in Delhi NCR, as they reduce development time and enhance user engagement with minimal effort.
🔑 Key Features:
Find Records & Filter Views Using Natural Language (General Availability: April 2025) → Users can now simply type what they’re looking for—like "show all orders from last month"—and Power Apps will automatically apply the correct filters. No complex queries required.
Smart Paste for Faster Form Filling (GA: April 2025) → This feature intelligently pastes and maps copied data into the right fields, saving time and reducing manual entry errors—perfect for repetitive form tasks.
Copilot Solution Planner (GA: May 2025) → App makers can describe a business problem in natural language, and Copilot will suggest logical components, data structures, and flows to help kickstart the app-building process.
Enhanced Form Filling with Copilot (GA: April 2025) → Copilot now offers an improved, guided experience when filling out complex forms, helping users complete them more accurately and quickly.
These AI-powered features aren't just enhancements—they're game-changers for app usability and productivity. Copilot brings the vision of intelligent, self-building applications one step closer to reality.
4. Enable Enterprise Scale
Feature
Enabled for
Public preview
Early access*
General availability
Enhanced testing for Power Apps
Users by admins, makers, or analysts
Mar 2025
-
May 2025
Be aware of authentication change in RSAT
Users, automatically
-
Mar 2025
May 2025
Manage your source code for canvas apps
Admins, makers, marketers, or analysts, automatically
May 2025
-
Jun 2025
a. Features for Building Large, Complex Apps
As businesses grow, so do their application needs. Power Apps is not only about building small, isolated applications—it’s also about empowering organizations to scale their solutions enterprise-wide. For larger companies with more complex requirements, these upcoming features will enable the creation of robust, scalable apps that meet both current and future needs.
Power Apps’ new features focus on streamlining the development process, enhancing testing capabilities, and providing the necessary tools for managing and maintaining enterprise-grade apps. These updates are critical for businesses seeking Power Apps service providers in Noida that are capable of supporting large teams and complex workflows.
🔑 Key Features:
Enhanced Testing for Power Apps (General Availability: May 2025) → Microsoft is introducing improved testing tools that allow for more thorough testing and validation of apps before they go live. This will help ensure higher-quality releases with fewer bugs and better performance across various environments.
Authentication Change Awareness (RSAT) (GA: May 2025) → With this update, regression testing automation tool users will be alerted to changes in authentication protocols. This ensures that apps built with Power Apps continue to operate smoothly despite changes in authentication settings, preventing potential disruptions in critical business workflows.
Source Code Management for Canvas Apps (GA: June 2025) → Power Apps is introducing source code management for canvas apps, allowing developers to implement version control and collaborate more efficiently on app development. This feature is essential for teams working on large-scale projects, as it helps track changes, manage app versions, and ensure consistency across teams.
These updates bring Power Apps closer to becoming a robust solution for enterprise-level applications, providing the tools needed to manage large projects, improve testing processes, and collaborate effectively across teams.
5. Early Access and Availability Notes
Understanding Release Stages: Public Preview, Early Access, and General Availability
Microsoft Power Apps follows a structured release process that allows users to explore new features at different stages of development. Understanding these stages can help businesses make informed decisions about when to adopt new features and how to integrate them into their workflows.
Public Preview: Features in Public Preview are accessible to a wide audience for testing and feedback purposes. While they are generally stable, these features may still undergo changes based on user feedback and further testing. Businesses can start experimenting with these features but should be cautious about using them in production environments.
Early Access: Early Access allows select users to test new features before they are made generally available. This stage provides an opportunity for feedback and testing in real-world environments, though some features might still be refined. Early Access features are often available on a limited basis to specific users, typically developers or businesses that want to stay ahead of the curve.
General Availability (GA): Once a feature reaches General Availability, it is considered fully stable and ready for widespread use. These features are fully supported and available to all Power Apps users, ensuring that businesses can confidently integrate them into their enterprise solutions.
Early Access Starting February 3, 2025
Starting February 3, 2025, Microsoft will offer the option for users to opt into Early Access for several upcoming features. This provides a unique opportunity for businesses to test out features in their development stages and provide valuable feedback. However, users should be aware that features in Early Access may still evolve as Microsoft collects insights from the community.
Explore Microsoft’s Power Platform Release Plan
To stay updated on the latest developments and get an in-depth view of upcoming features, businesses should regularly consult Microsoft’s Power Platform release plan. This resource offers detailed information on what’s coming, timelines, and access levels, ensuring you never miss out on crucial updates that can enhance your Power Apps experience.
6. Conclusion
As we’ve explored in this blog, Power Apps is continuously evolving to meet the growing demands of businesses, enabling them to build smarter, faster, and more scalable applications. The upcoming features set for release between April and September 2025 are designed to enhance the user experience, streamline development processes, and empower businesses to scale their solutions more effectively.
From AI-driven Copilot features that boost productivity and streamline app creation, to enterprise-scale tools that improve testing and collaboration, these updates will significantly enhance both the functionality and usability of Power Apps. Whether you're building responsive and offline-capable apps, or looking to expand your business’s app ecosystem across multiple teams, Power Apps continues to deliver powerful solutions that drive efficiency and innovation.
These updates aren’t just about new features—they’re about unlocking new possibilities for businesses to enhance productivity, improve collaboration, and scale their operations in a way that meets today’s fast-paced business environment.
We encourage businesses to explore the Public Preview and Early Access features available through Microsoft’s Power Platform release plan. Experimenting with these new capabilities will give you a head start in adopting them, and it’s a great way to provide feedback that can help shape future releases.
If you are looking to implement these features or need expert guidance, consider hiring a Power Apps developer in India. A skilled developer can help you leverage these updates to create tailored solutions that meet your business’s unique needs.
0 notes
Text
Hello Community,
In this video I showed How to create and manage Custom Security attributes within Entra ID which allows to use in different scenarios, use-cases across users, devices and applications for access control, automations and many more.
Link: https://youtu.be/J7XWoA24hx0
1 note
·
View note
Text
What Is Azure Blob Storage? And Azure Blob Storage Cost

Microsoft Azure Blob Storage
Scalable, extremely safe, and reasonably priced cloud object storage
Incredibly safe and scalable object storage for high-performance computing, archiving, data lakes, cloud-native workloads, and machine learning.
What is Azure Blob Storage?
Microsoft’s cloud-based object storage solution is called Blob Storage. Massive volumes of unstructured data are best stored in blob storage. Text and binary data are examples of unstructured data, which deviates from a certain data model or specification.
Scalable storage and retrieval of unstructured data
Azure Blob Storage offers storage for developing robust cloud-native and mobile apps, as well as assistance in creating data lakes for your analytics requirements. For your long-term data, use tiered storage to minimize expenses, and scale up flexibly for tasks including high-performance computing and machine learning.
Construct robust cloud-native apps
Azure Blob Storage was designed from the ground up to meet the demands of cloud-native, online, and mobile application developers in terms of availability, security, and scale. For serverless systems like Azure Functions, use it as a foundation. Blob storage is the only cloud storage solution that provides a premium, SSD-based object storage layer for low-latency and interactive applications, and it supports the most widely used development frameworks, such as Java,.NET, Python, and Node.js.
Save petabytes of data in an economical manner
Store enormous volumes of rarely viewed or infrequently accessed data in an economical manner with automated lifecycle management and numerous storage layers. Azure Blob Storage can take the place of your tape archives, and you won’t have to worry about switching between hardware generations.
Construct robust data lakes
One of the most affordable and scalable data lake options for big data analytics is Azure Data Lake Storage. It helps you accelerate your time to insight by fusing the strength of a high-performance file system with enormous scalability and economy. Data Lake Storage is tailored for analytics workloads and expands the possibilities of Azure Blob Storage.
Scale out for billions of IoT devices or scale up for HPC
Azure Blob Storage offers the volume required to enable storage for billions of data points coming in from IoT endpoints while also satisfying the rigorous, high-throughput needs of HPC applications.
Features
Scalable, robust, and accessible
With geo-replication and the capacity to scale as needed, the durability is designed to be sixteen nines.
Safe and sound
Role-based access control (RBAC), Microsoft Entra ID (previously Azure Active Directory) authentication, sophisticated threat protection, and encryption at rest.
Data lake-optimized
Multi-protocol access and file namespace facilitate analytics workloads for data insights.
Complete data administration
Immutable (WORM) storage, policy-based access control, and end-to-end lifecycle management.
Integrated security and conformance
Complete security and conformance, integrated
Every year, Microsoft spends about $1 billion on cybersecurity research and development.
Over 3,500 security professionals who are committed to data security and privacy work for it.
Azure boasts one of the biggest portfolios of compliance certifications in the sector.
Azure Blob storage cost
Documents, films, images, backups, and other unstructured text or binary data can all be streamed and stored using block blob storage.
The most recent features are accessible through blob storage accounts, however they do not allow page blobs, files, queues, or tables. For the majority of users, general-purpose v2 storage accounts are advised.
Block blob storage’s overall cost is determined by:
Monthly amount of data kept.
Number and kinds of activities carried out, as well as any expenses related to data transfer.
The option for data redundancy was chosen.
Adaptable costs with reserved alternatives to satisfy your needs for cloud storage
Depending on how frequently you anticipate accessing the data, you can select from its storage tiers. Keep regularly accessed data in Hot, seldom accessed data in Cool and Cold, performance-sensitive data in Premium, and rarely accessed data in Archive. Save a lot of money by setting up storage space.
To continue building with the same free features after your credit, switch to pay as you go. Only make a payment if your monthly usage exceeds your free amounts.
You will continue to receive over fifty-five services at no cost after a year, and you will only be charged for the services you utilize above your monthly allotment.
Read more on Govindhtech.com
#AzureBlobStorage#BlobStorage#machinelearning#Cloudcomputing#cloudstorage#DataLakeStorage#datasecurity#News#Technews#Technology#Technologynews#Technologytrends#govindhtech
0 notes
Text
Exploring the Power of Microsoft Identity Platform
Join us on a journey to understand how Microsoft Identity Platform revolutionizes user access, enhancing both security and user experience.
What is microsoft identity platform?
The Microsoft identity platform is a cloud identity service that allows you to build applications your users and customers can sign in to using their Microsoft identities or social accounts. It authorizes access to your own APIs or Microsoft APIs like Microsoft Graph.
OAuth 2.0 and OpenID Connect standard-compliant authentication service enabling developers to authenticate several identity types, including:
Work or school accounts, provisioned through Microsoft Entra ID
Personal Microsoft accounts (Skype, Xbox, Outlook.com)
Social or local accounts, by using Azure AD B2C
Social or local customer accounts, by using Microsoft Entra External ID
Open-source libraries:
Microsoft Authentication Library (MSAL) and support for other standards-compliant libraries. The open source MSAL libraries are recommended as they provide built-in support for conditional access scenarios, single sign-on (SSO) experiences for your users, built-in token caching support, and more. MSAL supports the different authorization grants and token flows used in different application types and scenarios.
Microsoft identity platform endpoint:
The Microsoft identity platform endpoint is OIDC certified. It works with the Microsoft Authentication Libraries (MSAL) or any other standards-compliant library. It implements human readable scopes, in accordance with industry standards.
Application management portal:
A registration and configuration experience in the Microsoft Entra admin center, along with the other application management capabilities.
Application configuration API and PowerShell:
Programmatic configuration of your applications through the Microsoft Graph API and PowerShell so you can automate your DevOps tasks.
Developer content:
Technical documentation including quickstarts, tutorials, how-to guides, API reference, and code samples.
For developers, the Microsoft identity platform offers integration of modern innovations in the identity and security space like passwordless authentication, step-up authentication, and Conditional Access. You don't need to implement such functionality yourself. Applications integrated with the Microsoft identity platform natively take advantage of such innovations.
With the Microsoft identity platform, you can write code once and reach any user. You can build an app once and have it work across many platforms, or build an app that functions as both a client and a resource application (API).
More identity and access management options
Azure AD B2C - Build customer-facing applications your users can sign in to using their social accounts like Facebook or Google, or by using an email address and password.
Microsoft Entra B2B - Invite external users into your Microsoft Entra tenant as "guest" users, and assign permissions for authorization while they use their existing credentials for authentication.
Microsoft Entra External ID - A customer identity and access management (CIAM) solution that lets you create secure, customized sign-in experiences for your customer-facing apps and services.
The Components that make up the Microsoft identity platform:
OAuth 2.0 and OpenID Connect standard-compliant authentication service enabling developers to authenticate several identity types, including:
Work or school accounts, provisioned through Microsoft Entra ID
Personal Microsoft accounts (Skype, Xbox, Outlook.com)
Social or local accounts, by using Azure AD B2C
Social or local customer accounts, by using Microsoft Entra External ID
Open-source libraries: Microsoft Authentication Library (MSAL) and support for other standards-compliant libraries. The open source MSAL libraries are recommended as they provide built-in support for conditional access scenarios, single sign-on (SSO) experiences for your users, built-in token caching support, and more. MSAL supports the different authorization grants and token flows used in different application types and scenarios.
Microsoft identity platform endpoint - The Microsoft identity platform endpoint is OIDC certified. It works with the Microsoft Authentication Libraries (MSAL) or any other standards-compliant library. It implements human readable scopes, in accordance with industry standards.
Application management portal: A registration and configuration experience in the Microsoft Entra admin center, along with the other application management capabilities.
Application configuration API and PowerShell: Programmatic configuration of your applications through the Microsoft Graph API and PowerShell so you can automate your DevOps tasks.
Developer content: Technical documentation including quickstarts, tutorials, how-to guides, API reference, and code samples.
0 notes
Text
Get the Last Password Change Date Using PowerShell in Microsoft 365
Table of Contents One of the key components of security is managing passwords. Password management is a critical aspect of maintaining security in the digital realm. In this comprehensive guide, we will discuss various methods for checking the last password change date in Microsoft 365.There are three methods for checking the last password change date in Microsoft 365: Using the Entra admin centerUsing Microsoft Graph PowerShell SDKUsing Microsoft Graph API Using the Entra admin center 1. Visit the Entra admin center then login using an administrative account.2. Navigate to Users | All users | Manage view | Edit columns. 3. Select the option Last password change date time from the list. Now the last password change date time is shown. Using the Microsoft Graph PowerShell SDK The second way is using Microsoft Graph PowerShell SDK. This method requires you to install some PowerShell modules on your machine. But, if you're familiar with the other Microsoft modules such as MSOL, ExchangeOnlineManagement, AzureAD...this is a good option.1. Install the required Microsoft Graph PowerShell SDK module by opening PowerShell as administrator then run the following command: Install-Module -Name Microsoft.Graph.Users -Scope CurrentUser 2. Getting the user’s information requires a certain level of permissions to be granted to the Microsoft Graph Command Line Tools application. So, in this case, we need to connect to Graph PowerShell with the following scopes: Connect-MgGraph -Scopes "User.Read.All" To get the last password change date for a particular user, use this Microsoft Graph PowerShell script: # Get the user information $properties = @('DisplayName','UserPrincipalName','AccountEnabled','lastPasswordChangeDateTime') $userId = '[email protected]' $result = Get-MgUser -UserId $userId -Property $properties # Get the user's last password change date and time $result | Select-Object $properties Similarly, to get the last password change date timestamp of all users, use the following PowerShell script: $properties = @('DisplayName','UserPrincipalName','AccountEnabled','lastPasswordChangeDateTime') Get-MgUser -All -Property $properties | Select-Object $properties This information can be very helpful for administrators who need to monitor user accounts and ensure their passwords are secure. To export the last password change date for all users to a CSV file, here is the PowerShell script: # Set the properties to retrieve $properties = @( "id", "displayName", "userprincipalname", "lastPasswordChangeDateTime", "mail", "jobtitle", "department" ) # Retrieve the password change date timestamp of all users $result = Get-MgUser -All -Property $Properties | Select-Object $properties $result | Format-Table # Export to CSV # $result | Export-Csv -Path "C:TempPasswordChangeTimeStamp.csv" -NoTypeInformation Using Microsoft Graph REST API Alternatively, we can use the Microsoft Graph Rest API to export the last time password change of all users in a Microsoft 365 tenant. When using this method:We don't need to install any modules of the Microsoft Graph PowerShell SDK (~ 80 modules).We can do it from any computer with Microsoft PowerShell or PowerShell Core installed (Linux and macOS are supported with PowerShell 7+ installed).Use the native PowerShell cmdlet Invoke-RestMethod to make a request.Instead of using an account for authentication and authorization, we use the app-only access (access without a user).Important: Before you begin, make sure you've created an app registration in Microsoft entra admin center and collect some required information such as clientId, tenantId and the clientSecret.Once the app has been created, replace your app's information (clientId, tenantId and the clientSecret) into the below code. Steps in the script:Get access token ($token) with app registration client secret.Create the request header ($headers) for API call.Create requests to the Microsoft Graph resource ($userEndpoint) with pagination to get all data.Build the report ($result) from API call response.Output options to console, graphical grid view or export to CSV file. # Define variables $clientId = "xxxxxxxxxxxxxxxxxxxx" $clientSecret = "xxxxxxxxxxxxxxxxxxxx" $tenantId = "xxxxxxxxxxxxxxxxxxxx" # Get OAuth token $tokenEndpoint = "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" $body = @ client_id = $clientId client_secret = $clientSecret grant_type = "client_credentials" scope = "https://graph.microsoft.com/.default" $response = Invoke-RestMethod -Method Post -Uri $tokenEndpoint -Body $body # Extract access token $accessToken = $response.access_token # Create the request header for API call $headers = @ "Authorization" = "Bearer $accessToken" "Content-Type" = "application/json" $userEndpoint = "https://graph.microsoft.com/v1.0/users?`$select=DisplayName,UserPrincipalName,AccountEnabled,lastPasswordChangeDateTime&`$top=100" #Perform pagination if next page link (odata.nextlink) returned $result = @() while ($null -ne $userEndpoint) $response = Invoke-RestMethod -Method GET -Uri $userEndpoint -Headers $headers $users = $response.value ForEach($user in $users) $Result += New-Object PSObject -property $([ordered]@ DisplayName = $user.displayName UserPrincipalName = $user.userPrincipalName AccountEnabled = $user.AccountEnabled lastPasswordChangeDateTime = $user.lastPasswordChangeDateTime ) $userEndpoint = $response.'@odata.nextlink' # Output options to console, graphical grid view or export to CSV file. $result | Format-Table # $result | Out-GridView # $result | Export-CSV "C:Result.csv" -NoTypeInformation -Encoding UTF8
0 notes
Text
LinkedIn Rolls Out Three New Features For Users to Authenticate Their Identities (April 17)
On April 12, LinkedIn announced it would strengthen its users’ identity verification measures. The Microsoft-owned company is adding new features to its extremely popular employment-focused platform, including three new identity measures that will be offered at no charge. Looking at social media platforms–Facebook, Instagram, and Twitter–that provide verification services, it has become crucial for the company to authenticate aspects of a user’s identity and job history. If someone attempts to make a copycat account, there will now be apparent differences between the verified profile and its imposter.
The first feature LinkedIn has created to facilitate verification among its users is by entering a security code on their profile that they will receive through their work email.
The company has partnered with the airport security service Clear to provide their second option for user verification. Clear will take your U.S. phone number and government-issued ID to see whether it matches your profile’s name. While it is your responsibility to trust a third party with your personal information, Clear has already established itself in America for its travel verification systems.
The final option LinkedIn has offered users is to confirm their name and employer through Microsoft’s Entra Verified ID credential. This workplace identification system was launched last year, and has been tested with companies like Accenture, Avanade, and Microsoft. It is expected to be available for public use by the end of the month.
Since June 2022, LinkedIn has noted many fraudulent activities on its platform and hopes to remove fake accounts by expanding verification. It is essential to boost authenticity for the 900 million users the platform has. Its timely announcement also contrasts Twitter’s paid verification model that many users and companies have criticized Elon Musk for. Oscar Rodriguez, Vice President of LinkedIn, notes that he wants to give all LinkedIn members access to these new innovative and accessible features that will “give you the confidence that who you’re connecting with and the content you come across is trusted and authentic.”
Word count: 341
0 notes
Text
Part 4: How to use EF Core with MongoDb in Blazor Server Web Application
In part 4 of the series, I'm going to show you how to use EF Core with MongoDb in Blazor Server Web Application.
Articles in this series:
Part 1: Getting started with Blazor Server Web App Development using .NET 8
Part 2: How to implement Microsoft Entra ID Authentication in Blazor Server Web App in .NET 8
Part 3: How to implement Multilanguage UI in Blazor Server Web App in .NET 8
Part 4: How to use EF Core with MongoDb in Blazor Server Web Application
Part 5: How to show Dashboard with Radzen Bar and Pie Chart controls in in Blazor Server Web App
Part 6: How to support Authorization in Blazor server web app when using Microsoft Entra ID authentication
Part 7: How to implement Radzen Grid Control with dynamic paging, filtering, shorting in in Blazor Server Web App
Part 8: How to implement Data Entry form in Blazor server web app
Part 9: How to use SignalR to show real time updates in Blazor server web app
Entity Framework Core (EF Core) is a popular Object-Relational Mapper (ORM) framework for .NET applications. While primarily designed for relational databases, it has expanded its capabilities to support NoSQL databases, including MongoDB. This article will guide you through the process of using EF Core with MongoDB in your .NET 8 projects
Introduction
Before diving into the code, it's crucial to understand the nuances of using EF Core with MongoDB. Unlike relational databases, MongoDB is a NoSQL database, meaning it doesn't adhere to the traditional table-row structure. This introduces certain limitations and differences in how EF Core operates with MongoDB compared to relational databases.
In Part 1 of this series, I've explained the development environment setup for this article, that I will repeat here for the users who have not gone through it.
Before we start
In order to follow along with this articles, you will need:
.NET 8 SDK and .NET 8 Runtime installation
If you are planning to use Visual Studio 2022, make sure you have all latest updates installed (v17.8.2)
Install MongoDb Community Server, MongoDb Compass, and Mongodb version of Northwind database (Covered in this blog)
You may need Microsoft Azure (trial will also work) to setup Entra ID App in Azure and configure it to use
If you are fan of command line tools or want to know more about the tooling, see ASP.NET Core Blazor Tooling
How to setup MongoDB for development on windows
If you are not familiar with setting up MongoDB for development on windows, here is a quick walkthrough of what you will need:
Go to MongoDB download center and download MongoDB Community Server MSI package and install.
Next you will need MongoDB compass MSI and install it. You will need this tool to connect with your MongoDB Community Server and do the database administration related activities. If you are familiar with Microsoft SQL Server world, MongoDB compass is like SQL Server Management Studio of MongoDB world.
Next, download MongoDB Command line Database Tool which we will need to import an existing sample database.
We will be using a sample existing database called Northwind that I've downloaded from here
Import Northwind Mongodb Database
Open MongoDB Compass and connect to localhost:27017 which is a default port when you install MongoDB Server on windows.
Click on the databases in the left navigation and create a new database with name northwind and collection sample.
Go to github repository here in your browser, click on code in the top right and then download zip menu to download the zip file.
Extract MongoDB command line database tools zip file
Open mongo-import.sh inside the root folder and change the mongoimport keyword with the actual full path of mongoimport.exe that is part of MongoDb command line database tools zip file. The resulting line will look like below: "C:\temp\import\mongodb-database-tools\bin\mongoimport" -d "$1" -c "$collection" --type json --file "$file"
Open command prompt and go to root folder where you have mongo-import.sh file and run command ./mongo-import.sh northwind
If everything is done correctly, you will see console message that displays the json file name and the number of documents imported.
If you switch back to MongoDB Compass, select northwind database and click on the refresh at the top right corner of the sidebar, you will see collections like customers, employees etc.
We are going to use this sample database to build something interesting that makes sense and has a real-life use cases instead of just a sample table with a few fields.
Setting Up the Project
Create ASP.NET Core Blazor Server Web Application
Start visual studio and select create new project.
In the Create a new project window, type Blazor on the search box and hit Enter.
Select the Blazor Web App template and select Next.
In the Configure your new project window, enter BlazorAppPart4 as the project name and select Next.
In the Additional information window, select .NET 8.0 (Long Term Support) in the Framework drop-down if not already selected and click the Create button.
Build and run the application once so that you have your application url that you can copy from the browser and save it for later.
Add the nuget package
Open Tools > nuget package manager > Nuget package manager console and type following command:
install-package MongoDb.EntityFrameworkCore
view rawPackageManager.ps hosted with ❤ by GitHub
This will install all the necessary files needed for accessing northwind database that we created in MongoDb using Entity Framework Core Code First.
Add Model for Customer table
In the example northwind database, there is already a customers table with some data in it. We are going to display the first name and last name of the customer. So, let's create a folder in the root called Model and add new file called Customer.cs that contains following class definition.
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.EntityFrameworkCore;
namespace BlazorAppPart4.Model
{
[Collection("customers")]
public class Customer
{
[BsonId]
public int Id { get; set; }
[BsonElement("last_name")]
public string? LastName { get; set; }
[BsonElement("first_name")]
public string? FirstName { get; set; } }}
view rawCustomer.cs hosted with ❤ by GitHub
Create Entity Framework Core AppDbContext class
Next, we are going to create a new class called AppDbContext that inherits from DbContext class of entity framework core. Add another cs file called AppDbContext.cs in the models folder and paste following code.
using Microsoft.EntityFrameworkCore;
namespace BlazorAppPart4.Model
{
public class AppDbContext: DbContext
{
public DbSet<Customer> Customers { get; init; }
public AppDbContext(DbContextOptions options) :
base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Customer>();
}
}
}
view rawAppDbContext.cs hosted with ❤ by GitHub
Create Customer Repository
Next, we want to use repository pattern to ensure data access code is separate and testable. Add another folder in the root of your project called Repositories and add a new cs file called ICustomerRepository.cs with below code:
using BlazorAppPart4.Model;
namespace BlazorAppPart4.Repositories
{
public interface ICustomerRepository
{
Task<List<Customer>> GetAllAsync();
}
}
view rawICustomerRepository.cs hosted with ❤ by GitHub
Once you are done, add 1 more file called CustomerRepository.cs with below code:
using BlazorAppPart4.Model;
using Microsoft.EntityFrameworkCore;
namespace BlazorAppPart4.Repositories
{
public class CustomerRepository : ICustomerRepository
{
private readonly AppDbContext _db;
public CustomerRepository(AppDbContext db)
{
_db = db;
}
public async Task<List<Customer>> GetAllAsync()
{
return await _db.Customers.ToListAsync();
}
}
}
view rawCustomerRepository.cs hosted with ❤ by GitHub
Create AppSettings.json settings
The AppDbContext context will require MongoDb connectionstring and database name. It is recommended to create an application wide setting section in the AppSettings.json. Open your AppSettings.json and 'AppConfig' section from below. I'm showing my full AppSettings.json file for your reference:
{
"AppConfig": {
"Database": {
"ConnectionString": "mongodb://localhost:27017",
"DatabaseName": "northwind"
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
view rawAppSettings.json hosted with ❤ by GitHub
Create AppConfig class for settings
Add AppConfig.cs class in your project and then add below code in the class definition:
namespace BlazorAppPart4
{
public class AppConfig
{
public AppConfig() {
Database = new DbConfig();
}
public DbConfig Database { get; set; }
}
public class DbConfig { public string? ConnectionString { get; set; }
public string? DatabaseName { get; set;
}
}
}
view rawAppConfig.cs hosted with ❤ by GitHub
Configure Dependencies in Program.cs
Next, we want to configure dependency injection so that Repository and AppDbContext classes that we created in our project can be injected where required. Here is my Program.cs:
using BlazorAppPart4;
using BlazorAppPart4.Components;
using BlazorAppPart4.Model;
using BlazorAppPart4.Repositories;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
var appConfig = builder.Configuration.GetSection("AppConfig").Get<AppConfig>();
if (appConfig == null)
{
throw new InvalidOperationException("Db connectionstring not found");
}
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseMongoDB(appConfig.Database.ConnectionString ?? "", appConfig.Database.DatabaseName ?? ""));
builder.Services.AddTransient<ICustomerRepository, CustomerRepository>();
var app = builder.Build();
// Configure the HTTP request pipeline.
f (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles()
;app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();
view rawProgram.cs hosted with ❤ by GitHub
Please note on line 13 above, we are reading our AppSettings.json section called AppConfig and then convert it to AppConfig class object. On line 18, we are configuring Entity Framework Core MongoDb data access connection string. On line 21, we are resolving the customer repository. The other part of the file has no changes.
Show customers
And finally, open Components/Pages/Home.razor and replace the content of the file with below:
@page "/"
@using BlazorAppPart4.Repositories
@using BlazorAppPart4.Model
@inject ICustomerRepository customerRepo
@rendermode RenderMode.InteractiveServer
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
@if(customers.Any())
{
<table class="table table-striped table-responsive">
<thead>
<th>Name</th>
</thead>
<tbody>
@foreach (var cust in customers)
{
<tr>
<td>
@cust.FirstName @cust.LastName
</td>
</tr>
}
</tbody>
</table>
}
else{
<p>No customers found</p>
}
@code {
List<Customer> customers;
protected override async Task OnInitializedAsync()
{
customers = await customerRepo.GetAllAsync();
}
}
view rawHome.razor hosted with ❤ by GitHub
Here is the output of the whole exercise
Conclusion
In this article, we covered the step by step tutorial of How to use EF Core with MongoDb in Blazor Server Web Application of the blazor web app development series.
Ready to unlock the full potential of Blazor for your product development? Facile Technolab, top Blazor Development Company in India providing Blazor development services can help you bring your vision of product mvp to reality.
0 notes