OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Get-AdminPowerApp fails when authenticating using service principal

  • Thread starter Thread starter Fabulous Fab
  • Start date Start date
F

Fabulous Fab

Guest
I registered an application and added it as a Service Principal according to this guide: https://learn.microsoft.com/en-us/power-platform/admin/powershell-create-service-principal. I then logged in as this service principal.

I am trying to get a list of all Power Apps using the PowerShell command Get-AdminPowerApp. However, it gets a few (in my case 52) and then it fails with:

Code:
CreateAppObject : Cannot bind argument to parameter 'AppObj' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft.PowerApps.Administration.PowerShell\2.0.180\Microsoft.PowerApps.Administration.Powershell.psm1:9305 char:41
+                 CreateAppObject -AppObj $app
+                                         ~~~~
    + CategoryInfo          : InvalidData: (:) [CreateAppObject], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,CreateAppObject

However, if I log in using a username and a password instead of a service principal it works without issues.

Anyone know why?
<p>I registered an application and added it as a Service Principal according to this guide: <a href="https://learn.microsoft.com/en-us/power-platform/admin/powershell-create-service-principal" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/power-platform/admin/powershell-create-service-principal</a>. I then logged in as this service principal.</p>
<p>I am trying to get a list of all Power Apps using the PowerShell command Get-AdminPowerApp. However, it gets a few (in my case 52) and then it fails with:</p>
<pre><code>CreateAppObject : Cannot bind argument to parameter 'AppObj' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft.PowerApps.Administration.PowerShell\2.0.180\Microsoft.PowerApps.Administration.Powershell.psm1:9305 char:41
+ CreateAppObject -AppObj $app
+ ~~~~
+ CategoryInfo : InvalidData: (:) [CreateAppObject], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,CreateAppObject
</code></pre>
<p>However, if I log in using a username and a password instead of a service principal it works without issues.</p>
<p>Anyone know why?</p>
Continue reading...
 

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top