Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created September 9, 2019 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PixelRobots/b3a1439ca29e0210bb223e0cc532e4c3 to your computer and use it in GitHub Desktop.
Save PixelRobots/b3a1439ca29e0210bb223e0cc532e4c3 to your computer and use it in GitHub Desktop.
$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