Skip to content

Commit e473d34

Browse files
author
Kalyan Krishna
committed
ready for review
1 parent ca20746 commit e473d34

File tree

11 files changed

+493
-94
lines changed

11 files changed

+493
-94
lines changed

AppCreationScripts/AppCreationScripts.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Registering the Azure Active Directory applications and updating the configuration files for this sample using PowerShell scripts
22

3+
## Overview
4+
5+
### Quick summary
6+
7+
1. On Windows run PowerShell and navigate to the root of the cloned directory
8+
1. In PowerShell run:
9+
```PowerShell
10+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
11+
```
12+
1. Run the script to create your Azure AD application and configure the code of the sample application accordinly. (Other ways of running the scripts are described below)
13+
```PowerShell
14+
.\AppCreationScripts\Configure.ps1
15+
```
16+
1. Open the Visual Studio solution and click start
17+
18+
### More details
19+
20+
The following paragraphs:
21+
22+
- [Present the scripts](#presentation-of-the-scripts) and explain their [usage patterns](#usage-pattern-for-tests-and-devops-scenarios) for test and DevOps scenarios.
23+
- Explain the [pre-requisites](#pre-requisites)
24+
- Explain [four ways of running the scripts](#four-ways-to-run-the-script):
25+
- [Interactively](#option-1-interactive) to create the app in your home tenant
26+
- [Passing credentials](#option-2-non-interactive) to create the app in your home tenant
27+
- [Interactively in a specific tenant](#option-3-interactive-but-create-apps-in-a-specified-tenant)
28+
- [Passing credentials in a specific tenant](#option-4-non-interactive-and-create-apps-in-a-specified-tenant)
29+
330
## Goal of the scripts
431

532
### Presentation of the scripts
@@ -26,21 +53,30 @@ The `Configure.ps1` will stop if it tries to create an Azure AD application whic
2653

2754
### Pre-requisites
2855

29-
To use the app creation scripts:
30-
3156
1. Open PowerShell (On Windows, press `Windows-R` and type `PowerShell` in the search window)
3257
2. Navigate to the root directory of the project.
33-
3. Until you change it, the default Execution Policy for scripts is usually `Restricted`. In order to run the PowerShell script you need to set the Execution Policy to `Unrestricted`. You can set this just for the current PowerShell process by running the command:
58+
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:
3459
```PowerShell
35-
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted
60+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
3661
```
62+
### (Optionally) install AzureAD PowerShell modules
63+
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:
64+
3765
4. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
3866
3967
1. Open PowerShell as admin (On Windows, Search Powershell in the search bar, right click on it and select Run as administrator).
4068
2. Type:
41-
```PowerShell
42-
Install-Module AzureAD
43-
```
69+
```PowerShell
70+
Install-Module AzureAD
71+
```
72+
73+
or if you cannot be administrator on your machine, run:
74+
```PowerShell
75+
Install-Module AzureAD -Scope CurrentUser
76+
```
77+
78+
### Run the script and start running
79+
4480
5. Go to the `AppCreationScripts` sub-folder. From the folder where you cloned the repo,
4581
```PowerShell
4682
cd AppCreationScripts
@@ -56,9 +92,9 @@ You're done. this just works!
5692
We advise four ways of running the script:
5793
5894
- Interactive: you will be prompted for credentials, and the scripts decide in which tenant to create the objects,
59-
- non-interactive: you will provide crendentials, and the scripts decide in which tenant to create the objects,
60-
- Interactive in specific tenant: you will be prompted for credentials, and the scripts decide in which tenant to create the objects,
61-
- non-interactive in specific tenant: you will provide crendentials, and the scripts decide in which tenant to create the objects.
95+
- non-interactive: you will provide credentials, and the scripts decide in which tenant to create the objects,
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,
97+
- 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.
6298
6399
Here are the details on how to do this.
64100

AppCreationScripts/Configure.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ Function ConfigureApplications
210210
Write-Host "Updating the sample code ($configFile)"
211211
ReplaceSetting -configFilePath $configFile -key "ida:Tenant" -newValue $tenantName
212212
ReplaceSetting -configFilePath $configFile -key "ida:ClientId" -newValue $clientAadApplication.AppId
213-
ReplaceSetting -configFilePath $configFile -key "ida:RedirectUri" -newValue $clientAadApplication.ReplyUrls
214213
ReplaceSetting -configFilePath $configFile -key "todo:TodoListResourceId" -newValue $serviceIdentifierUri
215214
ReplaceSetting -configFilePath $configFile -key "todo:TodoListBaseAddress" -newValue $serviceAadApplication.HomePage
216215

AppCreationScripts/sample.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@
7676
"key": "ida:ClientId",
7777
"value": ".AppId"
7878
},
79-
{
80-
"key": "ida:RedirectUri",
81-
"value": ".ReplyUrls"
82-
},
8379
{
8480
"key": "todo:TodoListResourceId",
8581
"value": "$serviceIdentifierUri"

0 commit comments

Comments
 (0)