Skip to content

Commit b527a42

Browse files
author
Shriram Natarajan
committed
fixed errors in multiTenancy
1 parent dce3950 commit b527a42

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

Identity/AzureStack.Identity.psm1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,6 @@ function Register-AzsWithMyDirectoryTenant {
345345
[ValidateNotNullOrEmpty()]
346346
[string] $DirectoryTenantName,
347347

348-
# Optional: The identifier (GUID) of the Resource Manager application. Pass this parameter to skip the need to complete the guest signup flow via the portal.
349-
[Parameter(Mandatory=$false)]
350-
[ValidateNotNullOrEmpty()]
351-
[string] $ResourceManagerApplicationId,
352-
353348
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
354349
[Parameter()]
355350
[ValidateNotNull()]
@@ -359,6 +354,9 @@ function Register-AzsWithMyDirectoryTenant {
359354
$ErrorActionPreference = 'Stop'
360355
$VerbosePreference = 'Continue'
361356

357+
# Get the Application of Resource Manager
358+
$ResourceManagerApplicationId = $(Invoke-RestMethod "$TenantResourceManagerEndpoint/metadata/identity?api-version=2015-01-01").applicationId
359+
362360
# Install-Module AzureRm -RequiredVersion '1.2.8'
363361
Import-Module 'AzureRm.Profile' -Force -Verbose:$false 4> $null
364362
Import-Module "$PSScriptRoot\GraphAPI\GraphAPI.psm1" -Force -Verbose:$false 4> $null
@@ -405,7 +403,7 @@ function Register-AzsWithMyDirectoryTenant {
405403
# Initialize the necessary tags for the registered application
406404
if ($applicationRegistration.tags)
407405
{
408-
Update-GraphApplicationServicePrincipalTags -ApplicationId $applicationRegistration.appId -Tags $applicationRegistration.tags
406+
Update-GraphApplicationServicePrincipalTag -ApplicationId $applicationRegistration.appId -Tags $applicationRegistration.tags
409407
}
410408

411409
# Lookup the permission consent status for the application permissions (either to or from) that the registered application requires

0 commit comments

Comments
 (0)