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: .github/ISSUE_TEMPLATE.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,10 @@ Please add an 'x' for the scenario(s) where you found an issue
27
27
1.[ ] With specific token caches: [2-WebApp-graph-user/2-2-TokenCache](../blob/master/2-WebApp-graph-user/2-2-TokenCache)
28
28
1.[ ] Calling Microsoft Graph in national clouds: [2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph](../blob/master/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph)
29
29
1.[ ] Web app calling several APIs [3-WebApp-multi-APIs](../blob/master/3-WebApp-multi-APIs)
30
-
1.[ ] Web app calling your own Web API [4-WebApp-your-API](../blob/master/4-WebApp-your-API)
30
+
1.[ ] Web app calling your own Web API
31
+
1.[ ] with a work and school account in your organization: [4-WebApp-your-API/4-1-MyOrg](../blob/master/4-WebApp-your-API/4-1-MyOrg)
32
+
1.[ ] with B2C users: [4-WebApp-your-API/4-2-B2C](../blob/master/4-WebApp-your-API/4-2-B2C)
33
+
1.[ ] with any work and school account: [4-WebApp-your-API/4-3-AnyOrg](../blob/master/4-WebApp-your-API/4-3-AnyOrg)
31
34
1. Web app restricting users
32
35
1.[ ] by Roles: [5-WebApp-AuthZ/5-1-Roles](../blob/master/5-WebApp-AuthZ/5-1-Roles)
33
36
1.[ ] by Groups: [5-WebApp-AuthZ/5-2-Groups](../blob/master/5-WebApp-AuthZ/5-2-Groups)
Copy file name to clipboardExpand all lines: 5-WebApp-AuthZ/5-2-Groups/AppCreationScripts/AppCreationScripts.md
+40-20Lines changed: 40 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,47 @@
1
-
# Registering the sample apps with Microsoft identity platform and updating the configuration files using PowerShell scripts
1
+
# Registering the sample apps with the Microsoft identity platform and updating the configuration files using PowerShell
2
2
3
3
## Overview
4
4
5
5
### Quick summary
6
6
7
-
1. On Windows run PowerShell and navigate to the root of the cloned directory
7
+
1. On Windows run PowerShell as **Administrator**and navigate to the root of the cloned directory
8
8
1. In PowerShell run:
9
+
9
10
```PowerShell
10
11
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
11
12
```
13
+
12
14
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)
15
+
13
16
```PowerShell
14
17
cd .\AppCreationScripts\
15
18
.\Configure.ps1
16
19
```
20
+
17
21
1. Open the Visual Studio solution and click start
18
22
19
23
### More details
20
24
21
25
The following paragraphs:
22
26
23
-
-[Present the scripts](#presentation-of-the-scripts) and explain their [usage patterns](#usage-pattern-for-tests-and-devops-scenarios) for test and DevOps scenarios.
24
-
- Explain the [pre-requisites](#pre-requisites)
25
-
- Explain [four ways of running the scripts](#four-ways-to-run-the-script):
26
-
-[Interactively](#option-1-interactive) to create the app in your home tenant
27
-
-[Passing credentials](#option-2-non-interactive) to create the app in your home tenant
28
-
-[Interactively in a specific tenant](#option-3-interactive-but-create-apps-in-a-specified-tenant)
29
-
-[Passing credentials in a specific tenant](#option-4-non-interactive-and-create-apps-in-a-specified-tenant)
30
-
-[Passing environment name, for Sovereign clouds](#running-the-script-on-azure-sovereign-clouds)
31
-
32
-
## Goal of the scripts
27
+
-[Registering the sample apps with the Microsoft identity platform and updating the configuration files using PowerShell](#Registering-the-sample-apps-with-the-Microsoft-identity-platform-and-updating-the-configuration-files-using-PowerShell)
28
+
-[Overview](#Overview)
29
+
-[Quick summary](#Quick-summary)
30
+
-[More details](#More-details)
31
+
-[Goal of the provided scripts](#Goal-of-the-provided-scripts)
32
+
-[Presentation of the scripts](#Presentation-of-the-scripts)
33
+
-[Usage pattern for tests and DevOps scenarios](#Usage-pattern-for-tests-and-DevOps-scenarios)
34
+
-[How to use the app creation scripts?](#How-to-use-the-app-creation-scripts)
35
+
-[Pre-requisites](#Pre-requisites)
36
+
-[Run the script and start running](#Run-the-script-and-start-running)
37
+
-[Four ways to run the script](#Four-ways-to-run-the-script)
-[Option 3 (Interactive, but create apps in a specified tenant)](#Option-3-Interactive-but-create-apps-in-a-specified-tenant)
41
+
-[Option 4 (non-interactive, and create apps in a specified tenant)](#Option-4-non-interactive-and-create-apps-in-a-specified-tenant)
42
+
-[Running the script on Azure Sovereign clouds](#Running-the-script-on-Azure-Sovereign-clouds)
43
+
44
+
## Goal of the provided scripts
33
45
34
46
### Presentation of the scripts
35
47
@@ -56,36 +68,43 @@ The `Configure.ps1` will stop if it tries to create an Azure AD application whic
56
68
### Pre-requisites
57
69
58
70
1. Open PowerShell (On Windows, press `Windows-R` and type `PowerShell` in the search window)
59
-
2. Navigate to the root directory of the project.
60
-
3. Until you change it, the default [Execution Policy](https:/go.microsoft.com/fwlink/?LinkID=135170) for scripts is usually `Restricted`. In order to run the PowerShell script you need to set the Execution Policy to `RemoteSigned`. You can set this just for the current PowerShell process by running the command:
71
+
1. Navigate to the root directory of the project.
72
+
1. Until you change it, the default [Execution Policy](https:/go.microsoft.com/fwlink/?LinkID=135170) for scripts is usually `Restricted`. In order to run the PowerShell script you need to set the Execution Policy to `RemoteSigned`. You can set this just for the current PowerShell process by running the command:
73
+
61
74
```PowerShell
62
75
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
The scripts install the required PowerShell module (AzureAD) for the current user if needed. However, if you want to install if for all users on the machine, you can follow the following steps:
66
81
67
-
4. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
82
+
1. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
68
83
69
84
1. Open PowerShell as admin (On Windows, Search Powershell in the search bar, right click on it and select Run as administrator).
70
85
2. Type:
86
+
71
87
```PowerShell
72
88
Install-Module AzureAD
73
89
```
74
90
75
91
or if you cannot be administrator on your machine, run:
92
+
76
93
```PowerShell
77
94
Install-Module AzureAD -Scope CurrentUser
78
95
```
79
96
80
97
### Run the script and start running
81
98
82
-
5. Go to the `AppCreationScripts` sub-folder. From the folder where you cloned the repo,
99
+
1. Go to the `AppCreationScripts` sub-folder. From the folder where you cloned the repo,
100
+
83
101
```PowerShell
84
102
cd AppCreationScripts
85
103
```
86
-
6. Run the scripts. See below for the [four options](#four-ways-to-run-the-script) to do that.
87
-
7. Open the Visual Studio solution, and in the solution's context menu, choose **Set Startup Projects**.
88
-
8. select **Start** for the projects
104
+
105
+
1. Run the scripts. See below for the [four options](#four-ways-to-run-the-script) to do that.
106
+
1. Open the Visual Studio solution, and in the solution's context menu, choose **Set Startup Projects**.
107
+
1. select **Start** for the projects
89
108
90
109
You're done. this just works!
91
110
@@ -123,6 +142,7 @@ Of course, in real life, you might already get the password as a `SecureString`.
123
142
#### Option 3 (Interactive, but create apps in a specified tenant)
124
143
125
144
if you want to create the apps in a particular tenant, you can use the following option:
145
+
126
146
- open the [Azure portal](https://portal.azure.com)
127
147
- Select the Azure Active directory you are interested in (in the combo-box below your name on the top right of the browser window)
128
148
- Find the "Active Directory" object in this tenant
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
252
+
Write-Host"IMPORTANT: Please follow the instructions below to complete a few manual step(s) in the Azure portal":
253
+
Write-Host"- For 'webApp'"
254
+
Write-Host" - Navigate to '$webAppPortalUrl'"
255
+
Write-Host" - Navigate to the API Permissions page and select 'Grant admin consent for (your tenant)'"-ForegroundColor Red
256
+
Write-Host" - On Azure Portal, create a security group named GroupAdmin, assign some users to it, and configure your ID and Access token to emit GroupID in your app registration. Configure the value for 'GroupAdmin' key in appsettings.json."-ForegroundColor Red
257
+
Write-Host" - On Azure Portal, create a security group named GroupMember, assign some users to it, and configure your ID and Access token to emit GroupID in your app registration. Configure the value for 'GroupMember' key in appsettings.json."-ForegroundColor Red
258
+
259
+
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
"Comment": "Navigate to the API Permissions page and select 'Grant admin consent for (your tenant)'"
34
+
},
35
+
{
36
+
"Comment": "On Azure Portal, create a security group named GroupAdmin, assign some users to it, and configure your ID and Access token to emit GroupID in your app registration. Configure the value for 'GroupAdmin' key in appsettings.json."
37
+
},
38
+
{
39
+
"Comment": "On Azure Portal, create a security group named GroupMember, assign some users to it, and configure your ID and Access token to emit GroupID in your app registration. Configure the value for 'GroupMember' key in appsettings.json."
0 commit comments