PowerShell error “Run Login-AzureRmAccount to login.” in AzureRM when already logged in

Usually when I’m writing PowerShell scripts I do it from a development virtual machine with a known environment state. However, yesterday I was trying to do something simple and quick and was writing it on my everyday laptop.

My script was using Windows Management Framework 5.0 and I was creating a new burn environment in AzureRM. I was authenticated and could query and enumerate most of my AzureRM environment, however I was getting erroneous responses on some cmdlets and was unable to create a new resource group.… [Keep reading] “PowerShell error “Run Login-AzureRmAccount to login.” in AzureRM when already logged in”

Managing SPO User Profiles with FIM/MIM and the Microsoft PowerShell Connector

Back in March, my colleague Darren Robinson published this post which nicely explains how to use Søren Granfeldt’s FIM/MIM PowerShell MA to manage SharePoint Online profiles. While Darren’s post covers everything you need to connect to SPO and manage user profiles via FIM/MIM, some of your clients may prefer to use the Microsoft equivalent for reasons of perceived support and product quality. This post will cover off what is required to get the Connector up and running.… [Keep reading] “Managing SPO User Profiles with FIM/MIM and the Microsoft PowerShell Connector”

Creating Web Tests for Application Insights Programmatically

Azure SDK for .NET provides very useful features to deal with Azure services and resources including Application Insights. With this SDK, we can easily create or update resources for Application Insights and alerts. However, surprisingly this SDK doesn’t provide creating Web Tests resources to check availability. In this post, we will walk through how to create web tests programmatically using C# codes.

Web Tests in Azure Portal

Once an Application Insights instance is created in Azure Portal, we can easily create web tests by following this post, Monitor availability and responsiveness of any web site.… [Keep reading] “Creating Web Tests for Application Insights Programmatically”

Enterprise Application platform with Microservices – A Service Fabric perspective

An enterprise application platform can be defined as a suite of products and services that enables development and management of enterprise applications. This platform should be responsible of abstracting complexities related to application development such as diversity of hosting environments, network connectivity, deployment workflows, etc. In a traditional world, applications are monolithic by nature. A monolithic application is composed of many components grouped into multiple tiers bundled together into a single deployable unit. Each tier here can be developed using a specific technology and will have the ability to scale independently.… [Keep reading] “Enterprise Application platform with Microservices – A Service Fabric perspective”

Office365 & Windows 10 Profile Pictures

At a customer recently, we were asked if we could provide a non-technical way of controlling profile pictures for both Office 365 and Windows 10. So straight away I thought, time for some PowerShell. I came up with the solution of having a number of shares on a server, which can be permission’d as required…

.\Source – for adding images
.\Replace – if a user wanted to change their picture
.\Remove – if a user opted out of the profile picture setup

As this was a new setup, I requested that they name the images UPN.jpg,… [Keep reading] “Office365 & Windows 10 Profile Pictures”

Mocking ADAL for Unit Tests

Active Directory Authentication Library (ADAL) provides developers with great experiences to easily integrate Azure Active Directory (AAD) with their application for authentication and authorisation. With minimum efforts, we can implement OAuth authentication against AAD, using ADAL. However, in the unit testing world, it’s not that easy to test application when the application uses ADAL because ADAL is not unit-testable. We don’t test ADAL itself, but we do need mock it to test applications using ADAL. In this post, we are going to implement how to implement wrapper classes for ADAL’s AuthenticationContext, AuthenticationResult and DeviceCodeResult.… [Keep reading] “Mocking ADAL for Unit Tests”

Converting Web.config values into enum or List

While developing .NET applications, we always look for configuration values stored in either Web.config or App.config. We can simply use the <appSettings>…</appSettings> section which is converted to a dictionary or key/value pair object. Can we use a strongly-typed object for the configuration? Yes, we can. With the <configSections>…</configSections> node, we can convert configuration values into strongly-typed objects. This is a very useful feature in most cases. However, what if we have requirements like:

  • I want to convert a string value into an enum value, regardless of the case sensitivity.
[Keep reading] “Converting Web.config values into enum or List”

Creating self-signed certs using OpenSSL on Windows

ssl

Working with Linux technologies exposes you to a huge number of open source tools that can simplify and speed up your development workflow. Interestingly enough, many of these tools are now flooding into the Windows ecosystem allowing us to increase the portability of our development assets across multiple operating systems.

Today I am going to demonstrate how easy it is to install OpenSSL on Windows and how simple it is to quickly create self-signed certificates for our development TLS needs that will work on a range of operating systems.… [Keep reading] “Creating self-signed certs using OpenSSL on Windows”

Using Microsoft Azure Table Service REST API to collect data samples

Sometimes we need a simple solution that requires collecting data from multiple sources. The sources of data can be IoT devices or systems working on different platforms and in different places. Traditionally, integrators start thinking about implementation of a custom centralised REST API with some database repository. This solution can take days to implement and test, it is very expensive and requires hosting, maintenance, and support. However, in many cases, it is not needed at all.… [Keep reading] “Using Microsoft Azure Table Service REST API to collect data samples”

Azure WebJobs with .NET Core RC2

With .NET Core RC2, publishing Azure WebJob is a little bit different from the traditional(?) way, even it’s different from what RC1 does. In this post, we’ll walk through how to publish Azure WebJob using a .NET Core RC2 console application.

Sample code can be found at https://github.com/devkimchi/.NET-Core-for-Azure-WebJob-Sample.

Sample Hello World Console Application

OK. First thing’s first. Let’s create a console app using .NET Core RC2. Take the latest copy from the repository above and build it on your local machine.… [Keep reading] “Azure WebJobs with .NET Core RC2”