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
-[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)
24
+
-[Option 2 (Interactive, but create apps in a specified tenant)](#option-3-Interactive-but-create-apps-in-a-specified-tenant)
34
25
-[Running the script on Azure Sovereign clouds](#running-the-script-on-Azure-Sovereign-clouds)
35
26
36
27
## Goal of the provided scripts
@@ -42,7 +33,7 @@ This sample comes with two PowerShell scripts, which automate the creation of th
42
33
These scripts are:
43
34
44
35
-`Configure.ps1` which:
45
-
- creates Azure AD applications and their related objects (permissions, dependencies, secrets),
36
+
- creates Azure AD applications and their related objects (permissions, dependencies, secrets, app roles),
46
37
- changes the configuration files in the sample projects.
47
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:
48
39
- the identifier of the application
@@ -51,6 +42,8 @@ These scripts are:
51
42
52
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`).
53
44
45
+
> :information_source: If the sample supports using certificates instead of client secrets, this folder will contain an additional set of scripts: `Configure-WithCertificates.ps1` and `Cleanup-WithCertificates.ps1`. You can use them in the same way to register app(s) that use certificates instead of client secrets.
46
+
54
47
### Usage pattern for tests and DevOps scenarios
55
48
56
49
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.
@@ -59,31 +52,26 @@ The `Configure.ps1` will stop if it tries to create an Azure AD application whic
59
52
60
53
### Pre-requisites
61
54
55
+
1. PowerShell 7 or later (see: [installing PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell))
62
56
1. Open PowerShell (On Windows, press `Windows-R` and type `PowerShell` in the search window)
63
-
1. Navigate to the root directory of the project.
64
-
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:
65
57
66
-
```PowerShell
67
-
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:
60
+
The scripts install the required PowerShell module (Microsoft.Graph.Applications) 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:
73
61
74
-
1. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
62
+
1. If you have never done it already, in the PowerShell window, install the Microsoft.Graph.Applications PowerShell modules. For this:
75
63
76
-
1. Open PowerShell as admin (On Windows, Search Powershell in the search bar, right click on it and select **Run as administrator**).
64
+
1. Open PowerShell
77
65
2. Type:
78
66
79
67
```PowerShell
80
-
Install-Module AzureAD
68
+
Install-Module Microsoft.Graph.Applications
81
69
```
82
70
83
-
or if you cannot be administrator on your machine, run:
71
+
or if you want the modules to be installed for the current user only, run:
@@ -100,14 +88,12 @@ The scripts install the required PowerShell module (AzureAD) for the current use
100
88
101
89
You're done!
102
90
103
-
### Four ways to run the script
91
+
### Two ways to run the script
104
92
105
93
We advise four ways of running the script:
106
94
107
95
- Interactive: you will be prompted for credentials, and the scripts decide in which tenant to create the objects,
108
-
- non-interactive: you will provide credentials, and the scripts decide in which tenant to create the objects,
109
96
- 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.
111
97
112
98
Here are the details on how to do this.
113
99
@@ -118,20 +104,7 @@ Here are the details on how to do this.
118
104
119
105
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.
120
106
121
-
#### Option 2 (non-interactive)
122
-
123
-
When you know the identity and credentials of the user in the name of whom you want to create the applications, you can use the non-interactive approach. It's more adapted to DevOps. Here is an example of script you'd want to run in a PowerShell Window
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`.
@@ -168,11 +129,10 @@ The acceptable values for this parameter are:
0 commit comments