microsoft / CopilotStudioSamples

MIT License
301 stars 247 forks source link

Deploy a Microsoft Copilot Studio copilot as a SharePoint component with single sign-on (SSO) enabled #204

Open DBarwick opened 4 months ago

DBarwick commented 4 months ago

I have followed the guidance on GitHub for deployment - https://github.com/microsoft/CopilotStudioSamples/blob/master/SharePointSSOComponent/SETUP.md

This issue I have is that the app will not install on the site

Error message

AppInstallError

The content database on the server is temporarily unavailable. Details: Deployment failed in host web https://__________.sharepoint.com/sites/DB-Techhub-Test for app pva-extension-sso-client-side-solution/14634225-91e5-41a4-b9cc-161ccb3400b4. System.Exception: HandleProvisioningException rethrowing: The specified value for property ClientSideComponentProperties is not a valid JSON string, exception: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: T. Path 'greet', line 1, position 369. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateJObject(JsonReader reader) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Microsoft.SharePoint.SPUserCustomAction.ValidateClientSideAction(). ---> Microsoft.SharePoint.SPException: The specified value for property ClientSideComponentProperties is not a valid JSON string, exception: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: T. Path 'greet', line 1, position 369. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateJObject(JsonReader reader) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Microsoft.SharePoint.SPUserCustomAction.ValidateClientSideAction(). at Microsoft.SharePoint.Utilities.SPUtility.ThrowSPExceptionWithTraceTag(UInt32 tagId, ULSCat traceCategory, String resourceId, Object[] resourceArgs) at Microsoft.SharePoint.SPUserCustomAction.ValidateClientSideAction() at Microsoft.SharePoint.SPUserCustomAction.Update() at Microsoft.SharePoint.SPWebUserCustomAction.Update() at Microsoft.SharePoint.SPCustomActionElement.AddCustomActionToDatabase(SPSite site, SPWeb webNull) at Microsoft.SharePoint.SPCustomActionElement.UpdateCustomActionsTable(SPFeature feature, SPSite site, SPWeb web, CultureInfo cultureInfo, Boolean fForce) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPFeature.HandleProvisioningException(Exception e, Boolean force) at Microsoft.SharePoint.SPCustomActionElement.UpdateCustomActionsTable(SPFeature feature, SPSite site, SPWeb web, CultureInfo cultureInfo, Boolean fForce) at Microsoft.SharePoint.SPFeature.UpdateCachedFeatureDefinitionInformation(SPSite site, SPWeb web, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.InstallOrUpgrade(SPSite site, Nullable`1& solutionId, Boolean& swapNeeded)

I have also tested with no changes made to the elements.xml file but same error

Any help appreciated

adilei commented 4 months ago

Based on the error, it actually seems you are using a modified version of element.xml

Maybe it would be easier to use the pre-built package and modify the app's properties post deployment?

https://github.com/microsoft/CopilotStudioSamples/blob/master/SharePointSSOComponent/SETUP.md#step-3---download-and-configure-the-sharepoint-spfx-component