Skip to content

Commit 5841597

Browse files
Merge branch 'vnext' into azps1211
2 parents 6ce47ce + cb8a391 commit 5841597

6 files changed

Lines changed: 1538 additions & 722 deletions

File tree

Identity/AzureStack.Identity.psm1

Lines changed: 346 additions & 256 deletions
Large diffs are not rendered by default.

Identity/GraphAPI/GraphAPI.psm1

Lines changed: 602 additions & 375 deletions
Large diffs are not rendered by default.

Identity/README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
Instructions below are relative to the .\Identity folder of the AzureStack-Tools repo.
1+
// Place your settings in this file to overwrite the default settings
2+
{
3+
"workbench.colorTheme": "Abyss"
4+
}nstall-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
5+
Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
6+
Install-Module -Name AzureStack -RequiredVersion 1.2.9 -Scope CurrentUser
7+
```
28
39
Then make sure the following modules are imported:
410
@@ -7,31 +13,43 @@ Import-Module ..\Connect\AzureStack.Connect.psm1
713
Import-Module ..\Identity\AzureStack.Identity.psm1
814
```
915

10-
# Creating a Service Principal in a disconnected (AD FS) topology
16+
## Getting the directory tenant identifier from the Identity System
17+
18+
This function is used to get the Directory Tenant Guid. This method works for both AAD and AD FS.
19+
20+
```powershell
21+
$directoryTenantId = Get-AzsDirectoryTenantIdentifier -Authority "<DirectoryTenantUrl>"
22+
```
23+
24+
An example of an authority for AAD is `https://login.windows.net/microsoft.onmicrosoft.com`
25+
and for AD FS is `https://adfs.local.azurestack.external/adfs`.
26+
27+
## Creating a Service Principal in a disconnected (AD FS) topology
1128

1229
You can create a Service Principal by executing the following command after importing the Identity module
1330

1431
```powershell
15-
$servicePrincipal = New-AzsAdGraphServicePrincipal -DisplayName "<YourServicePrincipalName>" -AdminCredential $(Get-Credential) -ADFSMachineName "AZS-ADFS01" -Verbose
32+
$servicePrincipal = New-AzsAdGraphServicePrincipal -DisplayName "myapp12" -AdminCredential $(Get-Credential) -Verbose
1633
```
34+
Note: For a Multi node Azure Stack installation you also have to provide the ERCSMachineName parameter to send the request to the Privileged endpoint of your Azure Stack instance.
1735

1836
After the Service Principal is created, you should open your Azure Stack Portal to provide the appropriate level of RBAC to it. You can do this from the Access Control (IAM) tab of any resource. After the RBAC is given, you can login using the service principal as follows:
1937

2038
```powershell
2139
Add-AzureRmAccount -EnvironmentName "<AzureStackEnvironmentName>" -ServicePrincipal -CertificateThumbprint $servicePrincipal.Thumbprint -ApplicationId $servicePrincipal.ApplicationId -TenantId $directoryTenantId
2240
```
2341

24-
# Enabling AAD Multi-Tenancy in Azure Stack
42+
## Enabling AAD Multi-Tenancy in Azure Stack
2543

2644
Allowing users and service principals from multiple AAD directory tenants to sign in and create resources on Azure Stack.
2745
There are two personas involved in implementing this scenario.
2846

2947
1. The Administrator of the Azure Stack installation
3048
1. The Directory Tenant Administrator of the directory that needs to be onboarded to Azure Stack
3149

32-
## Azure Stack Administrator
50+
### Azure Stack Administrator
3351

34-
### Step 1: Onboard the Guest Directory Tenant to Azure Stack
52+
#### Step 1: Onboard the Guest Directory Tenant to Azure Stack
3553

3654
This step will let Azure Resource manager know that it can accept users and service principals from the guest directory tenant.
3755

@@ -40,19 +58,19 @@ $adminARMEndpoint = "https://adminmanagement.<region>.<domain>"
4058
$azureStackDirectoryTenant = "<homeDirectoryTenant>.onmicrosoft.com" # this is the primary tenant Azure Stack is registered to
4159
$guestDirectoryTenantToBeOnboarded = "<guestDirectoryTenant>.onmicrosoft.com" # this is the new tenant that needs to be onboarded to Azure Stack
4260
$location = "local"
61+
4362
Register-AzsGuestDirectoryTenant -AdminResourceManagerEndpoint $adminARMEndpoint `
4463
-DirectoryTenantName $azureStackDirectoryTenant `
4564
-GuestDirectoryTenantName $guestDirectoryTenantToBeOnboarded `
65+
-ResourceGroupName "system.local" `
4666
-Location $location
4767
```
4868

4969
With this step, the work of the Azure Stack administrator is done.
5070

51-
## Guest Directory Tenant Administrator
71+
### Guest Directory Tenant Administrator
5272

53-
The following steps need to be completed by the **Directory Tenant Administrator** of the directory that needs to be onboarded to Azure Stack.
54-
55-
### Step 2: Registering Azure Stack applications with the Guest Directory
73+
#### Step 2: Registering Azure Stack applications with the Guest Directory
5674

5775
Execute the following cmdlet as the administrator of the directory that needs to be onboarded, replacing ```$guestDirectoryTenantName``` with your directory domain name
5876

@@ -63,14 +81,3 @@ $guestDirectoryTenantName = "<guestDirectoryTenant>.onmicrosoft.com" # this is t
6381
Register-AzsWithMyDirectoryTenant -TenantResourceManagerEndpoint $tenantARMEndpoint `
6482
-DirectoryTenantName $guestDirectoryTenantName
6583
```
66-
67-
# Getting the directory tenant identifier from the Identity System
68-
69-
This function is used to get the Directory Tenant Guid. This method works for both AAD and AD FS.
70-
71-
```powershell
72-
$directoryTenantId = Get-AzsDirectoryTenantIdentifier -Authority "<DirectoryTenantUrl>"
73-
```
74-
75-
An example of an authority for AAD is `https://login.windows.net/microsoft.onmicrosoft.com`
76-
and for AD FS is `https://adfs.local.azurestack.external/adfs`.

0 commit comments

Comments
 (0)