Office 365 & Azure Integration: How to connect a SQL Azure database table to native SharePoint lists in the cloud?

 

​​The Cloud Connector for Microsoft Office 365 and SharePoint connects almost any on-premise data source, e.g. ODBC, OLEDB, Microsoft .NET based providers, Files (Excel, XML, CSV), SQL databases like SQL Server, Oracle, MySQL, IBM DB2, IBM AS/400, IBM Informix, Notes, SharePoint, Exchange, Active Directory, Navision, SAP and many more directly to native SharePoint lists in the Microsoft Cloud - or any other Microsoft SharePoint installation - in just minutes without any programming. For any questions please use the FAQ Web Form or contact sales@layer2solutions.com directly.

 

​It's easy to connect a Windows Azure database table to native SharePoint lists in Office 365, SharePoint Online or any other SharePoint sandbox.

 

Sample requirement:

In our scenario we want to provide links to documents in Windows Azure in a SharePoint link list in Office 365.

 

Steps to connect:

First you have to create the SQL Azure table like this:

 

azure create document list table

Fig.: Creating a SQL Azure table to host the document link information.

 

As a next step you have to create a Links list in your Office 365 or SharePoint Online. Use the Links template for this.

As a next step you can connect both data entities using the Cloud Connector for one-way replication. You have to provide a connection definition similar to the following:

 

<?xml version="1.0" encoding="utf-8" ?>

<connection
xmlns=http://www.layer2.de/schemas/cloudConnections
interval="60" version="1.2" enabled="true">

<dataEntities>


<dataEntity name="AzureSource" 
provider="System.Data.SqlClient" 
connectionString="Server=tcp:myserver.database.windows.net;Database=myDatabase;
User ID=MyUser@myserver.database.windows.net;Password=MyPassword;
Trusted_Connection=False; Encrypt=True;"
selectStatement="Select *, docLink + ';#' + docName as SPURL from DocLinks"
primaryKey="docLink"
type="source" >
</dataEntity>


<dataEntity name="Office365Destination"
provider="Layer2.SharePoint.Provider"

connectionString="Data Source=https://myserver.sharepoint.com/sites/mysite/; Initial Catalog=AzureDocLinks; Authentication=Office365; User Id=myUser@MyDomain.onmicrosoft.com;Password=MyPassword;"
selectStatement=""
type="destination" >
</dataEntity>

</dataEntities>

 

<fieldMappings>
 <fieldMapping>
  <field entity="AzureSource" name="SPURL"/>
  <field entity="Office365Destination" name="URL" />
    </fieldMapping>

 <fieldMapping>
  <field entity="AzureSource" name="docDescription"/>
  <field entity="Office365Destination" name="Notes" />
    </fieldMapping> 

</fieldMappings>

</connection>

 

 

Please note:

  • The System.Data.SqlClient provider has to be installed on the server or client computer, where the Cloud Connector runs.
  • Please make shure that SQL Azure can be reached from the Cloud Connector computer using it's ports 1433/1434. There are different ways to do this, e.g. open in firewall, using a port bridge etc.
  • The URL column of the "AzureDocLinks" Links list is of type URL. To provide the link as usual with link url and link text  you have to use the notation "link;#text". That's why the SQL query creates a SPURL field during runtime. The Azure SPURL field is mapped to the SharePoint URL column in the mapping section of the connection definition file.

 

azure document link in sharepoint list

Fig.: The URL field in SharePoint consists of link and description.

 

  • You need a primary key on the Azure side. Here as a sample the URL itself is used, but you can use any other as well.
  • In this sample the content is replicated one way only (Azure to O365) every hour.

 

Benefits:

  • SQL Azure data can be used with Office 365, SharePoint Online or any other SharePoint in native SharePoint lists.
  • All SharePoint list features are available for SQL Azure data, e.g. notifications and workflows on external data change (e.g. linked document changes in this sample).
  • You can use Azure to store documents that can be linked in Office 365, SharePoint Online or any other SharePoint.
  • More general benefits see the Cloud Connector product page.

 

In this sample an unidirectional connection is used. Generally SQL Azure tables can be connected bi-directional to native SharePoint lists as well.

Ready to go next steps?

Layer2 leading solutions product regsitration icon: a grey square with a big orange pen symbol.

Register for free download.

Keep your Sharepoint in sync. Download and try today.

Contact Us Icon for Layer2 leading solutions

Questions? Contact us.

We are here to help. Contact us and our consulting will be happy to answer your questions.