Thursday, March 24, 2016
Processing JSON from REST query into SharePoint list with Nintex
Thursday, March 3, 2016
Create a REST service SQL Database!
- Right click "Models" choose "Add" "New Item"
- Choose "Data" : "ADO.NET Entity Data Model". Give it a good name
- Choose "EF Designer from database" then Next

- Choose/Create your Azure data connection. Next.
- Choose the database table you want to expose.
- Click Finish
- You should see a new .edmx file. Make sure it's in your Models folder (move it if nec).
- You should also see in you Server Explorer under "Data Connections" a new .nnnEntities entry.
- Open the web.config, you should see 2 data connections. One will be "DefaultConnection" that is pointing locally. Change its value to the other one which should be pointing to azure.
- Rebuild solution.
- Now right click "Controllers"
- Choose "Add" : "Controller"
- Choose Web API 2 ... using Entity Framework
- Choose the model class that was auto created earlier
- Choose the Data Context Class that matches the entity in your data connections.
- Click Add
- Rebuild
- Run in debug mode
- Click API at the top. You should see some documentation about your new stuff!
- Project: Manage NuGet Packages
- Search for Swashbuckle and install the package name "Swashbuckle"
- Rebuild and run
- add "swagger" to the URL. Something like "http://localhost:53691/swagger"
- Done!
Using MS Azure to create an ODATA/REST API for SharePoint Online
Nothing's as easy as it looks. Especially with Azure. Most of the articles I read have functionality that no longer exists in Azure or has different screens than I see. Makes for a good exercise to figure things out though.
Use case: wouldn't it be nice to have a public web app that could interact with your locked down SharePoint online? YES! For instance, have a potential service providers fill out a form with all their qualifications on a public site, then process these forms in SharePoint Online (SPO). Or a simple custom way to request access to your SPO. I organize a tennis league with SPO and will start using an Azure web app with REST to deal with requests for joining the league.
How to do it? We use a cool and expensive product at work called ServiceNow that opened my eyes to the possibilities. I can report off of it with HighCharts using REST calls. Got me thinking that a nice "database in the cloud with REST services attached" would be awesome. I searched for some free ones but never pulled the trigger. New projects at work got me involved with Visual Studio (VS) again. It's been a few years, lots new there. I discovered "LightSwitch" applications. The no-code little wonders will generate a fully functional atom ODATA service layer for a SQL server database. No code required. Sweet!
I got it working on my local machine pretty fast. End to end in 5 minutes really. Getting it "on the cloud" wasn't as easy as clicking "Publish" like I hoped though. After creating an azure web app and sql database and putting that in the publish tool, it wouldn't work. I don' think the db got copied.
Here's what you do:
1. Create the web app in Azure. Easy
2. Create the SQL database in Azure. Easy.
a. Gotcha #1:Create a firewall rule for your DB, allowing your local IP access to it.
3. Connect to your azure db from VS and design a table(s) locally.
4. Connect to the db in your LightSwith app
5. Test it.
6. If it works, now deploy it. It should work because the db is already there.
Integrating with SPO
1. Gotcha #2: You will have to add control-access-header to your web apps web.config file!
a. Use FTP to get access to the azure web app web.config
b. Add the HTTPProtocol section!
2. Write some javascript in SPO to grab the data using REST/json!
3. Done!
I will add more details to this post later.