Matching Complex Query String Rewrite Rule in IIS

By | IIS | One Comment

IIS URL Rewrite Doesn’t Find My Query String Rule. Help! I recently had to handle a particular request from a client: They had sent out a newsletter that linked to their site, but had sent the wrong URL. As such, they needed the site to redirect the bad URL to the correct one. The bad URL linked to a page that passed along query string parameters. A simple request and a simple fix, right? Well, as I delved into the site’s rewrite rules, I quickly found out that the URL I needed to match was not matching. Worse still, it…

Read More
Google-Cloud-Platform-UWP-App-Profile-Images

Using Google Services in UWP C# Apps – Part 2

By | Cloud Platform, News | One Comment

This is post 17 of 17 in the series “Google Cloud for the .NET Developer” We previously looked at how you can use the WebAuthenticationBroker to allow end users to authorize a UWP app to access their Google account information. In this post we’ll complete the sample by describing how to authorize a UWP app to access Google Cloud Product services. To demonstrate this, we’ll recreate the ASP.NET MVC sample that logins in a user, grabs their profile image, and uploads that image to Google Storage. However, just like in our previous sample, we don’t have any helper libraries we…

Read More
Google-Cloud-Platform-UWP-OAuth-Sample-Launch-Browser

Using Google Services in UWP C# Apps – Part 1

By | Cloud Platform | No Comments

This is post 16 of 17 in the series “Google Cloud for the .NET Developer” It’s no secret that I love Windows, and especially writing UWP apps for Windows using C#. In fact I’ve written a bit about creating UWP apps in the past, so as a fan of UWP, I wanted to explore how one can leverage the Google Cloud Platform and other Google services in Windows apps. Unfortunately, as of this writing, Google does not officially support UWP. However, this is not to say you cannot USE Google services in your app; it only means that the SDKs available to…

Read More

Redis Caching in the Google Cloud Platform

By | .NET, Cloud Platform | One Comment

This is post 15 of 17 in the series “Google Cloud for the .NET Developer” Caching is one of those solutions that is often added after you realize that there is a performance problem with your system. For example, fetching records from a database may be fast when you are developing locally as the only user. But, in production with hundreds or thousands of simultaneous requests taking place, that disk-based database will soon become a bottleneck. If the data is slowly changing, then there is really no need to hit the database itself after the first read: simply save the data to…

Read More

Cloud Storage Options Part 2

By | .NET, Cloud Platform, Google | 2 Comments

This is a continuation of Cloud Storage Options Part 1, which covers Google Cloud Storage and Google Cloud SQL, both from a .NET developer’s perspective. Part 2 includes the two remaining structured storage solutions offered in GCP: Cloud Datastore and Cloud BigTable, and again focuses on how .NET developers can get started leveraging these storage options for themselves.

Read More

Cloud Storage Options Part 1

By | .NET, Cloud Platform, Google | 3 Comments

If you are a .NET developer looking to integrate with Google Cloud, one of the most basic decisions will be what Google Cloud Storage options make sense for you? When you think cloud storage, don’t just think blob storage, because Google Cloud Platform storage is really much more diverse than that, from basic blob to fully managed MySQL services to different flavors of NoSQL.

Read More

SQL Server in the Google Cloud

By | Cloud Platform, Google, SQL Server | One Comment

If you are planning to or even considering jumping in to Google Cloud Platform and you work with .NET technologies, you’ll almost certainly want to know how to run SQL Server in the Google Cloud. Google Cloud has made a big effort lately to more fully support the .NET stack, including SQL Server. This is good news for everyone, because more options means more chances to find the right fit for your development project!

Read More
GCP Pub/Sub

Pub/Sub Part 2 : REST-based Google Cloud Pub/Sub with OAuth and C#

By | .NET, Cloud Platform, Google | No Comments

This is post 10 of 17 in the series “Google Cloud for the .NET Developer” Pub/Sub is an increasingly popular component of many cloud-driven solutions. Producers publish messages to a topic, and subscribers consume them typically triggering some type of work. Pub/Sub queues are also very important when it comes to high-throughput data ingress, typically synonymous with IoT solutions. I will show you how to publish to and consume messages on the Google Cloud Platform using the REST-based API, authenticated with OAuth and using C#. Getting Started If you haven’t already, create a Google Cloud account (they offer a 60…

Read More

Pub/Sub Part 1 : C# OAuth Authentication to Google Cloud Pub/Sub using a Service Account

By | C#, Cloud Platform, Google | No Comments

This is post 9 of 17 in the series “Google Cloud for the .NET Developer” If you are looking to consume Google Cloud services, you will need to authenticate. In my case, I was looking to use a service account created for a Pub/Sub application that I have in mind. I will walk you through creating a Service Account, downloading a key and authenticating with the Google Cloud Platform using a C# library. The first thing that you will need to do is log into the Google Cloud Platform console (create a project, if you don’t already have one). From…

Read More
Big ear man listening

Understanding Natural Language

By | Cloud Platform, Google | No Comments

This is post 8 of 17 in the series “Google Cloud for the .NET Developer” Isaac Asimov speculated that you could plug a politician’s speech into a mathematical model, zero out the equation, and prove that the politician had said nothing. We know this intuitively, but I never thought you could actually do it. The Natural Language API from the Google Cloud Platform comes close by measuring sentiment found in text. The Natural Language API sentiment score ranges from –1.0 (negative emotion) to 1.0 (positive emotion). Ever watch HGTV? This may sound familiar: “The kitchen is so cramped. I really…

Read More

ConfigSource Your Rewrite Rules

By | .NET, ASP.NET, Web | 2 Comments

When your Web.Config Gets too Big Maintaining a web.config in your ASP.NET application can quickly get out of hand. It contains the bulk of your web application’s settings and configurations, and even the fresh, out-of-the-box version is several hundred lines long. If you have a set of IIS URL Rewrite Rules to maintain in the same file, the web.config can become immense. This is where using configsource can come in handy. Benefits of ConfigSource In my view there are some large advantages to separating your list of rewrite rules out from the web.config file into a separate, configsource-appointed config file….

Read More

Porting Azure Web Apps to Google Cloud Platform (GCP)

By | Cloud Platform, Google | No Comments

This is post 7 of 17 in the series “Google Cloud for the .NET Developer” Introduction So you’ve decided to port your ASP.NET 4.x Azure Web Apps to the Google Cloud Platform (GCP). The only option available today for hosting non-Core ASP.NET in GCP is with Windows Server VMs in Compute Engine. Let’s start by acknowledging that this is a move from a Platform as a Service (PaaS) to Infrastructure as a Service (IaaS), with all the typical tradeoffs: in short, you sacrifice rich features in exchange for increased granularity of control. With that in mind, let’s take a look…

Read More

Google Cloud Platform (GCP) Compute Engine – Windows Server VMs

By | Cloud Platform, Google | No Comments

This is post 6 of 17 in the series “Google Cloud for the .NET Developer” Intro to GCP Compute Engine If you’re a Windows .NET developer, then when you think cloud, your first thought is probably Microsoft Azure. However, Google Cloud Platform (GCP) has a very strong offering for Windows developers as well, starting with one of the most fundamental building blocks of cloud computing: the Virtual Machine (VM). The Google Cloud Platform’s name for VMs in the cloud is Compute Engine. It might be intimidating to step into an arena largely populated by unfamiliar Linux servers and enough foreign…

Read More
Google-Cloud-Platform-Authorize-User-Account

Authenticating Your C# Application for the Google Cloud Platform – Part 2

By | Cloud Platform | No Comments

This is post 5 of 17 in the series “Google Cloud for the .NET Developer” Now that we understand how to authenticate a C# application to work with your own project’s GCP resources, let’s take it a step further. In this post, we’ll look at how we can combine that connectivity with end user data, via three-legged OAUTH authorization, to perform operations on user content, with their permission of course. For this example, I’ve created a very simple ASP.NET MVC project that logs a user in, gets their profile image, and uploads it to a specific bucket. Let’s take a…

Read More
Google-Cloud-Platform-Authorization

Authenticating Your C# Application for the Google Cloud Platform – Part 1

By | Cloud Platform | 3 Comments

This is post 4 of 17 in the series “Google Cloud for the .NET Developer” The new C# libraries for the Google Cloud Platform, available on NuGet, make it easy to get started adding these features to your platform. However, before you can use them, you obviously need to authenticate your application for access. Google uses OAUTH 2.0 as the protocol for authentication In this post we’ll discuss the different scenarios you may encounter, and the different options available for authorizing your application. Server to Server Authentication If you are building an application that is leveraging GCP infrastructure as its…

Read More
Google-Cloud-Platform-Nuget-Pacakges

C# Support for the Google Cloud Platform

By | Cloud Platform | One Comment

This is post 3 of 17 in the series “Google Cloud for the .NET Developer” At the end of the day, like most APIs you encounter in the wild, Google services are exposed as standard REST endpoints. If you know how to create, authenticate, and issue an HTTP request, you have everything you need to add Google’s extensive list of services (including the Google Cloud Platform) to your applications. However, most developers prefer to spend their time focused on the implementation of their application, and would rather skip mucking around with boilerplate code to create raw HTTP requests, serialize requests and…

Read More

Read/Write data from/to USB thumb drive on a Windows IoT Core device

By | .NET, Blogs, C#, Fun, IoT, Microsoft, Multi-Device, News, Raspberry Pi, Visual Studio, Windows Universal Apps | One Comment

Currently, universal apps are sandboxed to the point of blocking you from reading/writing data files to a removable USB drive on Windows IoT Core devices. This post will show you a work around if you really need to do this. Now, understand that this is not for store apps. If you submit an app using this work around, it will likely get rejected. However, for internal projects, it will definitely work, and work well. This is a great way of reading application initialization data and writing log data in a test apparatus and laboratory setting. Particularly when a network or…

Read More

Google Cloud Platform (GCP) Overview

By | Cloud Platform, Google | No Comments

This is post 2 of 17 in the series “Google Cloud for the .NET Developer” The list of products available in Google Cloud Platform, while shorter than the lists from Azure or AWS, can still seem quite daunting. Here’s a quick overview of what’s available in the Google Cloud Platform (GCP) specifically for .NET applications. Compute GCP offers many products under the Compute umbrella, but most are not easily accessible to the Windows Server + IIS + .NET developer. The two main offerings of interest are Compute Engine and App Engine. Compute Engine Compute Engine is the family of services focused…

Read More

Why Organizations should choose GCP – A Business Perspective

By | Cloud Platform, Google | No Comments

Cloud services reduce the effort needed to manage infrastructure, provision servers and configure networks. Today the cloud market is primarily dominated by Amazon Web Services, followed by Microsoft Azure. As the new kid on the block, GCP is the newest entrant to a highly profitable and competitive landscape. In this blog series, the team will discuss GCP services and implementation differences between GCP, AWS, and Azure. This post explores GCP from a business point of view — what to consider when making an informed decision for your organization.

Read More

Breakpoints in Auto-Properties in Visual Studio 2015

By | Visual Studio | No Comments

This tip falls squarely into the category of simple, yet oh so useful. Visual Studio 2015 isn’t exactly new, but I am still discovering things that make it so nice for debugging. That’s where I’ve spent a lot of my time this week, and one thing that has saved me is using Actions on breakpoints to print messages to the console. And surprise! You can do the same thing even when using auto-properties in Visual Studio 2015 without backing fields.

Read More

C# Windows IoT Core Serial Communications with an ESP8266

By | Blogs, C#, ESP8266, git, Hardware, IoT, Microsoft, Multi-Device, News, Raspberry Pi, Visual Studio, Windows Universal Apps | No Comments

Windows IoT Core is great for connecting single board computers such a Pi2 to an ESP8266, via a serial link. The hardware for such a link can be found in my previous post here. The details for a basic serial communication C# framework are detailed in this post. If you have an ESP8266, there are numerous ways of communicating with them such as LuaLoader. However, I needed to communicate with my ESP8266 through a Pi2 running Windows IoT Core. This is part of a larger automated test project for an upcoming consumer project we’re developing. In this post, I’ll cover…

Read More

One-Time Passwords (OTP)

By | .NET, node.js | No Comments

Years ago, I worked for a customer who provided me with a RSA SecurID device to access their VPN. This was a plastic fob that would display a six digit number on a LCD screen. Every 30 seconds, the numbers changed to a different random six digits. To log into their VPN, I had to provide my username and password, plus the current six digit number displayed on the device. So, even if my password was compromised, an attacker still could not get into their VPN without also having that SecurID device. Today, we simply call this Two-Factor Authentication, or 2FA. While plastic fobs…

Read More

Awesome, Text-Based Diagrams with Mermaid

By | Visual Studio Code | No Comments

A picture is worth a thousand words. Plain text can convey high levels of detail, but when there are multiple entities involved, text fails to communicate the relationships between them well. In a recent incident, I needed to explain to myself and others how information flowed between four different actors in a transaction. Oral and written attempts would quickly become confusing because of the difficulty of keeping the state of all the different actors in our heads at once. In comparison, once the transaction was laid out in a diagram, the flow of information immediately become far easier to understand for…

Read More