Replies: 1 comment
-
with Azure function you can't run the commands as interactive because there is nothing to sign in. Change your setup to use a Service Principal |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I am going crazy trying to get a very simple powershell script to work in an Azure Function using .Net Core 7.0
Can someone explain what exact Azure Function setup is required to get the below script to work?
I can run this script on my local machine without any errors...
As soon as I try to implement the same script in an Azure Function App I get an error saying it cannot find the List???
[Information] INFORMATION: Error: No list found with id, title or url 'Site Directory'
I have tried using PnP.Powershell v1.12.0, v1.11.0, v1.7.0 but get the same error every time...
The SPN has access to the necessary access as I can run Get-PnPFile and Get-PnPWeb... Can someone please help? I have a deadline and I really don't understand that a simple script like this can cause so many issues? Is anyone else having these issues?
Output from successful execution from client:
Logging Site information in Site Directory for https://xxx.sharepoint.com/sites/Test2023
**Title ServerRelativeUrl Id
SPOSiteProvisioning /sites/SPOSiteProvisioning 95aec80d-0a3f-4a28-8caf-401462ab3ed9
AdditionalUXProperties :
AllowContentTypes : True
AllowDeletion :
Author : Microsoft.SharePoint.Client.User
BaseTemplate : 100
BaseType : GenericList
BrowserFileHandling :
Color :
ContentTypes :
ContentTypesEnabled : False
CrawlNonDefaultViews : False
CreatablesInfo : Microsoft.SharePoint.Client.CreatablesInfo
Created : 14-12-2022 14:41:38
CurrentChangeToken : Microsoft.SharePoint.Client.ChangeToken
CustomActionElements :
DataSource :
DefaultContentApprovalWorkflowId : 00000000-0000-0000-0000-000000000000
DefaultDisplayFormUrl :
DefaultEditFormUrl :
DefaultItemOpenInBrowser :
DefaultItemOpenUseListSetting : False
DefaultNewFormUrl :
DefaultView : Microsoft.SharePoint.Client.View
DefaultViewPath :
DefaultViewUrl : /sites/SPOSiteProvisioning/Lists/SiteDirectory/AllItems.aspx
Description :
DescriptionResource : Microsoft.SharePoint.Client.UserResource
Direction : none
DisableCommenting : False
DisableGridEditing : False
DocumentTemplateUrl :
DraftVersionVisibility : Reader
EffectiveBasePermissions :
EffectiveBasePermissionsForUI :
EnableAssignToEmail :
EnableAttachments : True
EnableFolderCreation : False
EnableMinorVersions : False
EnableModeration : False
EnableRequestSignOff : True
EnableVersioning : True
EntityTypeName : SiteDirectoryList
EventReceivers :
ExcludeFromOfflineClient :
ExemptFromBlockDownloadOfNonViewableFiles : False
Fields :
FileSavePostProcessingEnabled : False
ForceCheckout : False
Forms :
HasExternalDataSource : False
Hidden : False
HighPriorityMediaProcessing :
Icon :
Id : xx054c0b-c5da-40fc-8e01-980fa34cef4c
ImagePath : Microsoft.SharePoint.Client.ResourcePath
ImageUrl : /_layouts/15/images/itgen.png?rev=47
InformationRightsManagementSettings : Microsoft.SharePoint.Client.InformationRightsManagementSettings
DefaultSensitivityLabelForLibrary :
IrmEnabled : False
IrmExpire : False
IrmReject : False
IsApplicationList : False
IsCatalog : False
IsDefaultDocumentLibrary :
IsEnterpriseGalleryLibrary :
IsPredictionModelApplied :
IsPrivate : False
IsSiteAssetsLibrary :
IsSystemList :
ItemCount : 6
LastItemDeletedDate : 02-01-2023 13:16:56
LastItemModifiedDate : 03-01-2023 14:09:08
LastItemUserModifiedDate : 03-01-2023 14:09:08
ListExperienceOptions : Auto
ListFormCustomized :
ListItemEntityTypeFullName : SP.Data.SiteDirectoryListItem
ListSchemaVersion :
MajorVersionLimit : 50
MajorWithMinorVersionsLimit : 0
MultipleDataList : False
NoCrawl : False
OnQuickLaunch : True
PageRenderType :
ParentWeb : Microsoft.SharePoint.Client.Web
ParentWebPath : Microsoft.SharePoint.Client.ResourcePath
ParentWebUrl : /sites/SPOSiteProvisioning
ParserDisabled : False
ReadSecurity :
RootFolder : Microsoft.SharePoint.Client.Folder
SchemaXml :
ServerTemplateCanCreateFolders : True
ShowHiddenFieldsInModernForm :
TemplateFeatureId : 00bfea71-de22-43b2-a848-c05709900100
TemplateTypeId :
Title : Site Directory
TitleResource : Microsoft.SharePoint.Client.UserResource
UserCustomActions :
ValidationFormula :
ValidationMessage :
Views :
WorkflowAssociations :
WriteSecurity :
FirstUniqueAncestorSecurableObject : Microsoft.SharePoint.Client.SecurableObject
HasUniqueRoleAssignments :
RoleAssignments :
Context : PnP.Framework.PnPClientContext
Tag :
Path : Microsoft.SharePoint.Client.ObjectPathIdentity
ObjectVersion : 15
ServerObjectIsNull : False
TypedObject : Microsoft.SharePoint.Client.List
FieldValues : {[SiteDescription, ], [Title, SPOSiteProvisioning], [URL, https://xxx.sharepoint.com/sites/SPOSiteProvisioning], [ID, 11]…}
AttachmentFiles :
CommentsDisabled :
CommentsDisabledScope :
ComplianceInfo :
ContentType : Microsoft.SharePoint.Client.ContentType
DisplayName :
GetDlpPolicyTip : Microsoft.SharePoint.Client.DlpPolicyTip
EffectiveBasePermissions :
EffectiveBasePermissionsForUI :
FieldValuesAsHtml : Microsoft.SharePoint.Client.FieldStringValues
FieldValuesAsText : Microsoft.SharePoint.Client.FieldStringValues
FieldValuesForEdit : Microsoft.SharePoint.Client.FieldStringValues
File : Microsoft.SharePoint.Client.File
FileSystemObjectType : File
Folder : Microsoft.SharePoint.Client.Folder
IconOverlay :
Id : 11
ParentList : Microsoft.SharePoint.Client.List
Properties : Microsoft.SharePoint.Client.PropertyValues
ServerRedirectedEmbedUri :
ServerRedirectedEmbedUrl :
Client_Title :
Versions :
FirstUniqueAncestorSecurableObject : Microsoft.SharePoint.Client.SecurableObject
HasUniqueRoleAssignments :
RoleAssignments :
Context : PnP.Framework.PnPClientContext
Tag :
Path : Microsoft.SharePoint.Client.ObjectPathIdentity
ObjectVersion : 1
ServerObjectIsNull : False
TypedObject : Microsoft.SharePoint.Client.ListItem**
What is a stable version to use with .Net Core 7.0 and what version of Azure Functions should I use ~3, ~4???
Beta Was this translation helpful? Give feedback.
All reactions