Why does the tenant linking script fail to run even though I am a Subscription owner?

If you have been assigned Subscription owner rights via a security group then the Get-AzRoleAssignment PowerShell command doesn't list your account and the tenant linking will abort.

If you are confident that you do have Subscription owner rights then you can edit the tenant linking script as follows:

  • Open the tenant linking script in a text editor
  • Find the following lines, typically they are lines 36 & 37
Write-Host "The current Azure AD user does not have Owner role on the selected subscription."
Break
  • Comment out the second line:
Write-Host "The current Azure AD user does not have Owner role on the selected subscription."
#Break
  • Re-run the script

The script still won't detect that the user has subscription owner rights but it will continue running.

Warning: If you do not have Owner rights to the selected Subscription the script will not be able to make the Gateway Owner of the new resource group add this will have to be done manually.

 

Something missing from this page or want to give feedback?