SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL
SharePoint, Office 365, Azure, and Front end JS geek. – Chicago IL

VIDEO – Secure WebAPI with AzureAD

I recorded a quick getting started video for this Microsoft GitHub sample.   Walks through all the steps and even shows the SQL Local DB storage and how to verify security with Fiddler Composer sending test HTTP traffic. 

This pattern is a great way to enhance Officer 365 SharePoint team sites with advanced functionality.   Host AngularJS single page application (SPA) on the front end along with an Azure AD secured WebAPI backend.   Lots of potential for replacing traditional WSP farm solutions with new cloud development patterns.

Enjoy! 

shades_smile

 

Source Code

https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp-dotnet-webapi

 

Video

  • Laura S

    how do you get the initial localdb database? I checked the GitHub source code and the mdf file is missing? Is there a step to create the DB from code?

    • Hey Laura,

      Good question. The original developer who made ToGoAPI uses LocalDB for temp SQL storage. As best I understand, when we press F5 it makes a blank MDF and when we stop Visual Studio it is removed again.

      Check out line 12 of web.config

      https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp-dotnet-webapi/blob/master/ToGoAPI/Web.config#L12

      There are CMD line utilities to create/delete LocalDB SQL files too.

      https://docs.microsoft.com/en-us/sql/relational-databases/express-localdb-instance-apis/command-line-management-tool-sqllocaldb-exe

      • Laura S

        Thanks for the prompt reply. I created the instance, but the database is not created when I debug or run the solution.

        C:Userslipenade>sqllocaldb i “LocalDb”
        Name: LocalDb
        Version: 13.1.4001.0
        Shared name:
        Owner: domainuser
        Auto-create: No
        State: Running
        Last start time: 9/11/2017 10:18:02 AM
        Instance pipe name: np:\.pipeLOCALDB#0E4F5084tsqlquery

        Am I missing something? Where is this mdf file created? In the App_Data folder?

        Thanks again.

        • Great question, not sure. I noticed something similar a few years back.

          Have you tried “SqlLocalDB -delete”? Purge and reset? That may help remove any old settings/files so that VS F5 can make a fresh one.

          • Laura S

            I actually modify the connection string to use SQL Express and added write permissions to the App_Data folder. That solved the issue and I see the database created each time the project runs. It works now. Thanks for the help!

          • Awesome Laura!

            SQL Express is my favorite. Use it for rapid prototyping, always running on my laptop. I can troubleshoot what I can see.

            Great thread. Make a YouTube video of the fix next time and I’ll cross link. Cheers. =)

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲