Error Adding a Service Principal for a Multitenant App - New-AzureADServicePrincipal: Could not load file or assembly 'RestSharp, Version=106.3.1.0,

0

When trying to execute a PowerShell command to create a new Service principal for a Multitenant App from Tenant A to Tenant B, where the Tenant B Admin is trying to give consent and register the app from Tenant A using this command:

New-AzureADServicePrincipal -AppId "APP ID GUID"

I am getting this error:

New-AzureADServicePrincipal: Could not load file or assembly 'RestSharp, Version=106.3.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. Could not find or load a specific file. (0x80131621)

The PS command is being executed directly in the Azure Portal PowerShell CLI window, on the Tenant B subscription

azure
powershell
azure-active-directory
multi-tenant
asked on Stack Overflow Oct 15, 2020 by iamnicoj

2 Answers

1

I tested this command, and it works well for me:

enter image description here

I think your problem is caused by the Rest Sharp version, you can go to the Nuget package manager, then change the version of Rest Sharp and install it. Similar problem please see:here

answered on Stack Overflow Oct 19, 2020 by Carl Zhao
0

This should work. Please Create an Azure support request to better address this issue.

answered on Stack Overflow Oct 15, 2020 by Alfredo R

User contributions licensed under CC BY-SA 3.0