You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to connect using Connect-PnPOnline -ManagedIdentity in a Function App, following the example. I have successfully used the identity for Connect-MgGraph -Identity in the same function.
However I get
2024-01-08T14:47:12Z [Error] ERROR: Value cannot be null. (Parameter 'uriString')
Exception :
Type : System.ArgumentNullException
Message : Value cannot be null. (Parameter 'uriString')
ParamName : uriString
TargetSite : Void .ctor(System.String)
Data : System.Collections.ListDictionaryInternal
Source : System.Private.Uri
HResult : -2147467261
StackTrace :
at System.Uri..ctor(String uriString)
at PnP.PowerShell.Commands.Base.ConnectOnline.Connect(CancellationToken& cancellationToken) in c:\build\src\Commands\Base\ConnectOnline.cs:line 280
at PnP.PowerShell.Commands.Base.ConnectOnline.ProcessRecord() in c:\build\src\Commands\Base\ConnectOnline.cs:line 248
at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], ArgumentNullException
FullyQualifiedErrorId : System.ArgumentNullException,PnP.PowerShell.Commands.Base.ConnectOnline
InvocationInfo :
MyCommand : Connect-PnPOnline
ScriptLineNumber : 68
OffsetInLine : 9
HistoryId : 1
ScriptName : C:\home\site\wwwroot\EnterpriseAppSAMLExpirationMonthly\run.ps1
Line : Connect-PnPOnline -ManagedIdentity
PositionMessage : At C:\home\site\wwwroot\EnterpriseAppSAMLExpirationMonthly\run.ps1:68 char:9
+ Connect-PnPOnline -ManagedIdentity
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot : C:\home\site\wwwroot\EnterpriseAppSAMLExpirationMonthly
PSCommandPath : C:\home\site\wwwroot\EnterpriseAppSAMLExpirationMonthly\run.ps1
InvocationName : Connect-PnPOnline
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, C:\home\site\wwwroot\EnterpriseAppSAMLExpirationMonthly\run.ps1: line 68
when trying to connect using MI. What am I missing?
Requirements.psd1:
@{
# For latest supported version, go to 'https://www.powershellgallery.com/packages/Az'.
# To use the Az module in your function app, please uncomment the line below.
# 'Az' = '10.*'
'PnP.PowerShell' = '2.2.0'
'Microsoft.Graph.Authentication' = '2.9.1'
'Microsoft.Graph.Groups' = '2.9.1'
'Microsoft.Graph.Applications' = '2.9.1'
'Microsoft.Graph.Users.Actions' = '2.9.1'
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I want to connect using
Connect-PnPOnline -ManagedIdentity
in a Function App, following the example. I have successfully used the identity forConnect-MgGraph -Identity
in the same function.However I get
when trying to connect using MI. What am I missing?
Requirements.psd1:
Beta Was this translation helpful? Give feedback.
All reactions