Skip to main content

Posts

Showing posts from December, 2017

Azure SQL Data Sync | Tips and Tricks

In this post we will talk about things that you should know and take into account when you want to use SQL Data Sync from/to Azure SQL.

What is SQL Data Sync
It’s a synchronization service offered around Azure platform that is allowing us out-of-the-box to synchronize multiple databases that can be inside Azure or on-premises. SQL Data Sync it is one of the services that makes our lives 10x time easier.
The coolest thing on this service is that you can make the configurations from Azure Portal. This is useful especially when you want to try the service or make a fast configuration. From UX perspective, the experience is wonderful and when you want to automate the process, you  can use PowerShell.

Base Concepts
Synchronization Group represents a groups of databases that you want to keep in sync. You’ll have all the time a Master database used to sync between all the other databases. In the Master-Slave topology, the Slaves are called Sync Members and  the master is called Hub.

For on-pre…

IoT Home Automation | Device tracking capabilities

In the last post, I talked about how I connected the yard gates to the IoT Home solution that I started to develop. Unfortunately, I was not able yet to connect the Paradox alarm system to the solution. It’s not clear for me how to connect the relay as a keyswitch zone, but I hope next weeks to receive some help and resolve the near future.

Why?
Because the WiFi connection is not stable, there are times when I lose the connection to the devices. This can be annoying, especially because I do not have yet a tracking mechanism that can provide me information related to the current device state.
I decided to enhance my solution with tracking capabilities. Until now I didn’t add any logs to the solution because I wanted to see exactly where and what kind of data I should collect. Easily you can add logs capabilities to the system and end up with a bunch of logs that you don't need it.

What?
In day to day use I observed that I need the following information:

When was the last time when the…

Demystify how Shared Access Signature (SAS) is created inside Azure Storage

In this post, we will take a look on how Shared Access Signature (SAS) is generated. We would like to understand: How such a signature is generatedWhat are the inputs that are required for it What does the signature contains I assume that you have base the knowledge’s related to SAS. If not I would recommend to read the following introduction before - https://docs.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1
What does the SAS signature token contains? This signature (token) is just a specific HMAC (keyed-hash message authentication code) generated using SHA256 hashing algorithm. There is no magic behind it. Inside this token all the relevant information related to access permissions, expiration date and many more are ‘hashed’. By ‘hashed’ I understand a hash that is generated from the string that contains in clear text all the information related to SAS together with storage account key. For example, for the below SAS string 1SAS String = sv=201…

IoT Home Automation | Connecting Yard Gates (Beninca and ESP8266 controller)

I continue the journey of home automation using ESP8266 and Arduino with yard gates. In the last post related on this topic, I have done the base automation of the garage doors.

Welding
From this perspective, nothing special. Except welding the pines of ESP8266 and relay and putting one of top each other I was done. I prefer to use relays shields that can be added one on top each other allowing you to mount the controller fast and without additional welding or wires.

Arduino Code
In theory, the code should be similar to the garage doors automations. The base idea was the same, using HTTP code to decide if we need to close or open a circuit controlled by the relay.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70#include <Arduino.h>#include <ESP8266WiFi.h>#include <ESP8266HTTPClient.h>#ifdef ESP8266extern"C&…

IoT Home Automation | Connecting Garage doors (Beninca and ESP8266 controller)

Now, it’s the moment to talk about how I managed the ESP8266 together with Arduino. In the last post on this subject, we talk about high-level architecture and the backend components.

Welding
From the hardware perspective I realize that it is more simple to stick two relays on a board where I would also weld the ESP8266. The relays that I had can be controlled only on D1 pin. Considering this, I decided to use D3 pin on ESP8266 and redirect it to the second relay. Both relays needs to be connected to the GND and 3.3V pins of the ESP8266 board.
If you have, a development board try to play with it before doing the final welding. I was too existed related to the projects and I made the welding first. I was luck, it worked from the first time.
I just started the to learn again how to weld, so ignore my skills. As a coworker told me "If it works, it ain't stupid".

The other option would be to create a tower of two relays and ESP8266 on top of each others, but I did not liked h…

Configure Azure AD authentication for a web app (App Services)

In this post I will describe the basic steps that needs to be done to configure App Service Authentication using Azure Active Directory.

Out of the box, App Services allows us to put in front of our system an authentication and authorization layer. For basic flows, us described below, the configuration can be done directly from Azure Portal, without having to write a line of code.


Step 1: Enable App Service Authentication
This step can be done directly from Azure Portal, from “Authentication / Authorization” tab.
After this, once you specify that you want to use “Azure Active Directory Provider”, do not forget to select “Log in with Azure Active Directory” from "Action to take when request is not authenticated". This is required if you want to not allow anonymous users to access your web app. By selecting this option, you will redirect unauthenticated users to the login page.
Don’t forget to hit “Save” (smile).

Step 2: Create and configure Azure AD Application
This step is don…

Tips and Tricks to prepare a demo for Azure Time Series Insights

Azure Time Series Insights it is a great tool that can be used to monitor in near-real time your systems and get useful insights about what is happening behind a scene.

In this post, we will talk about things that we need to consider before jumping to prepare a demo with it. There are behaviors that are normal when we go with Time Series Insights in production, but when we are preparing a demo or we want to push mocks data inside it can be annoying (especially when we do not understand the behavior).

Context
I had to deliver 2 presentations and 3 demos about Time Series Insights and I learned in the hard way this kind of things, too long nights before the demos. Based on them I made a checklist that I hope to be useful to others also.

1. Ingress of mock events
One of the most important thing that we need to keep an eye on is the moment when we want to push mock data inside Time Series Insights. In general, we want in a short period to push data for a few days or weeks.
There are two tie…

Chart and dashboards from time perspective (real time, near-real time, consolidation)

In this post we will talk about how we can group charts, dashboards and reports in different categories based on how fast we need to be able to ingest and update data inside them.
Time is a relative term especially when you put it together with business insights and application reporting. There are two important aspects related to time from business and application insights perspective.

1. Time Granularity
The first one is related to the time granularity. In the beginning, most of the business stakeholders require the granularity to be as small as possible, until they realize that there is not too much inside of that and that in order to be able to understand something, the time granularity needs to be increased.
Most of the systems that are available now on the market allow us to change the time internal (granularity) on the fly, enabling us to navigate inside our data from a different time perspective.

2. Time Interval
The second aspect is the time interval, from the moment the data a…