Debug office Add-ins

You could get logs of internal errors on the Office Addin using following method. Its simple and easy and involved few steps achieve.

Open Windows registry editor (windows + R then regedit.exe) and follow the route “HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Wef\Developer\” and mention your location to write logs.

2017-07-24_12-00-23

Notes 

  • Runtime logging feature available in Office desktop 2016 version.
  • You must be admin of the considered system to perform this.

Important!

Initially, this is kept blank and keep in mind to reverse it back since it leads to performance issues.

Advertisements

View Picker Tree view of SharePoint Online and On Prem

If you locking for short cut to integrate SharePoint site hierarchy. The following hack would be a better option if you not willing to custom build control.

✍ How achive?

/_layouts/15/PickerTreeView.aspx

SharePoint site hierarchy

Introduction to Script Lab – A Simplified but powerful way to Office Extendibility

Script Lab is a Microsoft garage project which initiated with summer hackathon held back in 2016. Creator main focus is to build a platform where build add-ins simple and with less knowledge curve for web developers. It is simple but it does not mean it is not powerful. Let’s go through below slider where you could kick start on developing Office extended apps.

click here if slider does not work. 

More information
https://www.microsoft.com/en-us/garage/project-details.aspx?project=script-lab

Github Repository
http://aka.ms/scriptlab

Get Script Lab
https://aka.ms/getscriptlab – install

Office Add-ins UX design patterns
https://github.com/OfficeDev/Office-Add-in-UX-Design-Patterns

Office JS API reference
https://dev.office.com/reference/add-ins/javascript-api-for-office

Configure Google Domains with Office 365 and Custom Azure Web App Domain

If you are setting up Office 365 with custom domain you will be asked to configure name server pointing to below in the domain admin page. In our case it will be Google domains registration page.

dns entries for o 365.PNG

If you altered name servers into Office 365 it wont help you to propagate DNS entries with Google domain management tool since you have handed over responsibilities to Microsoft Online DNS services.

⚡ Note – You required to enter DNS record in Office 365 but not in the google domain registration console.

You could achieve adding custom domain entries buy following path or finding domains in search in Office 365 admin portal.

☛ Home –> Setup –> Domains –> New Custom Record

adding custom domains

 It may take many minutes to propagate around the world based on the condition and you could check success of propagation with tool ViewDNS.

⚓ References

Azure Functions with SharePoint Online

Common trend we came and interesting figure we came up is moving towards Severless where we are not worry about infrastructure. “Azure Functions” is a compute offering which you allow to write custom logic with choice of C#, F# and JavaScript (as for May, 2017).

From the choices above I have chosen SharePoint CSOM (Client Side Object Model) to this sample but if you prefer JSOM or REST API with the requirement, you could go with those.

Lets checkout Azure Functions with SharePoint Online where both in same cloud group which call as SaaS (Software as a Service).

🛠 Step ♳ – Create an Azure Function

You could arrive there with simply following below reference which is common thing and described in every reference.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-app-portal

🛠 Step ♴ – Adding SharePoint CSOM DLLs

To add SharePoint DLLs to Functions App environment, you required to arrive with Kudu environment.

 Function à Platform Features à Advanced Tools (Kudu)

Shortcut – You could arrive there with URL

https://<function name>.scm.azurewebsites.net/

After you arrived with Kudu portal, check for debug then PowerShell (Command prompt is also available but prefer PS). Navigate to bin folder which resides under following location under you function name and upload your SharePoint DLLs to the folder (i.e. Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll)

☕ Learn more on Kudu – https://github.com/projectkudu/kudu

🛠 Step ♵ – Refer SharePoint references on the Function

After adding DLLs to the bin, you could arrive with function and start writing you logic within the run.csx.

You could refer added DLLs in the function as below in the top.

#r “Microsoft.SharePoint.Client.Runtime.dll”

#r “Microsoft.SharePoint.Client.dll”

🛠 Step ♶ – Imports references

This is typical step we are doing in any C# which is adding references.

using System;

using System.Security;

using System.Configuration;

using Microsoft.SharePoint.Client;

🛠 Step ♷ – Configuration Values in Azure Function

You will be required the user name, password, and site URL to your SharePoint, those could be done with the application settings as we were keep doing with the web.config files.

Navigate thorough below path and add your configurations where you will be references in function logic.

Click on Function à Platform Features à Application Settings à App settings à Add values as key/ value pairs

Above could be accessed as below in the code.

string userName = ConfigurationManager.AppSettings[“User”];

🛠 Step ♸ – Application Logic

You could write as your preference. In my sample on the gist which I have posted below is considered copying list items from one list to another. It’s really simple and you could able to expand the logic as you have done earlier with SharePoint CSOM.

⌛ Motivations

You could use Azure Functions as Timer Jobs (which we had in SharePoint Server) with scheduling and web hooks and etc.

References – Azure Function Developer Guide

Enabling External Sharing | Multidomain Sharing in SharePoint Online

In SharePoint online environment most of the businesses facing issue with connecting with another business (B2B) or in technical terms connecting with another domain.

We have been using different methods with the Active Directly level which we known as “Federation”. But will see how we could share SharePoint site with multiple domains.

📓 Note : 

  • You must have either Microsoft account or organizational account to achieve this. 
  • Microsoft account must not be Live, Outlook or Hotmail, It could be Gmail, Yahoo or another. Then you should create a Microsoft account with your domain. Eg. “example@yahoo.com”.
  • Organizational account is account in another Office 365 tenant

How to share site with external domain user?

Firstly, you must enable External Sharing in the Office 365 admin center. This could be find easily with searching external sharing in the admin center.

ext 1

Second, Go site administration and select your SharePoint site and hit on “Share” on the ribbon. Make sure and best practice 🔖 to mention your external domain you sharing as below.

ext 2

Finally added user will be visible as below in the Office 365 admin center.

📌 Some useful resources :