Giter VIP home page Giter VIP logo

msfin's Introduction

Contoso O365 Doc Sync Code Sample

Table of Contents

Prerequisites

Create Azure resources using ARM template

Register the application in Azure Active Directory for MVC Web App

Register the application in AAD for WebJob

Configure the communication between WebJob and O365 tenant

Deploy the sample to Azure

Configure always encrypted feature for database

Encrypt string

Encrypt the database connection string

Upload the Add-in manifest file

Install Excel Add-in

Install Word Add-in

Install PowerPoint Add-in

Run Excel, Word & PowerPoint Add-ins

How to view Azure SQL data?

How to view data in the storage account?

How to check WebJob status?

Build and debug locally

Understand the code

Questions and comments

Contributing

Prerequisites

Deploying and running this sample requires:

  1. An Azure subscription with permissions to register a new application, and deploy the Web App.
  2. You have an O365 account and you could contact your admin to consent the permission to access it.
  3. Visual Studio 2015 (any edition), Visual Studio 2015 Community is available for free and ensure Latest Microsoft Office Developer Tools for Visual Studio 2015 is installed.
  4. Make sure you have Azure PowerShell installed.
  5. Make sure you have Microsoft Azure Tools for Microsoft Visual Studio 2015 installed.
  6. Familiarity with C#, .NET Web applications, JavaScript programming.

Create Azure resources using ARM template

  1. Download the project and using visual studio 2015 to open it.

  2. Right click on the Azure resource group project ContosoO365DocSync.Azure then click Deploy then click New.

  3. Fill the following form.

    • Login account.
    • Select the subscription.
    • Click Create New.
    • Create a new resource group(For example: ContosoO365DocSync.QA).
    • Select resource.json.
    • Select resource.qa.parameters.json.

  4. Clicking Edit Parameters and please fill the parameters below, then select save passwords checkbox and then click Save.

    Note: Copy and store webSiteName, administratorLogin and administratorLoginPassword, you will use them in the next steps.

    Parameter Name Value Note
    webSiteName For example: ContosoO365DocSyncQAWebApp
    sqlserverName For example: ContosoO365DocSyncQASQL The SQL Server name
    hostingPlanName For example: ContosoO365DocSyncQAHostPlan The name of the App Service plan to use for hosting the Web App.
    skuName **For example: ** F1
    skuCapacity For example: 1 sets number of workers for this App Service plan SKU
    administratorLogin For example: ContosoO365DocSyncLogin This login is used to login to the SQL database.
    administratorLoginPassword For example: contosoo365docsync@qa
    databaseName For example: contosoo365docsyncQA The database name hosted on the SQL Server
    collation Leave it as is.
    edition For example: basic Specifies the edition for the database. Valid values are: -- Default -- None -- Premium -- Basic -- Standard
    maxSizeBytes Leave it a is
    requestedServiceObjectivename For example: basic performance level
    storageAccountType For example: Standard_LRS
    storageAccountName For example: ContosoO365DocSyncQA
    appInsightName For example: contosoo365docsyncqa
  5. Validate and hit Ok.

  6. Uncheck the Validate only checkbox and then hit OK to create the Azure resources.

    Resource Name Resource Type Pricing Level Resource Group
    webSiteName App Service F1 Resource group created in the step 3 above.
    sqlserverName SQL Server N/A Same as above
    databaseName SQL database basic Same as above
    storageAccountName Storage account LRS Same as above
    webSiteName Application insight basic Same as above

Register the application in Azure Active Directory for MVC Web App

  1. Login the Azure portal using your O365 account.

  2. Click App Registrations on the left navigation and then click + New application registration button.

  3. In the Add Application wizard, enter a name of ContosoO365DocSyncWeb and choose the type Web Application and/or Web API.

  4. Enter a SIGN-ON URL.

    https://<appName>.azurewebsites.net For example: https://contosoo365docsyncweb.azurewebsites.net.

    Note: Sign-ON URL is the URL where you can sign in and use your app.

  5. Click Create to create the registration.

  6. Go back the App registrations page when the application created successfully.

  7. Search the application name and then click it.

  8. Obtain and store the application client ID.

    • On the application, the GUID in Application ID is client ID and store it.

  9. Obtain and store the application client secret.

    • On the application, click Keys.

    • Enter Key Name and select Expires and then click Save.

    • After saved successfully copy and store the client secret.

  10. Configure the reply URLS..

    • On the application, click Reply URLs..

    • Delete all existing URLs, then enter the https://<webSiteName>.azurewebsites.net/, then click Save.

      Note: You can find the webSiteName in step 4 in this section.

  11. Configure the application permissions.

    • On the application, click Required permissions.

    • Make sure the Sign in and read user profile is selected of Windows Azure Active Directory.

    • Click Add, select Office 365 SharePoint Online, select Read and write items and lists in all site collections and then click Select.

    • Click Done.

    • Click Add, select Microsoft Graph, select Create, edit, and delete items and lists in all site collections and then click Select.

    • Click Done.

  12. Obtain and store the Azure AD tenant ID.

    • Click Azure Active Directory in the left menu, and the click Properties in the middle menu.

    • The GUID in Directory ID is tenant ID and store it.

Register the application in AAD for WebJob

  1. Follow Register the application in AAD for MVC Web App section to register another app named ContosoO365DocSyncWebJob and please refer to the table below when filling the value.

    | SIGN-ON URL | https://[appWebJobName].azurewebsites.net |

  2. Please make sure the following permissions are configured for the Azure AD web job app.

Configure the communication between WebJob and O365 tenant

  1. Create self-certificate.

    • Execute the following command to create the self-certificate.

      makecert -n "CN=MyCompanyName MyAppName Cert" -ss my -len 1024 -r -pe

    NOTE: Please update the MyCompanyName and MyAppName. For example:
    makecert -n "CN=ContosoLLC ContosoO365Sync Cert" -ss my -len 1024 -r -pe

    • Go to the personal certificate store under current user.

    • Export the CER certificate with base 64 encoded X.509.

    • Execute the following PowerShell command.

      $cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
      $cer.Import("<absolute path of the CER file>") 
      $bin = $cer.GetRawCertData()
      $base64Value = [System.Convert]::ToBase64String($bin)
      $bin = $cer.GetCertHash()
      $base64Thumbprint = [System.Convert]::ToBase64String($bin)
      $keyid = [System.Guid]::NewGuid().ToString()
      Write-Host $base64Value
      Write-Host "---"
      Write-Host $base64Thumbprint
      Write-Host "---"
      Write-Host $KeyId

      NOTE: Please update the CER file path. For example: c:\mycert.cer

    • Store the base64Value, $base64Thumbprint and keyid that will be used in other places.

      Note: If MAKECERT is not available, please download the Windows SDK and install the tool only in the screenshot below.

      https://www.microsoft.com/en-us/download/confirmation.aspx?id=8279

  2. Export PFX certificate

    • Export the PFX certificate from the self-certificate

    • Store the password when exporting the PFX certificate.
    • Store the PFX certificate.
  3. Download the project & include the certificate.

    • Open then project in visual studio 2015.

    • Include the PFX certificate in ContosoO365DocSync.WebJob project.

    • Include the PFX certificate in ContosoO365DocSync.DocumentWebJob project.

    For example: contosoo365docsync.pfx.

  4. Configure the application settings in Azure portal.

    • Login the Azure portal.
    • Go to the resource groups you created in this section.
    • Click the web site.

    • Go to the application settings.

    • Locate the App settings node.

    • Fill the following app settings.

    **App setting ** Value Notes
    InstrumentationKey Application Insight Instrumentation key. Find it in the application insights
    ida:WebJobClientId The application ID of the AAD App for WebJob Find it in the AAD App for WebJob in this section.
    CertificatePassword The password when exporting the certificate Step 2 in this section
    ida:AADInstance https://login.microsoftonline.com/ Fixed value
    ida:TenantId The Azure Tenant ID Step 12 in this section
    SharePointUrl The root site collection of the O365 site For example: https://yourtenant.sharepoint.com
    Key 23, 7, 19, 11, 24, 226, 85, 45, 114, 184, 27, 162, 37, 112, 222, 209, 241, 24, 175, 144, 176, 53, 196, 29, 24, 26, 17, 218, 131, 236, 53, 209 Encrypt key, this is fixed value
    CertificateFile web site relative path Step 2 in this section
    ida:clientID GUID Step 8 in this section
    ida:clientSecret String Step 9 in this section
    ida:PostLogoutRedirectUri https://<>.azurewebsites.net/ Step 4 in this section
    ResourceId https://graph.microsoft.com this is fixed value
    • Update the following connection settings.
    **Connection setting ** Value Notes
    DefaultConnection The SQL server database connection string. Encrypt it in this section
    AzureWebJobsDashboard The Azure web job dashboard connection string. Encrypt it in this section
    AzureWebJobsStorage The Azure web job storage connection string Encrypt it in this section
  5. Update the manifest file.

    • Login the Azure portal.
    • Go to the ADD App you created in this section.
    • Download the manifest file from the AAD App for the WebJob.

    • Edit XXX following the template below and then upload the manifest file.
Key Value Notes
customKeyIdentifier $base64Thumbprint Step 1.5 in this section.
keyId $keyid Step 1.5 in this section.
value $base64Value Step 1.5 in this section

Deploy the sample to Azure

  1. Open the project using visual studio 2015 if you already download it.

  2. Right click on ContosoO365DocSync.Web and then select Publish

  3. A Publish popup will be displayed.

  4. Click on Microsoft Azure App Service.

  5. Sign in with Azure account and select the Azure website then click OK.

  6. Select Web Deploy and then click Next.

  7. Select Release and unchecked the Enable Organizational Authentication then click Next.

  8. Click Publish.

  9. After published successfully, make sure you can open the https://<webSiteName>.azurewebsites.net site and it is blank.

    NOTE: You can find the webSiteName in step 4 in this section.

Configure always encrypted feature for database

The application you registered and the azure resource group you created must be in same domain.

  1. Create Key Vault.

    1. Go to the resource group in Azure portal.

    2. Click Add on the top menu.

    3. In the new page, type key vault and then select Key Vault.

    4. Click Create.

    5. Fill the form.

      • Type the key vault name.
      • Select subscription.
      • Select the existing group.
      • Select location.

    6. Click Access policies, then click Add new, then click Select principal.

    7. Type the application id then select the application, and then click Select.

    8. Select the following key permissions and then click OK.

    9. Go back to Access policies page and click the user name you signed in.

    10. Select the following key permissions and then click OK.

    11. Click OK in Access policies page.

    12. Click Create in create key vault page.

  2. Configure encrypt columns for database.

    Prerequisites: SQL Server Management Studio version 13.0.700.242 or later.

    1. Open SQL Server Management Studio.

    2. Connect to the database.

      Note: You can find the server name, login name and password from the connection string in application settings page in Azure.

    3. Expand the database and table, then right click on SourcePoints, then select Encrypt Columns.

    4. Click Next in Introduction page.

    5. Select the encryption type and key as below and then click Next.

    6. Configure master key and then click Next.

      • Select auto generate column master key.
      • Select Azure Key Vault.
      • Select subscription.
      • Select the key vault you created.

    7. In the Run Settings page, select Proceed to finish now and then click Next.

    8. In the Summary page, click Finish to verify that the settings are all correct and then click Close to complete the setup for Always Encrypted.

    9. Right click on PublishedHistories and then select Encrypt Columns.

    10. Click Next.

    11. Select the encryption type and key as below and then click Next.

    12. Click Next in Master Key Configuration page.

    13. Select proceed to finish now and click Next in Run Settings page.

    14. Click Finish in Summary page.

Encrypt string

  1. Open the project using visual studio 2015 if you already download it.

  2. Set ContosoO365DocSync.EncryptTool as StartUp project, and press F5.

  3. A encrypt tool window will be displayed.

  4. Encrypt string

    • Enter the source string

    • Click encrypt string button

    • Copy and store the encrypted string

Encrypt the database connection string

  1. Go to the resource group in Azure portal.

  2. Go to the SQL database.

  3. Obtain and store the server address and catalog name.

  4. Edit the connection string below and then store it.

    Data Source=<server address>;Initial Catalog=<catalog name>;User Id=<administratorLogin>;Password=<administratorLoginPassword>;MultipleActiveResultSets=False;Encrypt=True;Column Encryption Setting=Enabled;

    NOTE: You can find the administratorLogin and administratorLoginPassword in step 4 in this section.

    For example: Data Source=tcp:msfincontosoo365docsyncd.database.windows.net,1433;Initial Catalog=contosoo365docsyncd; User Id=contosoo365doc;Password=12345678;MultipleActiveResultSets=False;Encrypt=True;Column Encryption Setting=Enabled;

  5. Encrypt the connection string in this section and then store the encrypted connection string.

Upload the Add-in manifest file

  1. Go to the app for Office add-in management page.

    For example: https://<tenantname>.sharepoint.com/sites/AppCatalog/AgaveCatalog/Forms/AllItems.aspx

  2. Click 'Upload'

  3. Find the app manifest file.

  4. Update the manifest file.

    • Update the Id with a new generated GUID and you could refer to the link below on how to generate it. https://guidgenerator.com/online-guid-generator.aspx

      Note: please generate new GUID for the Word manifest file.

    • Update the display name and description default value to ContosoO365DocSync.

    • Update the icon url default value to the one provisioned in Azure.

      For example: https://<webSiteName>.azurewebsites.net/Images/logo.png.

      Note: You can find the webSiteName in step 4 in this section.

    • Update the hosts to the following elements.

    <Host Name="Workbook" />
    <Host Name="Document" />
    <Host Name="Presentation" />
    
    
    • Update the source location default value to the one provisioned in Azure.

      For example: https://<webSiteName>.azurewebsites.net/Home/Index.

    Note: You can find the webSiteName in step 4 in this section.

  5. Upload manifest file ContosoO365DocSyncExcel.xml to the SharePoint catalog.

Install Excel Add-in

  1. Open Excel 2016.

  2. Sign in with your O365 account.

  3. Click File | Options

  4. Click Trust Center | Trust Center settings.

  5. Click Trusted Add-in Catalogs | Add catalog URL.

    For example: https://<tenantname>.sharepoint.com/sites/AppCatalog

  6. Restart the Excel.

  7. Click Insert and My Add-ins

  8. Click MY ORGANIZATION and insert the ContosoO365DocSync.

  9. Then the Excel Add-in would be shown on the task panel.

Install Word Add-in

  1. Open Word 2016

  2. Sign in with your O365 account.

  3. Click File | Options

  4. Click Trust Center | Trust Center settings.

  5. Click Trusted Add-in Catalogs | Add catalog URL

    For example: https://<tenantname>.sharepoint.com/sites/AppCatalog

  6. Restart Word.

  7. Click Insert and My Add-ins.

  8. Click MY ORGANIZATION and insert the ContosoO365DocSync.

  9. Then the Word Add-in would be shown on the task panel.

Install PowerPoint Add-in

  1. Open PowerPoint 2016

  2. Sign in with your O365 account.

  3. Click File | Options

  4. Click Trust Center | Trust Center settings.

  5. Click Trusted Add-in Catalogs | Add catalog URL

    For example: https://<tenantname>.sharepoint.com/sites/AppCatalog

  6. Restart PowerPoint.

  7. Click Insert and My Add-ins.

  8. Click MY ORGANIZATION and insert the ContosoO365DocSync.

  9. Then the PowerPoint Add-in would be shown on the task panel.

Run Excel, Word & PowerPoint Add-ins

  1. Work with your O365 admin to go to admin consent page in the browser.

    For example: https://<webSiteName>.azurewebsites.net/Admin/Consent

    Note: You can find the webSiteName in step 4 in this section.

  2. Ensure the WebJob is in running status. Please refer to this section on how to check the WebJob status.

  3. Use the O365 admin account to login and click admin consent button.

  4. Accept the permissions to access SharePoint site.

  5. Open the Excel stored in your O365 document library and open it using Excel client tool then enable editing the Excel and open the Excel add-in.

  6. Use your O365 account to login the Excel add-in and create a source point

    • Click add button.

    • Edit the source point form.

      • Select the range (only one cell is supported, please do not double click the cell. Click Esc if double click the cell.)
      • Click the populating cell address button
      • Select the range (only one cell is supported, please do not double click the cell. Click Esc if double click the cell.)
      • Click the populating cell address button
      • Save the changes

  7. Open a Word document under the same document library where Excel file hosted in O365 site.

  8. Use your O365 account to login the Word add-in and create a destination point.

  9. Select the Excel file hosts the source points.

  10. Put the cursor in the word then select one source point and then click the Add button.

  1. Save the word document and close it.

  2. You could refer to the 2 section on how to view the SQL data and how to view data in the storage account.

  3. Open a PowerPoint file under the same document library where Excel file hosted in O365 site.

  4. Use your O365 account to login the PowerPoint add-in.

  • Click select file button

  1. Select the Excel file hosts the source points.

How to view Azure SQL data?

  1. Login the Azure portal.

  2. Select the SQL Server created in this section.

  3. Click "Show firewall settings".

  4. Add the client IP and save it.

  5. Open Visual Studio 2015 with administrator permission and open "SQL Server Object Explorer"

  6. Click Add SQL Server and the select the database and connect it.

    • The Server name will be automatically filled after selecting the DB.

    • Fill the correct DB.

    • Fill the correct Authentication Type, SQL Server Authentication.

    • Fill the User Name/Password created in this section.

    • The Database Name will be automatically filled.

    • Expand the tables under the database.

    • View the table data by clicking view data.

How to view data in the storage account?

  1. Login the Azure portal.

  2. Select he storage account created in this section.

  3. Get the access keys.

    • Select Access keys under the settings in the storage account.

    • Copy/Store the access key.

  4. Download the Azure Storage Explorer.

  5. Use a storage account name and key to connect it in Azure Explorer Explorer.

    • Connect to Azure Storage.

    • Copy the storage account name and access key from the step 3 above and fill them in the form below.

    • Click Next and then click Connect.

  6. Check the queue/table.

    • The publish queue & publish table is created under the queues/tables.

      NOTE: The publish queue and table will be created when you publish source point in Excel add-in. So please publish the source point before to check the queue and tabe.

    • Check the data in the queue.

      If there is one item in the queue, then there is one source point that needs to be proceeded.

    • Check the data in the table.

      If the status value is InProgess, it means the item is still processing. (UI shows the progress bar)

      If the status value is Completed, it means the item is proceed completed(UI shows the notification saying process succeeded)

      If the status value is Error, it means there is some error processing this item(UI shows the error notification.)

How to check WebJob status?

  1. Login the Azure portal.

  2. Select website created in this section.

  3. Go to the WebJobs under the website.

  4. Ensure the WEBJOB status is running.

Build and Debug locally

  1. Open the project using Visual Studio 2015 if you already download it.

  2. Set as debug mode for the project.

  3. Build the project and make sure all projects build succeeded.

  4. Create a new Azure AD App for the web.

  5. Update the web.config.

    • Update app setting in web.config

      App setting key Value Update web.config or not Update web.debug.config or not
      ida:ClientId Client ID value get from step 4 Yes Yes
      ida:TenantId Tenant ID value get from step 4 Yes No
      ida:ClientSecret Client Secret value get from step 4 Yes No
      ida:PostLogoutRedirectUri https://localhost:44394/ Yes Yes
      ConsentResource https://<yourtenantname>.sharepoint.com Yes No
    • Update connectStrings in web.config using the value below

      • Update the [SQL Server Name] to the SQL server name created in step 4 in this section

      • Update the [Database Name] to databaseName created in step 4 in this section

      • Update the [User ID] to administratorLogin created in step 4 in this section

      • Update the [Password] to administratorLoginPassword created in step 4 in this section

      connectionStrings value Update web.config or not Update web.debug.config or not
      connectionStrings connectionString="Data Source=tcp:[SQL Server Name].database.windows.net,1433;Initial Catalog=[Database Name];User Id=[User ID];Password=[Password]" providerName="System.Data.SqlClient" Yes No

      Note: Ensure the client IP is allowed to access this SQL server in Azure Portal.

  6. Update the JavaScript file to support the local debug for Excel add-in.

    • Make sure that an Excel file is uploaded to the document library in SharePoint site within your tenant.

    • Copy the Excel file link and update link in Point.js in line 59.

       that.filePath = window.location.href.indexOf("localhost") > -1 ? "https://<yourtenantname>.sharepoint.com/Shared%20Documents/Book.xlsx" : Office.context.document.url;
  7. Update the JavaScript file to support the local debug for Word add-in.

    • Make sure that an Excel file is uploaded to the document library in SharePoint site within your tenant.

    • Copy the Word file link and update link in Point.js in line 68.

      that.filePath = window.location.href.indexOf("localhost") > -1 ? "https://<yourtenantname>.sharepoint.com/Shared%20Documents/Test.docx" : Office.context.document.url;
  8. Update the JavaScript file to support the local debug for PowerPoint add-in.

    • Make sure that an PowerPoint file is uploaded to the document library in SharePoint site within your tenant.

    • Copy the PowerPoint file link and update link in Point.js in line 77.

      that.filePath = window.location.href.indexOf("localhost") > -1 ? "https://<yourtenantname>.sharepoint.com/Shared%20Documents/Presentation.pptx" : Office.context.document.url;
  9. Set ContosoO365DocSyncExcel as StartUp project, and press F5.

    • Work with your O365 admin to go to admin consent page in the browser.

      For example: https://localhost:44394/Admin/Consent

    • Use the O365 admin account to login and click admin consent button.

    • Accept the permissions to access SharePoint site.

    • Open the Excel add-in in your local.

    • Click add and edit the source point form.

      • Select the range (only one cell is supported, please do not double click the cell. Click Esc if double click the cell.)

      • Click the populating cell address button

      • Select the range (only one cell is supported, please do not double click the cell. Click Esc if double click the cell.)

      • Click the populating cell address button

      • Save the changes

      Note: By default, you could debug the JavaScript file by setting the breakpoint in it.You could also attach the process to debug the web application code when click save. This is same for debugging the Word add-in.

  10. Set ContosoO365DocSyncWord as StartUp project and press F5

  • Open the words add-in in your local.

  • Click add and edit the destination form.

  • Select the Excel file hosts the source points.

  • Put the cursor in the word then select one source point just created and then click the Add button.

  1. Set ContosoO365DocSyncPowerPoint as StartUp project and press F5
  • Open the PowerPoint add-in in your local.

  • Click select file and browse source point file.

  • Select the Excel file hosts the source points.

Understand the code

Excel Data Flow

Word Data Flow:

Components:

  1. Web Project ContosoO365DocSync.Web

    • SourcePoint Controller

      ContosoO365DocSync.Web\Controllers\SourcePointController.cs

      • Create source point:

        [HttpPost]
        [Route("api/SourcePoint")] 
        public async Task<IHttpActionResult> PostAsync([FromBody]SourcePointForm sourcePointAdded)
      • Get source point

        [HttpDelete]
        [Route("api/SourcePoint")]
        public async Task<IHttpActionResult> DeleteSourcePointAsync(string id)
      • Update source point

        [HttpPut]
        [Route("api/SourcePoint")]
        public async Task<IHttpActionResult> EditSourcePointAsync([FromBody]SourcePointForm sourcePointAdded)
      • Delete source point

        [HttpPost]
        [Route("api/DeleteSelectedSourcePoint")]
        public async Task<IHttpActionResult> DeleteSelectedSourcePointAsync([FromBody]IEnumerable<Guid> seletedIds)
    • DestinationPoint controller

    ContosoO365DocSync.Web\Controllers\DestinationPointController.cs

    • Create destination point.

      [HttpPost]
      [Route("api/DestinationPoint")]
      public async Task<IHttpActionResult> Post([FromBody]DestinationPointForm destinationPointAdded)
    • Get destination point

      [HttpGet]
      [Route("api/DestinationPoint")]
      public async Task<IHttpActionResult> GetDestinationPointBySourcePoint(string sourcePointId)
    • Delete destination point

      [HttpDelete]
      [Route("api/DestinationPoint")]
      public async Task<IHttpActionResult> DeleteSourcePoint(string id)
    • Get Graph access token

      [HttpGet]
      Route("api/GraphAccessToken")]
      public async Task<IHttpActionResult> GetGraphAccessToken()

    • Authentication

      • Open ID Authentication

        ContosoO365DocSync.Web\App_Start\Startup.Auth.cs

      • Get graph token.

      AuthenticationResult result = authContext.AcquireTokenByAuthorizationCode(code, redirectUrl, credential, resourceId);
      AuthenticationHelper.token = result.AccessToken;

  2. Service project ContosoO365DocSync.Service

    • ContosoO365DocSync DB context

      ContosoO365DocSync\ContosoO365DocSync.Service\ContosoO365DocSyncDbContext.cs

    • SourcePoint Service

      ContosoO365DocSync\ContosoO365DocSync.Service\SourcePointService.cs

      • Create source point

        public async Task<SourcePoint> AddSourcePointAsync(string fileName, SourcePoint sourcePoint)
      • Get source points

        public async Task<SourceCatalog> GetSourceCatalogAsync(string fileName)
      • Edit source point

        public async Task<SourcePoint> EditSourcePointAsync(int[] groupIds, SourcePoint sourcePoint)
      • Delete source point

        public async Task DeleteSelectedSourcePointAsync(IEnumerable<Guid> selectedSourcePointIds)
    • Destination point Service.

      ContosoO365DocSync\ContosoO365DocSync.Service\DestinationService.cs

      • Create destination point
         public async Task<DestinationPoint> AddDestinationPoint(string fileName, DestinationPoint destinationPoint)
      • Get destination points
         public async Task<DestinationCatalog> GetDestinationCatalog(string fileName)
      • Delete destination point
         public async Task DeleteDestinationPoint(Guid destinationPointId)

  3. Entity project ContosoO365DocSync.Entity

    • SourcePoint entity.

      ContosoO365DocSync\ContosoO365DocSync.Entity\SourcePoint.cs

    • DestinationPoint

      ContosoO365DocSync\ContosoO365DocSync.Entity\DestinationPoint.cs

  4. WebJob project ContosoO365DocSync.WebJob

    • Document Service

      ContosoO365DocSync\ContosoO365DocSync.Service\DocumentService.cs

      • Download the document

        static private async Task<Stream> GetFileStreamAsync(string authHeader, string destinationFileName, FileContextInfo fileContextInfo)
      • Upload the document

        static public void UpdateStream(IEnumerable<DestinationPoint> destinationPoints, string value, Stream stream, DocumentUpdateResult updateResult)
    • Azure Storage Service

      ContosoO365DocSync\ContosoO365DocSync.Service\AzureStorageService.cs

      • Get Queue

        public CloudQueue GetQueue(string queueName)
      • Get Table

        public CloudTable GetTable(string tableName)
      • Write a message to the queue.

        public Task WriteMessageToQueue(string queueMessage, string queueName)

Questions and Comments

  1. If you have any trouble running this sample, please log an issue.
  2. Questions about Microsoft Graph development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged with microsoftgraph.

Contributing

We encourage you to contribute to our samples. For guidelines on how to proceed, see our contribution guide.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Copyright (c) 2017 Microsoft. All rights reserved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.