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-Authentication/1-sign-in/AppCreationScripts/AppCreationScripts.md
+27-35Lines changed: 27 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,45 +1,37 @@
1
-
# Registering the sample apps with the Microsoft identity platform and updating the configuration files using PowerShell
1
+
# Registering 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 as **Administrator** 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
10
```PowerShell
11
11
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
12
12
```
13
13
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)
14
+
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.
15
15
16
16
```PowerShell
17
17
cd .\AppCreationScripts\
18
18
.\Configure.ps1
19
19
```
20
20
21
-
1. Open the Visual Studio solution and click start
22
-
23
21
### More details
24
22
25
-
The following paragraphs:
26
-
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)
33
+
-[Option 4 (non-interactive, and create apps in a specified tenant)](#option-4-non-interactive-and-create-apps-in-a-specified-tenant)
34
+
-[Running the script on Azure Sovereign clouds](#running-the-script-on-Azure-Sovereign-clouds)
43
35
44
36
## Goal of the provided scripts
45
37
@@ -51,13 +43,13 @@ These scripts are:
51
43
52
44
-`Configure.ps1` which:
53
45
- creates Azure AD applications and their related objects (permissions, dependencies, secrets),
54
-
- changes the configuration files in the C# and JavaScript projects.
46
+
- changes the configuration files in the sample projects.
55
47
- 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:
56
48
- the identifier of the application
57
49
- the AppId of the application
58
50
- the url of its registration in the [Azure portal](https://portal.azure.com).
59
51
60
-
-`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).
52
+
-`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`).
61
53
62
54
### Usage pattern for tests and DevOps scenarios
63
55
@@ -81,15 +73,15 @@ The scripts install the required PowerShell module (AzureAD) for the current use
81
73
82
74
1. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
83
75
84
-
1. Open PowerShell as admin (On Windows, Search Powershell in the search bar, right click on it and select Run as administrator).
76
+
1. Open PowerShell as admin (On Windows, Search Powershell in the search bar, right click on it and select **Run as administrator**).
85
77
2. Type:
86
-
78
+
87
79
```PowerShell
88
80
Install-Module AzureAD
89
81
```
90
82
91
83
or if you cannot be administrator on your machine, run:
92
-
84
+
93
85
```PowerShell
94
86
Install-Module AzureAD -Scope CurrentUser
95
87
```
@@ -106,22 +98,22 @@ The scripts install the required PowerShell module (AzureAD) for the current use
106
98
1. Open the Visual Studio solution, and in the solution's context menu, choose **Set Startup Projects**.
107
99
1. select **Start** for the projects
108
100
109
-
You're done. this just works!
101
+
You're done!
110
102
111
103
### Four ways to run the script
112
104
113
105
We advise four ways of running the script:
114
106
115
107
- Interactive: you will be prompted for credentials, and the scripts decide in which tenant to create the objects,
116
108
- non-interactive: you will provide credentials, and the scripts decide in which tenant to create the objects,
117
-
- Interactive in specific tenant: you will provide the tenant in which you want to create the objects and then you will be prompted for credentials, and the scripts will create the objects,
118
-
- non-interactive in specific tenant: you will provide tenant in which you want to create the objects and credentials, and the scripts will create the objects.
109
+
- Interactive in specific tenant: you will provide the tenant in which you want to create the objects and then you will be prompted for credentials, and the scripts will create the objects,
110
+
- non-interactive in specific tenant: you will provide the tenant in which you want to create the objects and credentials, and the scripts will create the objects.
119
111
120
112
Here are the details on how to do this.
121
113
122
114
#### Option 1 (interactive)
123
115
124
-
- Just run ``. .\Configure.ps1``, and you will be prompted to sign-in (email address, password, and if needed MFA).
116
+
- Just run ``.\Configure.ps1``, and you will be prompted to sign-in (email address, password, and if needed MFA).
125
117
- The script will be run as the signed-in user and will use the tenant in which the user is defined.
126
118
127
119
Note that the script will choose the tenant in which to create the applications, based on the user. Also to run the `Cleanup.ps1` script, you will need to re-sign-in.
All the four options listed above, can be used on any Azure Sovereign clouds. By default, the script targets `AzureCloud`, but it can be changed using the parameter `-AzureEnvironmentName`.
164
+
All the four options listed above can be used on any Azure Sovereign clouds. By default, the script targets `AzureCloud`, but it can be changed using the parameter `-AzureEnvironmentName`.
Write-Host"Unable to remove ServicePrincipal 'msal-node-webapp' . Try deleting manually from Enterprise applications."-ForegroundColor White -BackgroundColor Red
0 commit comments