Transcript Azure Storage
SharePoint & Azure
Jan Steenbeek, Martijn Duiveman
Introduction
– – New development models No more full trust or sandbox – How are we going to create the same or better solutions in the cloud as we do on premise?
Demo
Contents
– – – – – – – – Architecture Azure Web Jobs SDK Web Job registration Demo Graph API Registration in Active Directory Demo Questions
Architecture
SharePoint Online tenant SharePoint Site App New Site Queue Azure Subscription Graph API Active Directory Provider hosted app Database Web Job
Azure WebJobs SDK
And Azure Storage
Comparable with TimerJob’s Scheduled / On Demand / Continuous Runs in an Azure Website – .exe, .cmd, .bat
– Zip and upload Triggers en Model Binding Works with Azure Storage – Azure Blob Storage – Azure Table Storage – Azure Queues
Goal of the SDK
“Provide a way to make it easier to use Azure Storage when doing any background processing work.”
Azure Storage
Table’s, Blobs en Queue’s Table Storage Tables Customers Orders Entities Name = … Email = … Name = … Email = … OrderId = … Date = … • • • • Stuctured data Max 252 properties Max 1MB per entity Inherit from Microsoft.WindowsAzure.Storag
e.Table.TableEntity
Blob Storage Containers Pictures Movies Blobs Img001.jpg
Img002.jpg
Mov1.avi
• • • Unstructured data Large files (100+ Gb per file) Add using FileStream etc.
Queue Storage Queue’s CreateSite Queue ResizeIma geQueue Messages {name: ..., url: ...} {name: ..., url: ...} {image: ..., format: ...} • • • • Unstructured data Small messages (64 KB each) Millions of messages in queue Create backlog of tasks to perform
Demo
Registering WebJob in SharePoint (1 / 4)
Register an App https://projectb.sharepoint.com/_layouts/15/ AppRegNew .aspx
Registering WebJob in SharePoint (2 / 4)
Grant Permission to an App https://projectb.sharepoint.com/_layouts/15/ AppInv .aspx
Registering WebJob in SharePoint (3 / 4)
Get Tenant ID https://projectb.sharepoint.com/_layouts/15/ AppPrincipals .aspx
Registering WebJob in SharePoint (4 / 4)
App.Config
Setup Development Environment
– – – – – Install-Package Microsoft.Azure.WebJobs –Pre Current version 1.0.0.0 RC1 Storage Account ConnectionString – Naam: AzureWebJobsStorage – DefaultEndpointsProtocol=https; AccountName=[ACCOUNTNAME]; AccountKey=[ACCESSKEY] Always On
Graph API
– – – CRUD operations on directory data and objects REST API Useful in SharePoint context, for example when – Authorizing users for multiple sites – Delegating authorization management – Getting to properties that are not exposed via the SharePoint User Profiles
Graph API
Mapped properties in SharePoint online
Demo
Setup Development Environment
– Install-Package – Microsoft.IdentityModel.Clients.ActiveDirectory
– Microsoft.Azure.ActiveDirectory.GraphClient
– Grant App permissions on Azure AD
Useful links
Download our code http://www.vxcompany.com/diwug-sharepoint-en-azure/ How to use; Azure Table Storage Azure Blob Storage Azure Queue Storage Graph API Code Samples op CodePlex GitHub https://github.com/Azure/azure-webjobs-sdk-samples Blog: Pranav Rastogi http://azure.microsoft.com/blog/author/pranavra