The objective of this article is to share some of the Office 365 Code Submission Best Practices based on my personal experience.
The MSOCAF (Microsoft SharePoint Online Code Analysis Framework) tool is your friend which can ensure that the package being submitted is as per the guidelines of MSO. Download the same from : https://caf.sharepoint.microsoftonline.com/Default.aspx
CREATE THE PACKAGE
- Create a local folder and follow the folder structure as specified by MSOCAF tool. Even if you don’t have any files in a particular folder, keep the empty folder. Also, always ensure that you have the correct type of files placed in the right folder.
- DO NOT Change the name of the deployment document ‘MSODeploymentGuide.docx’ as the MSOCAF tool will look for a document with the same name in the deployment folder to load the PreDeployment Checklist/ Instructions, Manual Deployment Steps, PostDeployment Instructions etc., as shown below.
While creating the deployment document, do not copy paste sections from one place to another. This could result in having instructions from one section display in a different section in the MSOCAF tool.
- MSOCAF analyses your customized SharePoint code for any potential issues that can affect security, stability and performance of the SharePoint Online Service and creates a report.
- MSOCAF has a defined set of rules that will be run to test for these issues.
- So, its extremely important that you first Analyze the code for any issues and fix the issues. To analyze the package that was created in the previous step, click on Browse and select the folder.
- If you see any false positives, provide a justification by clicking Override/ Override All (as applicable) option. This will update the CAFReport generated with the Justification Comments.
TEST DEPLOYMENT AND ROLLBACK
- You can use the MSOCAF tool to test the deployment process to help ensure a successful deployment to SharePoint Online. So, Always ensure that you test your package using the Test Deployment and Roll back links.
- Before using this option, ensure that you have the web application URL set in MSOCAF tool settings as shown below.
During testing, ensure that all the predeployment, manual and postdeployment steps are being displayed correctly from the deployment document.
Also ensure that Rollback is also tested and is working correctly.
- Once all the above steps are complete and the package is fully tested, you can use the below option available in MSOCAF to submit the code to MSO.