[Azure] Debugging Azure Functions: could not register URL

It’s still in the works, but the Azure Functions team released a preview version of the “Visual Studio Tools for Azure Functions”. At this time, you’ll need VS2015 Update 3 installed to get this to work, check out https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/ for further instructions.

So all excited I downloaded the tools, installed them and created my first local Function to debug from Studio. Unfortunately, it didn’t work. I got two command prompt windows which disappeared after a short while. No error, no debug, nothing. Hmmm….

A good next step is to run the functions CLI locally. You’ll need to have the CLI installed for this. Simply head over to the folder where you’ve just created your project and run “func host start”. In my case, this resulted in the following error:

“HTTP could not register URL http://+:7071/. Your process does not have access rights to this namespace”

You can assume that Visual Studio is facing the same issue, as it is also using the CLI underwater to host the functions. So what now? I found that the following command will list all of the registered http services:

Check that http.txt file and you’ll see there probably is an entry for http://+:7071/ in there.  I had nothing running on that port as far as I was aware so I decided to simply delete the reservation:

And there you go, the port is now freed up and both the CLI as well as debugging from Visual Studio (not at the same time, obviously) started working! 🙂

[Azure] Using an Azure Function to create custom Flow actions

If you’re working with Microsoft Flow, chances are that on some point in time you’ll run into a situation where the action you need simply doesn’t exist. If you’re a developer with skills to write C#, PowerShell, Node or even batch code, you’re in luck! Cause why not create that action yourself in the form of an Azure Function? Here’s how to do it.  (more…)

[Azure] Using multiple accounts side-by-side with Chrome

If you’re in the Microsoft Azure or Office365 space, chances are that you have a couple of accounts that you use to access these services. Your company account, MSDN subscription, maybe some customer accounts, a couple of demo tenants, etc. You’ll also know that switching between account is quite a bitch. You need to log out, log in again, lose all of your session cookies and automatically log out from other services as well. Pretty annoying.

If you’ve got Chrome installed, you’ve got the answer sitting right there on your desktop already. Open up the settings window and find the “People” section. This allows you to create multiple profiles for different users. The nice thing is that these users do not share any cookies or other session data. So a Chrome instance for user A does not interfere with a second instance for user B. It’s like running InPrivate mode, but without the need to log in again each time you fire it up.

chrome_accounts

Super simple trick, but a real time saver so I thought I’d share. Enjoy!

[IoT] How Azure IoT would have prevented a DDoS

Two weeks ago, parts of the Internet came to a halt due to a DDoS attack. DDoS attacks have become pretty common these last few years, but usually target a specific website. For instance, attackers might target microsoft.com and start firing enormous amounts of requests to it. Due to the load, the website will eventually choke and stop responding to both the malicious as to normal requests, with the result that the website is “down”.

There were two things that made this DDoS attack a bit different:

  1. This attack was not targeting a website or webservers, but instead DNS servers. DNS is used for address resolution, which comes down to translating a normal URL (like www.repsaj.nl) to an IP address. By targeting DNS servers, the attackers managed to bring down lots of sites at once, with your PC left unable to find the correct IP address for the website you requested. So in this case, the webservers were fine but the clients didn’t have a way to reach them.
  2. The attack was largely carried out using IoT devices. This included IP-connected webcams for instance, which many people have at home.

This uncovers a large security issue with lots of IoT devices, which could have been easily prevented (or at least a lot better secured) using a back-end like Azure. Let’s find out how… (more…)

[Azure] AAD “You do not have permission to view this directory or page.”

I ran into this error debugging my Cordova app from Visual Studio, running the debugger locally instead of on my device. After logging into Azure Active Directory with valid credentials, the page would display this error:

“You do not have permission to view this directory or page.”

As this was the second time I had to figure out how to solve it, thought I’d do a quick post on it for my own future reference 🙂  (more…)

[IoT] Limiting per device messaging & auto reset

This entry is part 9 of 9 in the series Azure Aquarium Monitor

In my aquarium monitor series I showed how to build an application to monitor a fish tank. The use of the Azure IoT components allow us to easily build these kinds of solutions based on generic components. It also allows us to scale, which makes it very suitable for scenarios with lots of devices or data.

Should you want to make your application multi-tenant, there’s no reason why you shouldn’t… or is there? What if you don’t have complete control over the clients and someone starts to send way more data then expected? Hmm…  (more…)

el_logo

Speaking at Experts Live 2016

Thrilled to announce that my session has been selected for Experts Live 2016. As the website says: “Experts live is THE event covering Microsoft Azure, Office365, Enterprise mobility suite, Operations management suite, Hyper-V and Windows”. I will be bringing a little IoT to the mix with my session on how I used Azure IoT components to build submerged. Join me November 22nd, live!

 

How I built Submerged with Azure Functions, IoT and Stream Analytics

 

Tickets are on sale now, get yours now.

Preliminary session planning: 14:45 – 15:45, Room 3

 

 

[Azure] Logging out of Azure AD oauth

In a previous post you can read how I used Apache Cordova to create a client application that is linked to my back-end API hosted in Azure. For authentication, I made use of the built in authentication options of the Azure Mobile Apps plugin for Cordova (GitHub).  This plugin simplifies the authentication flow process, which uses server flow in this case. Basically that means that our Web API handles most of the flow by configuring the Microsoft.Azure.Mobile.Server.Authentication NuGet package. There is also client flow, where the flow is handled client-side, for more info on that check out the great blog series by Adrial Hall on Azure Mobile Apps. (more…)

[Azure] Custom Function bindings + notification tags in Cordova apps

Previously I explained how I am using an Azure Notification Hub to send out notifications to a mobile application made with Cordova (read it here). This is cool, but in that scenario every notification was being sent out to every client. This is fine for some situations but in most cases you probably want some mechanism to send out notification to specific devices or a group of people. The most used example is news: you subscribe to a couple of subjects and receive only notifications for messages linked to one of those subjects. This post details how you can achieve this.  (more…)

[Azure] Adding more intelligence to Stream Analytics queries

If you’ve read my previous blog on Azure Stream Analytics, you know how Stream Analytics can be used to process all sorts of incoming data and send the end result to one or multiple outputs. This is particularly useful for ensuring the right data is saved, manipulating the data before saving or only filtering out data in which you’re interested. And that last category is what I used it for: notifications! The query I used previously is not very dynamic, here’s a snippet:

Works, but what if we start adding more sensor values? Hmm, we’d need to change the query each time. Not really what we want to do, right? Time for a better solution.

(more…)