Office 365 Code Submission – MSOCAF Best Practices


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

 

image


    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.

    image

    • 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.

     


      ANALYZE

        • 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.

        image

        • MSOCAF has a defined set of rules that will be run to test for these issues.

        image

        • 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.

        image

        • 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.

        image

        image

         

         


          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.

          image

          • Before using this option, ensure that you have the web application URL set in MSOCAF tool settings as shown below.

          image

           

          • During testing, ensure that all the predeployment, manual and postdeployment steps are being displayed correctly from the deployment document.

          image

          • Also ensure that Rollback is also tested and is working correctly.

          •  

              


          SUBMIT

           

          • 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.

          image

          Skip to main content