To run the completed project in this folder, you need the following:
-
The .NET SDK installed on your development machine.
-
A Microsoft work or school account.
If you don't have a Microsoft account, you can sign up for the Microsoft 365 Developer Program to get a free Microsoft 365 subscription.
-
Open a browser and navigate to the Azure Active Directory admin center and login using a personal account (aka: Microsoft Account) or Work or School Account.
-
Register a new application to the Azure Active Directory
-
Enter a name for your application, for example,
STMigration
.
-
Set Supported account types as desired. The options are:
Option Who can sign in? Accounts in this organizational directory only Only users in your Microsoft 365 organization Accounts in any organizational directory Users in any Microsoft 365 organization (work or school accounts) Accounts in any organizational directory ... and personal Microsoft accounts Users in any Microsoft 365 organization (work or school accounts) and personal Microsoft accounts -
Leave Redirect URI empty.
-
Select Register.
-
-
Copy the value of the Application (client) ID and save it, you will need it later.
-
Also copy the Directory (tenant) ID and save it.
-
-
-
Select Authentication under Manage.
-
Locate the Advanced settings section and change the Allow public client flows toggle to Yes, then choose Save.
-
Note: This section requires a work/school account with the Global administrator role.
-
Select API permissions under Manage.
-
Remove the default User.Read permission under Configured permissions by selecting the ellipses (...) in its row and selecting Remove permission.
-
-
Select Application permissions.
-
Select TeamMember.ReadWrite.All
-
Select ChannelSettings.ReadWrite.All
-
then select Add permissions.
-
-
Select Certificates and secrets under Manage, then select New client secret.
-
Go to the online Graph Explorer
-
[CLICK ME] Run the default command: GET my profile
https://graph.microsoft.com/v1.0/me
-
Open appsettings.json and update the values according to the following table.
Setting | Value |
---|---|
Tenant |
The tenant ID of your organization |
ClientId |
The client ID of your app registration |
ClientSecret |
The value of the client secret |
OwnerUserId |
The user ID of your team account |
In your command-line interface (CLI), navigate to the project directory and run the following commands.
dotnet restore
dotnet build
dotnet run