Skip to content

Instantly share code, notes, and snippets.

View ramandeep-singh-1983's full-sized avatar
💭
Seems like a case of the Mondays Peter!

Ramandeep Singh ramandeep-singh-1983

💭
Seems like a case of the Mondays Peter!
View GitHub Profile
IoT data type Azure solution
Events/Notifications Event Grid
Telemetry Event Hub
Twin change events Event Hub
Life-cycle events Event Grid or Event Hub (if ordering of events is critical)
Criteria Event Grid IoT Hub Message Routing Event Hub Service Bus Topics
Event delivery mechanism (Push/Pull) Push Push Pull Pull
Supported sources Life-cycle events Life-cycle events Life-cycle events Life-cycle events
Telemetry Telemetry Telemetry Telemetry
Device twin change events Device twin change events Device twin change events
Digital twin change events Digital twin change events Digital twin change events
Supported targets Webhooks Event hubs Acts as an event sink and requires consumers to pull data from it. SDKs in various languages are provided for the same. Acts as a queue and requires consumers to pull data from it. SDKs in various languages are provided for the same.
Storage queues Service bus queues
Event hubs Service bus topics
Hybrid connections (Enterprise WebSocket) Storage containers
@ramandeep-singh-1983
ramandeep-singh-1983 / package.json
Created January 18, 2019 08:25
Sample package.json for TypeScript NodeJS server
{
"name": "my-node-server",
"version": "0.0.1",
"description": "TypeScript NodeJS Server",
"main": "src/index.js",
"scripts": {
"tsc": "tsc",
"dev": "ts-node-dev --respawn --transpileOnly ./src/index.ts",
"prod": "tsc && node ./dist/index.js",
"start": "node index.js"
@ramandeep-singh-1983
ramandeep-singh-1983 / tsconfig.json
Created January 18, 2019 08:22
Sample tsconfig.json for a node.js server
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"outDir": "./dist",
"removeComments": true,
/* Strict Type-Checking Options */
"strict": true,
"noImplicitAny": false,
@ramandeep-singh-1983
ramandeep-singh-1983 / node-server.js
Created January 17, 2019 09:21
Sample node.js server code for Keycloak based authentication
var Keycloak = require('keycloak-connect');
var fs = require('fs');
var express = require('express')
var session = require('express-session');
var https = require('https');
var atob = require('atob');
const path = require('path');
var cors = require('cors');
const HOST = 'my-awesome-sauce-app.com';
@ramandeep-singh-1983
ramandeep-singh-1983 / keycloak.json
Created January 17, 2019 09:17
Sample keycloak.json for authentication through a node.js server
{
"realm": "my-awesome-organization",
"auth-server-url": "https://keyclock.server.com/auth",
"ssl-required": "external",
"resource": "ent/my-awesome-sauce-app",
"credentials": {
"secret": "400d2010-d3gf-43h7-h13y-7785e1f8373g"
}
}
/// <summary>
/// Retrieves the access token required to access the Power BI Pro account data.
/// </summary>
/// <returns>Access token required to access Power BI reports</returns>
/// <response code="200">OK</response>
/// <response code="401">Unauthorized</response>
// GET: api/reports/accessToken
[HttpGet]
[Route("api/reports/accessToken")]
public async Task<IHttpActionResult> GetAccessToken()