How to build a Rest API on Azure for a Documentdb database with Node.js - node.js

I have already created a Documentdb database and now i should build a REST API on Azure with Node.js. I have read the documentation, but i did't understand it good enough.
Cloud services could be a good solution, but if i didn't misunderstand, it is Python and .NET based.
If i want to build a REST API and an user interface voor the REST API, which services should i better use? Web apps? API apps? Or any another product?
https://learn.microsoft.com/en-us/azure/app-service-api/app-service-api-nodejs-api-app

Per Azure's documentation,
An API app can take advantage of features offered by Web Apps and Mobile Apps. The reverse is also true: if you use a web app or mobile app to host an API, it can take advantage of API Apps features such as Swagger metadata for client code generation and CORS for cross-domain browser access. The only difference between the three app types (API, web, mobile) is the name and icon used for them in the Azure portal.
An API app and a Web app will equally work for you. Currently, all of Web, Mobile and API Apps are collectively called App Services. For most scenarios, Web Apps is the best choice.
More on this:
Azure Web API vs Web App
Differences between Azure App Services and Cloud Services

Related

How to connect mobile app ( ionic/angular ) to dynamic crm via azure ad

I was wondering how I could connect a mobile app created in ionic to azure, the app needs to interact with Dynamics CRM where all the data is. My guess is that I have to login via Azure AD , get the token, create API endpoints in Azure ( which service? ) or expose them, nd query the endpoint with the token.
Is this the right workflow?
thanx in advance
You're pretty much on the right track. You can host your API in an Azure App Service. You can also secure it by integrating Azure AD with your app service using your token. This tutorial walks through using a front-end and back-end app and securing communication with it. Since your already have a front-end, you can ignore those steps. Although the same is a .NET Core application, the same applies if you were to write your API in NodeJS or another language.
Hope this helps.

Api Apps Vs Api Management

I am looking for scalable hosting for an API but I am getting a little confused with Azure. Ideally I want something that means I don't have to manage OS updates and security, just deploy my API code.
Is this possible with Azure? What do I need to sign up for?
In general, you are looking for the Platform as a service offer. Check What is PaaS?. For the API deployment you should check the Azure App Services. Azure API Management is for advanced API management or when you want to expose multiple APIs using a single gateway.

azure app service basic api security

I have running the basic todoitem app service running on azure. Calling the below url will display the content in the todoitem table. How can I add basic security to prevent this data from being accessed by anyone, like a basic parameter, ToDoItem?MyToken=12345.
https://MyappService.azurewebsites.net/tables/ToDoItem
How can I add basic security to prevent this data from being accessed by anyone, like a basic parameter, ToDoItem?MyToken=12345.
I would recommend you using the build-in Authentication and authorization in Azure App Service.
App Service supports five identity providers out of the box: Azure Active Directory, Facebook, Google, Microsoft Account, and Twitter. To expand the built-in support, you can integrate another identity provider or your own custom identity solution.
Here are some great tutorials, you could refer to them:
For Node.js backend, you could follow 30 DAYS OF AZURE MOBILE APPS.
For developing azure mobile apps with C#, you could follow here.

Node.js proxy service for DocumentDB

We want to work with Azure DocumentDB from AngularJS SPA. I understand that it's best to have node.js proxy service as a middle tier in between them. I'm a .NET developer and having trouble creating it. Can you point me to any code samples for such proxy?
Azure provides the DocumentDB SDK for C#, you can refer to https://azure.microsoft.com/en-us/documentation/articles/documentdb-get-started/ for how to handle DocumentDB operations in C#.
And then, you can leverage the API Apps in .Net implementing with the DocumentDB SDK for C#, to expose the APIs for your Angularjs SPA.
You can also use APIM (Azure API Management/Gateway) as a proxy or middle tier in between your SPA and DocDB. This way you don't have to code your middle tier but use APIM which is a PaaS service and also provides rich set of functionalities.

Windows Azure Mobile Services management API

Is there any management API in Windows Azure Mobile Services?
For example: methods to create mobile services or data tables.
There's a Mobile Service Management API however it is not publicly available yet. One thing you could do is take a look at the source code for Windows Azure CLI tools and figure out how this API has been implemented. You can view the source code on GitHub: https://github.com/WindowsAzure/azure-sdk-tools-xplat.

Resources