Created
September 9, 2019 18:30
-
-
Save PixelRobots/b3a1439ca29e0210bb223e0cc532e4c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sp = New-AzADServicePrincipal -DisplayName RabbitMQScale | |
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sp.Secret) | |
$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) | |
$AppID = (Get-AzADServicePrincipal -DisplayName RabbitMQScale).ApplicationID | |
New-AzRoleAssignment -ApplicationId $AppID -RoleDefinitionName "Contributor" | |
Write-host "Client ID =" $AppID | |
Write-host "Client Secret =" $UnsecureSecret | |
Write-host " Tenant =" (Get-AzContext).Tenant.Id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment