You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: 1-Call-MSGraph/AppCreationScripts/AppCreationScripts.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
### Quick summary
6
6
7
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.
7
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly.
8
8
9
9
```PowerShell
10
10
cd .\AppCreationScripts\
@@ -28,23 +28,23 @@
28
28
29
29
### Presentation of the scripts
30
30
31
-
This sample comes with two PowerShell scripts, which automate the creation of the Azure Active Directory applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
31
+
This sample comes with two PowerShell scripts, which automate the creation of the Microsoft Entra applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
32
32
33
33
These scripts are:
34
34
35
35
-`Configure.ps1` which:
36
-
- creates Azure AD applications and their related objects (permissions, dependencies, secrets, app roles),
36
+
- creates Microsoft Entra applications and their related objects (permissions, dependencies, secrets, app roles),
37
37
- changes the configuration files in the sample projects.
38
-
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Azure AD application it created:
38
+
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Microsoft Entra application it created:
39
39
- the identifier of the application
40
40
- the AppId of the application
41
-
- the url of its registration in the [Azure portal](https://portal.azure.com).
41
+
- the url of its registration in the [Microsoft Entra admin center](https://portal.azure.com).
42
42
43
-
-`Cleanup.ps1` which cleans-up the Azure AD objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, `git reset`).
43
+
-`Cleanup.ps1` which cleans-up the Microsoft Entra objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, `git reset`).
44
44
45
45
### Usage pattern for tests and DevOps scenarios
46
46
47
-
The `Configure.ps1` will stop if it tries to create an Azure AD application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
47
+
The `Configure.ps1` will stop if it tries to create a Microsoft Entra application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
48
48
49
49
## How to use the app creation scripts?
50
50
@@ -107,8 +107,8 @@ Note that the script will choose the tenant in which to create the applications,
107
107
108
108
if you want to create the apps in a particular tenant, you can use the following option:
109
109
110
-
- Open the [Azure portal](https://portal.azure.com)
111
-
- Select the Azure Active directory you are interested in (in the combo-box below your name on the top right of the browser window)
110
+
- Open the [Microsoft Entra admin center](https://portal.azure.com)
111
+
- Select the Microsoft Entra ID you are interested in (in the combo-box below your name on the top right of the browser window)
112
112
- Find the "Active Directory" object in this tenant
113
113
- Go to **Properties** and copy the content of the **Directory Id** property
This sample application shows how to use the [Microsoft identity platform](https://aka.ms/identityplatform) to access the data of Microsoft business customers in [Microsoft Graph](https://aka.ms/msgraph) in a long-running, non-interactive process. It uses the [OAuth 2 client credentials grant](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow) to acquire an [Access Tokens](https://aka.ms/access-tokens), which is then used to call the [Microsoft Graph](https://graph.microsoft.io) API and access organizational data.
21
21
22
-
The app is a .NET Core Console application. It gets the list of users in an Azure AD tenant by using the Microsoft Authentication Library for .NET ([MSAL.NET](https://aka.ms/msal-net)) to authenticate and acquire a token.
22
+
The app is a .NET Core Console application. It gets the list of users in a Microsoft Entra tenant by using the Microsoft Authentication Library for .NET ([MSAL.NET](https://aka.ms/msal-net)) to authenticate and acquire a token.
23
23
24
24
## Scenario
25
25
26
26
The console application:
27
27
28
-
- gets a token from Azure AD for itself (without a user)
28
+
- gets a token from Microsoft Entra ID for itself (without a user)
29
29
- and then calls the Microsoft Graph `/users` endpoint to get the list of users, which it then displays on the screen
30
30
31
31

@@ -34,7 +34,7 @@ For more information on the concepts used in this sample, be sure to read the [S
34
34
35
35
- Developers who wish to gain good familiarity of programming with Microsoft Graph are advised to go through the [An introduction to Microsoft Graph for developers](https://www.youtube.com/watch?v=EBbnpFdB92A) recorded session.
36
36
37
-
> ### Daemon applications can use two forms of credentials to authenticate themselves with Azure AD:
37
+
> ### Daemon applications can use two forms of credentials to authenticate themselves with Microsoft Entra ID:
38
38
>
39
39
> -**Client secrets** (also called application password).
40
40
> -**Certificates**.
@@ -51,7 +51,7 @@ To run this sample, you'll need:
51
51
- A Windows machine (necessary if you want to run the app on Windows)
52
52
- An OS X machine (necessary if you want to run the app on Mac)
53
53
- A Linux machine (necessary if you want to run the app on Linux)
54
-
-An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
54
+
-a Microsoft Entra tenant. For more information on how to get a Microsoft Entra tenant, see [How to get a Microsoft Entra tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
55
55
56
56
### Step 1: Clone or download this repository
57
57
@@ -72,13 +72,13 @@ Navigate to the `"1-Call-MSGraph"` folder
72
72
cd"1-Call-MSGraph"
73
73
```
74
74
75
-
### Step 2: Register the sample with your Azure Active Directory tenant
75
+
### Step 2: Register the sample with your Microsoft Entra tenant
76
76
77
77
There is one project in this sample. To register it, you can:
78
78
79
-
- either follow the steps [Step 2: Register the sample with your Azure Active Directory tenant](#step-2-register-the-sample-with-your-azure-active-directory-tenant) and [Step 3: Configure the sample to use your Azure AD tenant](#choose-the-azure-ad-tenant-where-you-want-to-create-your-applications)
79
+
- either follow the steps [Step 2: Register the sample with your Microsoft Entra tenant](#step-2-register-the-sample-with-your-azure-active-directory-tenant) and [Step 3: Configure the sample to use your Microsoft Entra tenant](#choose-the-azure-ad-tenant-where-you-want-to-create-your-applications)
80
80
- or use PowerShell scripts that:
81
-
-**automatically** creates the Azure AD applications and related objects (passwords, permissions, dependencies) for you
81
+
-**automatically** creates the Microsoft Entra applications and related objects (passwords, permissions, dependencies) for you
82
82
- modify the Visual Studio projects' configuration files.
83
83
84
84
If you want to use this automation:
@@ -90,7 +90,7 @@ If you want to use this automation:
90
90
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
91
91
```
92
92
93
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.
93
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly.
94
94
95
95
```PowerShell
96
96
cd AppCreationScripts
@@ -103,13 +103,13 @@ If you want to use this automation:
103
103
104
104
If you don't want to use this automation, follow the steps below
105
105
106
-
#### Choose the Azure AD tenant where you want to create your applications
106
+
#### Choose the Microsoft Entra tenant where you want to create your applications
107
107
108
108
As a first step you'll need to:
109
109
110
-
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
111
-
1. If your account is present in more than one Azure AD tenant, select `Directory + Subscription` at the top right corner in the menu on top of the page, and switch your portal session to the desired Azure AD tenant.
112
-
1. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations**.
110
+
1. Sign in to the [Microsoft Entra admin center](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
111
+
1. If your account is present in more than one Microsoft Entra tenant, select `Directory + Subscription` at the top right corner in the menu on top of the page, and switch your portal session to the desired Microsoft Entra tenant.
112
+
1. In the left-hand navigation pane, select the **Microsoft Entra ID** service, and then select **App registrations**.
113
113
114
114
#### Register the client app (daemon-console)
115
115
@@ -125,7 +125,7 @@ As a first step you'll need to:
125
125
- Select a key duration of either **In 1 year**, **In 2 years**, or **Never Expires**.
126
126
- When you press the **Add** button, the key value will be displayed, copy, and save the value in a safe location.
127
127
- You'll need this key later to configure the project in Visual Studio. This key value will not be displayed again, nor retrievable by any other means,
128
-
so record it as soon as it is visible from the Azure portal.
128
+
so record it as soon as it is visible from the Microsoft Entra admin center.
129
129
1. In the list of pages for the app, select **API permissions**
130
130
- Click the **Add a permission** button and then,
131
131
- Ensure that the **Microsoft APIs** tab is selected
@@ -135,9 +135,9 @@ As a first step you'll need to:
135
135
136
136
1. At this stage permissions are assigned correctly but a daemon client app has no user interaction. Therefore no consent can be presented via a UI when the application is running. So the consent will need to be provided in the portal itself.
137
137
Click the **Grant/revoke admin consent for {tenant}** button, and then select **Yes** when you are asked if you want to grant consent for the requested permission.
138
-
You need to be an Azure AD tenant admin to do this.
138
+
You need to be a Microsoft Entra tenant admin to do this.
139
139
140
-
### Step 3: Configure the sample to use your Azure AD tenant
140
+
### Step 3: Configure the sample to use your Microsoft Entra tenant
141
141
142
142
In the steps below, "ClientID" is the same as "Application ID" or "AppId".
143
143
@@ -148,13 +148,13 @@ Open the solution in Visual Studio to configure the project
148
148
> Note: if you used the setup scripts, the changes below will have been applied for you, with the exception of the national cloud specific steps.
149
149
150
150
1. Open the `daemon-console\appsettings.json` file.
151
-
1. Find the app key `TenantId` and replace the existing value with your Azure AD tenant name.
152
-
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `daemon-console` application copied from the Azure portal.
153
-
1. Find the app key `ClientSecret` and replace the existing value with the key you saved during the creation of the `daemon-console` app, in the Azure portal.
151
+
1. Find the app key `TenantId` and replace the existing value with your Microsoft Entra tenant name.
152
+
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `daemon-console` application copied from the Microsoft Entra admin center.
153
+
1. Find the app key `ClientSecret` and replace the existing value with the key you saved during the creation of the `daemon-console` app, in the Microsoft Entra admin center.
154
154
155
155
##### If you are connecting to a national cloud, then:
156
156
157
-
1. Change the instance to the correct Azure AD endpoint. [See this reference for a list of Azure AD endpoints.](https://docs.microsoft.com/graph/deployments#app-registration-and-token-service-root-endpoints).
157
+
1. Change the instance to the correct Microsoft Entra ID endpoint. [See this reference for a list of Microsoft Entra ID endpoints.](https://docs.microsoft.com/graph/deployments#app-registration-and-token-service-root-endpoints).
158
158
1. open the 'daemon-console\Program.cs' file and change the graph endpoint on lines in which there is a "graph.microsoft.com" reference. [See this reference for more info on which graph endpoint to use.](https://docs.microsoft.com/graph/deployments#microsoft-graph-and-graph-explorer-service-root-endpoints)
159
159
160
160
### Step 4: Run the sample
@@ -265,7 +265,7 @@ Content: {
265
265
266
266
## Variation: daemon application using client credentials with certificates
267
267
268
-
As we had explained earlier, daemon applications can use two types of credentials to authenticate themselves with Azure AD. In the following section we will discuss how to use a certificate instead of a client secret.
268
+
As we had explained earlier, daemon applications can use two types of credentials to authenticate themselves with Microsoft Entra ID. In the following section we will discuss how to use a certificate instead of a client secret.
@@ -286,7 +286,7 @@ If you want to use the automation script:
286
286
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
287
287
```
288
288
289
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.
289
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly.
290
290
291
291
```PowerShell
292
292
.\AppCreationScripts-withCert\Configure.ps1
@@ -310,7 +310,7 @@ To complete this step, you will use the [New-SelfSignedCertificate]((https://doc
310
310
311
311
Alternatively you can use an existing certificate if you have one (just be sure to record its name for the next steps)
312
312
313
-
### Add the certificate for the daemon-console application in Azure AD
313
+
### Add the certificate for the daemon-console application in Microsoft Entra ID
314
314
315
315
In the application registration blade for your application, in the **Certificates & secrets** page, in the **Certificates** section:
316
316
@@ -382,7 +382,7 @@ It's also possible to get certificates from an [Azure Key Vault](https://docs.mi
382
382
383
383
#### Build and run
384
384
385
-
Build and run your project. You have the same output, but this time, your application is authenticated with Azure AD with the certificate instead of the application secret.
385
+
Build and run your project. You have the same output, but this time, your application is authenticated with Microsoft Entra ID with the certificate instead of the application secret.
Copy file name to clipboardexpand all lines: 2-Call-OwnApi/AppCreationScripts/AppCreationScripts.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
### Quick summary
6
6
7
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.
7
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly.
8
8
9
9
```PowerShell
10
10
cd .\AppCreationScripts\
@@ -28,23 +28,23 @@
28
28
29
29
### Presentation of the scripts
30
30
31
-
This sample comes with two PowerShell scripts, which automate the creation of the Azure Active Directory applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
31
+
This sample comes with two PowerShell scripts, which automate the creation of the Microsoft Entra applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
32
32
33
33
These scripts are:
34
34
35
35
-`Configure.ps1` which:
36
-
- creates Azure AD applications and their related objects (permissions, dependencies, secrets, app roles),
36
+
- creates Microsoft Entra applications and their related objects (permissions, dependencies, secrets, app roles),
37
37
- changes the configuration files in the sample projects.
38
-
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Azure AD application it created:
38
+
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Microsoft Entra application it created:
39
39
- the identifier of the application
40
40
- the AppId of the application
41
-
- the url of its registration in the [Azure portal](https://portal.azure.com).
41
+
- the url of its registration in the [Microsoft Entra admin center](https://portal.azure.com).
42
42
43
-
-`Cleanup.ps1` which cleans-up the Azure AD objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, `git reset`).
43
+
-`Cleanup.ps1` which cleans-up the Microsoft Entra objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, `git reset`).
44
44
45
45
### Usage pattern for tests and DevOps scenarios
46
46
47
-
The `Configure.ps1` will stop if it tries to create an Azure AD application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
47
+
The `Configure.ps1` will stop if it tries to create a Microsoft Entra application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
48
48
49
49
## How to use the app creation scripts?
50
50
@@ -107,8 +107,8 @@ Note that the script will choose the tenant in which to create the applications,
107
107
108
108
if you want to create the apps in a particular tenant, you can use the following option:
109
109
110
-
- Open the [Azure portal](https://portal.azure.com)
111
-
- Select the Azure Active directory you are interested in (in the combo-box below your name on the top right of the browser window)
110
+
- Open the [Microsoft Entra admin center](https://portal.azure.com)
111
+
- Select the Microsoft Entra ID you are interested in (in the combo-box below your name on the top right of the browser window)
112
112
- Find the "Active Directory" object in this tenant
113
113
- Go to **Properties** and copy the content of the **Directory Id** property
@@ -25,14 +25,14 @@ The app is a .NET Core console application that gets the list of "ToDos" from `T
25
25
26
26
The console application:
27
27
28
-
- acquires an access token from Azure AD by authenticating as an application (no user interaction)
28
+
- acquires an access token from Microsoft Entra ID by authenticating as an application (no user interaction)
29
29
- and then calls the Web API `TodoList-WebApi` protected using [Microsoft.Identity.Web](https://aka.ms/microsoft-identity-web) to get the a list of ToDo's, and displays the result
30
30
31
31

32
32
33
33
For more information on the concepts used in this sample, be sure to read the [Scenario: Daemon application that calls web APIs](https://docs.microsoft.com/azure/active-directory/develop/scenario-daemon-overview).
34
34
35
-
> ### Daemon applications can use two forms of credentials to authenticate themselves with Azure AD:
35
+
> ### Daemon applications can use two forms of credentials to authenticate themselves with Microsoft Entra ID:
36
36
>
37
37
> -**Client secrets** (also called application password).
38
38
> -**Certificates**.
@@ -49,7 +49,7 @@ To run this sample, you'll need:
49
49
- A Windows machine (necessary if you want to run the app on Windows)
50
50
- An OS X machine (necessary if you want to run the app on Mac)
51
51
- A Linux machine (necessary if you want to run the app on Linux)
52
-
-An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
52
+
-a Microsoft Entra tenant. For more information on how to get a Microsoft Entra tenant, see [How to get a Microsoft Entra tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
53
53
54
54
### Step 1: Clone or download this repository
55
55
@@ -69,13 +69,13 @@ Navigate to the `"2-Call-OwnApi"` folder
69
69
cd"2-Call-OwnApi"
70
70
```
71
71
72
-
### Step 2: Register the sample with your Azure Active Directory tenant
72
+
### Step 2: Register the sample with your Microsoft Entra tenant
73
73
74
74
There is one project in this sample. To register it, you can:
75
75
76
-
- either follow the steps [Step 2: Register the sample with your Azure Active Directory tenant](#step-2-register-the-sample-with-your-azure-active-directory-tenant) and [Step 3: Configure the sample to use your Azure AD tenant](#choose-the-azure-ad-tenant-where-you-want-to-create-your-applications)
76
+
- either follow the steps [Step 2: Register the sample with your Microsoft Entra tenant](#step-2-register-the-sample-with-your-azure-active-directory-tenant) and [Step 3: Configure the sample to use your Microsoft Entra tenant](#choose-the-azure-ad-tenant-where-you-want-to-create-your-applications)
77
77
- or use PowerShell scripts that:
78
-
-**automatically** creates the Azure AD applications and related objects (passwords, permissions, dependencies) for you
78
+
-**automatically** creates the Microsoft Entra applications and related objects (passwords, permissions, dependencies) for you
79
79
- modify the Visual Studio projects' configuration files.
80
80
81
81
If you want to use this automation:
@@ -87,7 +87,7 @@ If you want to use this automation:
87
87
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
88
88
```
89
89
90
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.
90
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly.
91
91
92
92
```PowerShell
93
93
.\AppCreationScripts\Configure.ps1
@@ -99,13 +99,13 @@ If you want to use this automation:
99
99
100
100
If you don't want to use this automation, follow the steps below
101
101
102
-
#### Choose the Azure AD tenant where you want to create your applications
102
+
#### Choose the Microsoft Entra tenant where you want to create your applications
103
103
104
104
As a first step you'll need to:
105
105
106
-
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
107
-
1. If your account is present in more than one Azure AD tenant, select `Directory + Subscription` at the top right corner in the menu on top of the page, and switch your portal session to the desired Azure AD tenant.
108
-
1. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations**.
106
+
1. Sign in to the [Microsoft Entra admin center](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
107
+
1. If your account is present in more than one Microsoft Entra tenant, select `Directory + Subscription` at the top right corner in the menu on top of the page, and switch your portal session to the desired Microsoft Entra tenant.
108
+
1. In the left-hand navigation pane, select the **Microsoft Entra ID** service, and then select **App registrations**.
109
109
110
110
#### Register the service app (TodoList-webapi-daemon-v2)
111
111
@@ -161,7 +161,7 @@ The content of `appRoles` should be the following (the `id` can be any unique **
161
161
- Select a key duration of either **In 1 year**, **In 2 years**, or **Never Expires**.
162
162
- When you press the **Add** button, the key value will be displayed, copy, and save the value in a safe location.
163
163
- You'll need this key later to configure the project in Visual Studio. This key value will not be displayed again, nor retrievable by any other means,
164
-
so record it as soon as it is visible from the Azure portal.
164
+
so record it as soon as it is visible from the Microsoft Entra admin center.
165
165
1. In the list of pages for the app, select **API permissions**
166
166
- Click the **Add a permission** button and then,
167
167
- Ensure that the **My APIs** tab is selected
@@ -172,9 +172,9 @@ The content of `appRoles` should be the following (the `id` can be any unique **
172
172
Therefore no consent can be presented via a UI and accepted to use the service app.
173
173
Click the **Grant/revoke admin consent for {tenant}** button, and then select **Yes** when you are asked if you want to grant consent for the
174
174
requested permissions for all account in the tenant.
175
-
You need to be an Azure AD tenant admin to do this.
175
+
You need to be a Microsoft Entra tenant admin to do this.
176
176
177
-
### Step 3: Configure the sample to use your Azure AD tenant
177
+
### Step 3: Configure the sample to use your Microsoft Entra tenant
178
178
179
179
In the steps below, "ClientID" is the same as "Application ID" or "AppId".
180
180
@@ -185,17 +185,17 @@ Open the solution in Visual Studio to configure the projects
185
185
> Note: if you used the setup scripts, the changes below will have been applied for you
186
186
187
187
1. Open the `TodoList-WebApi\appsettings.json` file
188
-
1. Find the app key `Domain` and replace the existing value with your Azure AD tenant name.
189
-
1. Find the app key `TenantId` and replace the existing value with your Azure AD tenant ID.
190
-
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `TodoList-webapi-daemon-v2` application copied from the Azure portal.
188
+
1. Find the app key `Domain` and replace the existing value with your Microsoft Entra tenant name.
189
+
1. Find the app key `TenantId` and replace the existing value with your Microsoft Entra tenant ID.
190
+
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `TodoList-webapi-daemon-v2` application copied from the Microsoft Entra admin center.
191
191
192
192
#### Configure the client project
193
193
194
194
1. Open the `Daemon-Console\appsettings.json` file
195
-
1. If you are connecting to a national cloud, change the instance to the correct Azure AD endpoint. [See this reference for a list of Azure AD endpoints.](https://docs.microsoft.com/graph/deployments#app-registration-and-token-service-root-endpoints)
196
-
1. Find the app key `Tenant` and replace the existing value with your Azure AD tenant name.
197
-
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `daemon-console-v2` application copied from the Azure portal.
198
-
1. Find the app key `ClientSecret` and replace the existing value with the key you saved during the creation of the `daemon-console-v2` app, in the Azure portal.
195
+
1. If you are connecting to a national cloud, change the instance to the correct Microsoft Entra ID endpoint. [See this reference for a list of Microsoft Entra ID endpoints.](https://docs.microsoft.com/graph/deployments#app-registration-and-token-service-root-endpoints)
196
+
1. Find the app key `Tenant` and replace the existing value with your Microsoft Entra tenant name.
197
+
1. Find the app key `ClientId` and replace the existing value with the application ID (clientId) of the `daemon-console-v2` application copied from the Microsoft Entra admin center.
198
+
1. Find the app key `ClientSecret` and replace the existing value with the key you saved during the creation of the `daemon-console-v2` app, in the Microsoft Entra admin center.
199
199
1. Find the app key `TodoListBaseAddress` and set to `https://localhost:44372`
200
200
1. Find the app key `TodoListScope` and replace the existing value with the **App ID URI** of your web API, followed by "/.default".
201
201
@@ -246,7 +246,7 @@ The relevant code for this sample is in the `Program.cs` file:
246
246
{
247
247
"AzureAd": {
248
248
"Instance": "https://login.microsoftonline.com/",
249
-
"TenantId": "[Enter here the tenantID or domain name for your Azure AD tenant]",
249
+
"TenantId": "[Enter here the tenantID or domain name for your Microsoft Entra tenant]",
250
250
"ClientId": "[Enter here the ClientId for your application]",
251
251
"ClientCredentials": [
252
252
{
@@ -298,7 +298,7 @@ The relevant code for the Web API is in the `Startup.cs` class. We are using the
Copy file name to clipboardexpand all lines: 3-Using-KeyVault/README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ You'll need:
25
25
- A Windows machine (necessary if you want to run the app on Windows)
26
26
- An OS X machine (necessary if you want to run the app on Mac)
27
27
- A Linux machine (necessary if you want to run the app on Linux)
28
-
-An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
28
+
-a Microsoft Entra tenant. For more information on how to get a Microsoft Entra tenant, see [How to get a Microsoft Entra tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
29
29
30
30
### Step 1: Clone or download this repository
31
31
@@ -47,7 +47,7 @@ In this step you'll need to create a Key Vault on your Azure tenant and then cre
47
47
48
48
You can find the instructions for creating a Key Vault [here](https://docs.microsoft.com/azure/key-vault/general/quick-create-portal).
49
49
50
-
After the Key Vault is created [upload your own certificate or create a new certificate entirely](https://docs.microsoft.com/azure/key-vault/certificates/tutorial-import-certificate) and store it in the Key Vault. To generate a certificate in the Azure portal select **Generate** as the **Method of Certificate Creation** instead of **Import** and fill in the configuration as appropriate.
50
+
After the Key Vault is created [upload your own certificate or create a new certificate entirely](https://docs.microsoft.com/azure/key-vault/certificates/tutorial-import-certificate) and store it in the Key Vault. To generate a certificate in the Microsoft Entra admin center select **Generate** as the **Method of Certificate Creation** instead of **Import** and fill in the configuration as appropriate.
51
51
52
52
If you create a new certificate you should download a **CER** format copy of the certificate. You'll need it to [register the certificate with your application](https://docs.microsoft.com/azure/active-directory/develop/quickstart-register-app#add-credentials).
53
53
@@ -99,17 +99,17 @@ Cloud applications and services use cryptographic keys and secrets to help keep
99
99
100
100
### About Managed Identities for Azure Resources
101
101
102
-
Azure Key Vault provides a way to securely store credentials, secrets, and other keys, but your code has to authenticate to Key Vault to retrieve them. The [managed identities for Azure resources](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) feature in Azure Active Directory (Azure AD) solves this problem. The feature provides Azure services with an automatically managed identity in Azure AD. You can use the identity to authenticate to any service that supports Azure AD authentication, including Key Vault, without any credentials in your code.
102
+
Azure Key Vault provides a way to securely store credentials, secrets, and other keys, but your code has to authenticate to Key Vault to retrieve them. The [managed identities for Azure resources](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) feature in Microsoft Entra ID solves this problem. The feature provides Azure services with an automatically managed identity in Microsoft Entra ID. You can use the identity to authenticate to any service that supports Microsoft Entra authentication, including Key Vault, without any credentials in your code.
103
103
104
104
In a daemon application scenario, Managed Identity will work if you have it deployed it in an [Azure Virtual Machine](https://azure.microsoft.com/services/virtual-machines/) or [Azure Web Job](https://docs.microsoft.com/azure/app-service/webjobs-create). Please, read [this documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) to understand how Managed Identity works with an Azure VM.
105
105
106
106
#### Configure Managed identity on Azure VM to access Key Vault
107
107
108
108
To authenticate to Key Vault using your Azure VM, you must first grant it permissions to Key Vault using the **Key Vault Access Policies**. To do that, follow the steps:
109
109
110
-
1. On Azure Portal, note the name of the Azure VM where you deployed the daemon application.
110
+
1. On Microsoft Entra admin center, note the name of the Azure VM where you deployed the daemon application.
111
111
1.[Enable managed identity on the virtual machine](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
112
-
1. On Azure Portal, navigate to **Key Vaults** and select the one that you want the daemon application's VM to access.
112
+
1. On Microsoft Entra admin center, navigate to **Key Vaults** and select the one that you want the daemon application's VM to access.
113
113
1. Then click on **Access policies** menu and click on **+Add Access Policy**.
114
114
1. Select an adequate template from the dropdown "Configure from template" (ie "Secret & Certificate Management") or set the permissions manually (this sample requires the permission **GET** for Secret and Certificate to be checked).
115
115
1. For **Select principal**, search for the Azure VM *name* or *ObjectId*, select it and click on **Select** button.
Copy file name to clipboardexpand all lines: 4-Call-OwnApi-Pop/AppCreationScripts-withCert/AppCreationScripts.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
```PowerShell
10
10
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
11
11
```
12
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly. (Other ways of running the scripts are described below)
12
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly. (Other ways of running the scripts are described below)
13
13
```PowerShell
14
14
.\AppCreationScripts\Configure.ps1
15
15
```
@@ -31,23 +31,23 @@ The following paragraphs:
31
31
32
32
### Presentation of the scripts
33
33
34
-
This sample comes with two PowerShell scripts, which automate the creation of the Azure Active Directory applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
34
+
This sample comes with two PowerShell scripts, which automate the creation of the Microsoft Entra applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
35
35
36
36
These scripts are:
37
37
38
38
-`Configure.ps1` which:
39
-
- creates Azure AD applications and their related objects (permissions, dependencies, secrets),
39
+
- creates Microsoft Entra applications and their related objects (permissions, dependencies, secrets),
40
40
- changes the configuration files in the C# and JavaScript projects.
41
-
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Azure AD application it created:
41
+
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Microsoft Entra application it created:
42
42
- the identifier of the application
43
43
- the AppId of the application
44
-
- the url of its registration in the [Azure portal](https://portal.azure.com).
44
+
- the url of its registration in the [Microsoft Entra admin center](https://portal.azure.com).
45
45
46
-
-`Cleanup.ps1` which cleans-up the Azure AD objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, git reset).
46
+
-`Cleanup.ps1` which cleans-up the Microsoft Entra objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, git reset).
47
47
48
48
### Usage pattern for tests and DevOps scenarios
49
49
50
-
The `Configure.ps1` will stop if it tries to create an Azure AD application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
50
+
The `Configure.ps1` will stop if it tries to create a Microsoft Entra application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
51
51
52
52
## How to use the app creation scripts ?
53
53
@@ -121,8 +121,8 @@ Of course, in real life, you might already get the password as a `SecureString`.
121
121
#### Option 3 (Interactive, but create apps in a specified tenant)
122
122
123
123
if you want to create the apps in a particular tenant, you can use the following option:
124
-
- open the [Azure portal](https://portal.azure.com)
125
-
- Select the Azure Active directory you are interested in (in the combo-box below your name on the top right of the browser window)
124
+
- open the [Microsoft Entra admin center](https://portal.azure.com)
125
+
- Select the Microsoft Entra ID you are interested in (in the combo-box below your name on the top right of the browser window)
126
126
- Find the "Active Directory" object in this tenant
127
127
- Go to **Properties** and copy the content of the **Directory Id** property
Copy file name to clipboardexpand all lines: 4-Call-OwnApi-Pop/AppCreationScripts/AppCreationScripts.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
```PowerShell
10
10
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
11
11
```
12
-
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly. (Other ways of running the scripts are described below)
12
+
1. Run the script to create your Microsoft Entra application and configure the code of the sample application accordingly. (Other ways of running the scripts are described below)
13
13
```PowerShell
14
14
.\AppCreationScripts\Configure.ps1
15
15
```
@@ -31,23 +31,23 @@ The following paragraphs:
31
31
32
32
### Presentation of the scripts
33
33
34
-
This sample comes with two PowerShell scripts, which automate the creation of the Azure Active Directory applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
34
+
This sample comes with two PowerShell scripts, which automate the creation of the Microsoft Entra applications, and the configuration of the code for this sample. Once you run them, you will only need to build the solution and you are good to test.
35
35
36
36
These scripts are:
37
37
38
38
-`Configure.ps1` which:
39
-
- creates Azure AD applications and their related objects (permissions, dependencies, secrets),
39
+
- creates Microsoft Entra applications and their related objects (permissions, dependencies, secrets),
40
40
- changes the configuration files in the C# and JavaScript projects.
41
-
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Azure AD application it created:
41
+
- creates a summary file named `createdApps.html` in the folder from which you ran the script, and containing, for each Microsoft Entra application it created:
42
42
- the identifier of the application
43
43
- the AppId of the application
44
-
- the url of its registration in the [Azure portal](https://portal.azure.com).
44
+
- the url of its registration in the [Microsoft Entra admin center](https://portal.azure.com).
45
45
46
-
-`Cleanup.ps1` which cleans-up the Azure AD objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, git reset).
46
+
-`Cleanup.ps1` which cleans-up the Microsoft Entra objects created by `Configure.ps1`. Note that this script does not revert the changes done in the configuration files, though. You will need to undo the change from source control (from Visual Studio, or from the command line using, for instance, git reset).
47
47
48
48
### Usage pattern for tests and DevOps scenarios
49
49
50
-
The `Configure.ps1` will stop if it tries to create an Azure AD application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
50
+
The `Configure.ps1` will stop if it tries to create a Microsoft Entra application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
51
51
52
52
## How to use the app creation scripts ?
53
53
@@ -121,8 +121,8 @@ Of course, in real life, you might already get the password as a `SecureString`.
121
121
#### Option 3 (Interactive, but create apps in a specified tenant)
122
122
123
123
if you want to create the apps in a particular tenant, you can use the following option:
124
-
- open the [Azure portal](https://portal.azure.com)
125
-
- Select the Azure Active directory you are interested in (in the combo-box below your name on the top right of the browser window)
124
+
- open the [Microsoft Entra admin center](https://portal.azure.com)
125
+
- Select the Microsoft Entra ID you are interested in (in the combo-box below your name on the top right of the browser window)
126
126
- Find the "Active Directory" object in this tenant
127
127
- Go to **Properties** and copy the content of the **Directory Id** property
This library contains a set of reusable classes useful in ASP.NET Core:
6
6
7
7
-[Web applications](#web-apps) that sign in users, and, optionally, call web APIs
8
8
-[Protected web APIs](#web-apis), which, optionally call downstream web APIs
9
9
10
-
to enable them to work with the Microsoft identity platform (formerly named Azure AD v2.0 endpoint). In the library, web apps and protected web APIs are collectively referred to as web resources.
10
+
to enable them to work with the Microsoft identity platform (formerly named Microsoft Entra ID v2.0 endpoint). In the library, web apps and protected web APIs are collectively referred to as web resources.
11
11
12
12
## Web apps
13
13
14
-
As of today, ASP.NET Core web apps templates (`dot net new mvc -auth`) create web apps that sign in users with the Azure AD v1.0 endpoint (allowing to sign in users with their organizational accounts, also named *Work or school accounts*). This library brings `ServiceCollection` extension methods to be used in the ASP.NET Core web app **Startup.cs** file to enable the web app to sign in users with the Microsoft identity platform (formerly Azure AD v2.0 endpoint), and, optionally enable the web app to call APIs on behalf of the signed-in user.
14
+
As of today, ASP.NET Core web apps templates (`dot net new mvc -auth`) create web apps that sign in users with the Microsoft Entra ID v1.0 endpoint (allowing to sign in users with their organizational accounts, also named *Work or school accounts*). This library brings `ServiceCollection` extension methods to be used in the ASP.NET Core web app **Startup.cs** file to enable the web app to sign in users with the Microsoft identity platform (formerly Microsoft Entra ID v2.0 endpoint), and, optionally enable the web app to call APIs on behalf of the signed-in user.
This method adds authentication with the Microsoft Identity platform (formerly Azure AD v2.0). This includes validating the token in all scenarios (single tenant application, multi tenant applications) in Azure public cloud as well as national clouds.
57
+
This method adds authentication with the Microsoft Identity platform (formerly Microsoft Entra ID v2.0). This includes validating the token in all scenarios (single tenant application, multi tenant applications) in Azure public cloud as well as national clouds.
@@ -40,8 +40,8 @@ To run this sample, you'll need:
40
40
- A Windows machine (necessary if you want to run the app on Windows)
41
41
- An OS X machine (necessary if you want to run the app on Mac)
42
42
- A Linux machine (necessary if you want to run the app on Linux)
43
-
-An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
44
-
- A user account in your Azure AD tenant. This sample will not work with a Microsoft account (formerly Windows Live account). Therefore, if you signed in to the [Azure portal](https://portal.azure.com) with a Microsoft account and have never created a user account in your directory before, you need to do that now.
43
+
-a Microsoft Entra tenant. For more information on how to get a Microsoft Entra tenant, see [How to get a Microsoft Entra tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
44
+
- A user account in your Microsoft Entra tenant. This sample will not work with a Microsoft account (formerly Windows Live account). Therefore, if you signed in to the [Microsoft Entra admin center](https://portal.azure.com) with a Microsoft account and have never created a user account in your directory before, you need to do that now.
0 commit comments