Tuesday, 21 June 2016

How to delete Azure Active Directories that won't delete

As a result of studying for Azure certfications I'd created several Active Directories under my MS Azure subscription. Wanting to clean these up, I attempted to delete these from within the classic portal, only to be greeted with the following message:
 
 
Directory contains one or more applications that were added by a user or administrator.
Clicking through to the applications menu I expected to be able to delete the offending applications. No such options exists, therefore I had a google and found this blog post.

There are a couple of tricks here:

  1. Create a new user with global admin in the active directory (you must delete this later as users also prevent deletion of the Active Directory)
  2. Install the Azure Active Directory PowerShell module
  3. Connect to the active directory using Connect-MsolService and the account you just created
  4. Run Get-MsolServicePrincipal | Remove-MsolServicePrincipal to delete all applications (that can be... expect some errors)
I then deleted the new admin user I created in step 1 and retried the Active Directory delete, hey presto, worked for me.

Hope this helps.

Thursday, 28 April 2016

Microsoft Azure: Differentiating IaaS, PaaS and Cloud Services

I recently realised that there can be some confusion over how an Azure "Cloud Service" can be interpreted in the as-a-service world we now live in.

When you create a VM in the Azure classic deployment model, they are added to a cloud service. A cloud service “acts as a container and provides a unique public DNS name, a public IP address, and a set of endpoints to access the virtual machine over the Internet”.
A VM in this sense can be considered IaaS, the VM being a server in Azure that you have complete control over. The VM just happens to sit in a container called a “cloud service”.

However, you can also create a “Cloud Service” in Azure which results in something different to the above. An Azure Cloud Service consists of 2 components, config files and application files which together result in Web or Worker roles being spun up to execute an application. These roles are effectively VMs, a Web Role is an Azure VM pre-configured to run IIS and worker roles carry out other processing tasks. A Cloud Service in this sense is PaaS, as Azure is managing the VMs for you and you only have limited control over them.