To create a new ASP.NET Core web app you can either use the command line, or the Visual Studio wizard.
Create a new ASP.NET Core web app using the command lineYou can create a web app that sign-in users. You can also add the capability for your web app to call Microsoft Graph, or any downstream API. Based on what you want to have, use the following commands, from a developer prompt.
Add web app calls graph call downstream API Entra ID or Entra External IDsdotnet new webapp --auth SingleOrg
--calls-graph
--called-api-scopes <scopes> --called-api-url <url>
Azure AD B2C dotnet new webapp --auth IndividualB2C
N/A --called-api-scopes <scopes> --called-api-url <url>
ex: The following command creates a new web app that calls Microsoft graph
dotnet new webapp --auth SingleOrg --calls-graph
The following command creates a new web app that calls a downstream API located at https://localhost:12345/
accepting a scope https://myapp.mydomain.com/read
dotnet new webapp --auth SingleOrg --called-api-scopes https://myapp.mydomain.com/read --called-api-url https://localhost:12345/
You can also replace webapp
by:
mvc
to have controllers and views instead of razor pagesrazor
(which is the same as webapp)blazorserver
to have a web app with blazor pages. From the authentication point of view things will be the same.AFter the command line runs, you 'll have the code for your web app. You now need to map the configuration of this code (in the appsettings.json file) to a app registration in Azure AD (new or existing). For this, check out the msidentity-app-sync tool
Create a new ASP.NET Core web app using the Visual Studio wizardIn Visual Studio, choose Create a new project
In the Create a new project dialog, choose ASP.NET Core web app, and press Next
Provide a project name, a location, and a solution name, and press next
in the next dialog, in the Authentication type drop down, choose "Microsoft identity platform"
then click Create
Once the code is generated, the 'Connected services' page automatically opens in Visual Studio, and proposes you to install the donet msidentity tool, that will handle the app registration for you. Click Next
Choose a tenant where to create an application. Depending on the tenant type (AAD or B2C), your code will be updated to be an AAD or an Azure AD B2C application.
Create a new app, or pick an existing app in the tenant.
Choose if you want to call Microsoft Graph or not. The code for your application will be updated accordingly
If you chose to call an API, the wizard will also provide you with options to store the application secret.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4