Microsoft.Compute/disks BadRequest diskDescription.properties.accountType.

Nov 16, 2017. | By: Owen Davies

The latest API Version of the ‘Microsoft.Compute/disks’ resource is: 2017-03-30, I’m currently getting a BadRequest error with this version.

[Read More]

Delete Resource Groups with no resources

Oct 26, 2017. | By: Owen Davies

Due to lots of testing I often end up with orphan Resource Groups in my subscriptions. To save me from having to go into the portal and deleting each Resource Group manually. I’ve created the following powershell script:

[Read More]

Extensionless url with jekyll on azure webapp

Oct 12, 2017. | By: Owen Davies

This blog is built using Jekyll, a static site generator. It’s by far my favourite blogging platform these days. Mostly due to simplicity. There is no database, and once the site is deployed…It’s just pure html files. Very little to manage.

But I want extensionless urls, how can we accomplish this?

[Read More]

Building a Azure Virtual Machine with DSC and specifying a different WMF Version

Oct 5, 2017. | By: Owen Davies

The creation of a Virtual Machine in Azure is quick, surprisingly quick. However, using the DSC extension adds a lot of time. And this makes me sad. I want to see if I can make it faster.

[Read More]

How to Purge Azure CDN with PowerShell

Sep 28, 2017. | By: Owen Davies

I needed a script to purge the CDN of this blog, I have the CDN setup already.

[Read More]

AZCopy - The server returned an error: (407) Proxy Authentication Required

Sep 21, 2017. | By: Owen Davies

AZCOPY is a great little tool for copying and manipulating azure storage. You can find more information about it here

Behind a proxy in a corporate firewall, I get this error.

[Read More]

Azure ARM DSC extension LCM settings rebootnodeifneeded not working

Sep 14, 2017. | By: Owen Davies

The PowerShell DSC extension for Azure Virtual Machines is an immensely useful feature. It allows you to apply DSC configurations against your Azure Virtual Machine.

Unfortuantly the “reboot node if needed” setting just wasn’t working for me.

[Read More]

How to create an Azure Virtual Machine with ARM Template

Aug 11, 2017. | By: Owen Davies

A year ago in this post we created an Azure Virtual Machine using PowerShell instead of using the Azure Portal. This is fairly simple and allows a level of automation. But ARM Templates are simpler and in my opinion easier to source control.

Today lets create the same Virtual Machine, but using ARM this time.

[Read More]

Azure ARM Template Error: Gateway size Default is not supported for gateways of type dedicatedcircuit

Jul 27, 2017. | By: Owen Davies

Trying to create a Virtual Network Gateway to connect a VNet to an already existing Express Route connection.

I kept getting this error:

[Read More]

Free Azure Book

Sep 1, 2016. | By: Owen Davies

https://blogs.msdn.microsoft.com/microsoft_press/2016/09/01/free-ebook-microsoft-azure-essentials-fundamentals-of-azure-second-edition/?utm_source=DNK-167398&utm_medium=DNK-167398&utm_content=DNK-167398&utm_campaign=DNK-167398

[Read More]

Find Azure Virtual Machine dynamic IP Address and RDP into it

Aug 18, 2016. | By: Owen Davies

We have a number of Virtual Machines hosted in Azure that are used for development or testing purposes. Since we don’t need them online 24/7, we have some of them scheduled to turn on during office hours. Other we manually control when we need that particular configuration.

This Virtual Machines have dynamic IP Addresses, so we don’t know where to connect to once the VM has been turned on.

[Read More]

How to create an Azure Virtual Machine with PowerShell

Aug 11, 2016. | By: Owen Davies

So you want to create a Virtual Machine on Azure, this can be done in the portal. But really we want this scriptable, so that we can run it at a later date if needed and also so we can leverage this work and use it to create other virtual machines at a later date.

[Read More]

Login to Azure with PowerShell non-interactively

Aug 4, 2016. | By: Owen Davies

The Login-AzureRmAccount PowerShell command allows you to login to your Azure account from PowerShell. However, it brings up a prompt and you have to manually type in your credentials. Obviously this is fine for development or things you are doing for one time administration. But in order to have fully automated scripts, this is one of the first pieces in the puzzle, especially when you are likely to be running these on a build server and you don’t want an account that is tied to an acual person.

[Read More]

Puppetlabs State of DevOps Report 2016

Jun 23, 2016. | By: Owen Davies

Puppetlabs have released their excellent yearly report on the state of DevOps.

This is a great insight into what is going on in the DevOps space as a whole.

Puppetlabs go out and survey thousands of technical professionals, in a wide range of industries and countries.

[Read More]

Controlling Azure Virtual Machines from PowerShell

Jun 2, 2016. | By: Owen Davies

The Windows Azure portal is a great resource. It has the full bredth of Azure visually displayed for you to see your Azure subscription and discover new things on the platform. But manually clicking through to provision a new VM or restart a VM isn’t the dream. As much as I think it’s well designed and easy enough to use, when I want to power down a Virtual Machine, I don’t want to have to wait to login to Azure, wait for it to load, find the correct screen and finally click on the action that I need. I want it NOW!

[Read More]

How to Redirect HTTP to HTTPS with the IIS Rewrite Module

Apr 4, 2016. | By: Owen Davies

The IIS rewrite module is a really powerful feature in IIS. It gives you power to set up rules to handle how requests for specific URLs are handled.

You can:

  • Perform redirects
  • Send custom responses
  • Stop HTTP requests based on the rules in the rewrite module.

[Read More]

Puppetlabs State of DevOps Report 2015

Jun 23, 2015. | By: Owen Davies

Each year Puppetlabs send out a survey to the technical community to figure out where organisations are at, and what’s working

They provide this back to the community and it makes for interesting reading.

[Read More]

Setting up web endpoint monitoring in Azure

Mar 2, 2015. | By: Owen Davies

Services like Pingdom allow you to monitor your websites in case they go down so that you are notified. When the configured endpoint for monitoring returns a HTTP response code greater than or equal to 400 or if the response takes longer than 30 seconds etc, you will be alerted.

The service will periodically call your website URL that you have configured, to ensure you get notified before your angry customers notify you.

You can also do this from within Azure.

[Read More]

Tidying up TFS workspaces on the server

Nov 11, 2014. | By: Owen Davies

Wow, TFS can be a pain at times.

View workspaces on server

To find all the workspaces that are currently on your TFS server you can fire up “Developer Command Prompt for VS2013″ Get to this by going Start –> Visual Studio 2013 –> Tools

Type in the following command:

tf workspaces /owner:\* /computer:\* /server:http://SERVER_NAME:8080/tfs

This lists all the workspaces that are on the server for all users and all computers. I could instantly see the names of people who had left the company and also many duplicates for developers that are still here.

Deleting workspaces

To Remove the workspaces issue the following:

tf workspace /delete /server:http://SERVER\_NAME:8080/tfs/ PC\_NAME;UserName

You can query for specific users or computers by changing the * in the first query, this is in case you have a lot of workspaces like I did. I simply changed the query to the username of the people who I know have left the company, and then used the output of this to build the delete query until all were removed.

We now have a nice tidy TFS server… or at least tidier

[Read More]

Automapper 3.2.1 The call is ambiguous between the following methods or properties

Oct 24, 2014. | By: Owen Davies

Quick error fix for anyone experiencing the same issue, looks like the syntax for ResolveUsing has changed as of 3.2.0.

Just updated Automapper on my project to 3.2.1. And getting the following error.

[Read More]

Azure Storage Import Export Service Tutorial run through on Channel 9

Feb 5, 2014. | By: Owen Davies

Episode 130 of The Cloud Cover show over at Channel 9 takes you through the new Import Export Service that Azure provides to us.

Channel 9 Cloud Cover show

[Read More]

Azure physical hard drive import

Jan 29, 2014. | By: Owen Davies

Just discovered a new service offered by Windows Azure.

The Windows Azure Import/Export Service.

What is it?

[Read More]

Windows Azure SQL Reporting being discontinued

Nov 6, 2013. | By: Owen Davies

Microsoft have announced that Windows Azure SQL Reporting will be discontinued on 31st October 2014. Along with recommending to migrate reporting instances to SSRS running on virtual machines in Azure.

I’m quite disappointed with this, although having nothing meaty on Azure Reporting Services, I was using it for experimenting on some of my personal projects. And thought it had fantastic promise as a cloud based reporting solution.

As much as I believe PaaS is the better solution, the world is obviously not ready for it, so we will use IaaS for SSRS. Pricing wise it shouldn’t make a huge problem as you can just turn off your VM, and you will not be charged. So with some Powershell scripting and scheduling you will be able to turn on for over night batch processing or manually if you only need reports adhoc (like I do).

[Read More]

Azure: Persistent virtual machines and hosting Linux in Azure

Jan 5, 2012. | By: Owen Davies

Interesting reading an article on zdnet about Microsoft soon to support persisted Virtual Machines in Azure. This means they are opening up the Azure platform as Infrastructure As A Service (IAAS). This will allow Linux, Sharepoint and full flavour SQL Server.

The VM role has been around for a while but when you heard any Microsoft guys talking about it they really still suggested that you could do everything within the web and worker roles, and VM roles would be for rare edge cases.

Will be interesting to see if they change direction at all and begin to push Azure as much more IAAS as opposed to the current push of Platform As A Service (PAAS).

Original article here.

[Read More]

Filewatcher in global.asax

Dec 8, 2011. | By: Owen Davies

I needed to watch for files changing in the root of my site. Specifically I was doing this as I had an XML file with all my routing information defined. So if this XML file changed I needed to reload the routes and add all the changes.

You can do this by using the FileSystemWatcher Class and adding it to the System.Web.HttpApplication within your Global.asax.

The Code

private FileSystemWatcher _fsw;

protected void Application_Start(object sender, EventArgs e)
{
	string monitorPath = Server.MapPath("");

	Application.Add("fileWatcher", new FileSystemWatcher(monitorPath));
	_fsw = (FileSystemWatcher)Application["fileWatcher"];
	_fsw.EnableRaisingEvents = true;

	_fsw.Changed += OnWatchFileChanged;
}

protected void Application_End(object sender, EventArgs e)
{
	FileSystemWatcher fileWatcher = (FileSystemWatcher)Application["fileWatcher"];
	Application.Remove("fileWatcher");
	fileWatcher.Dispose();
}

private void OnWatchFileChanged(object source, FileSystemEventArgs e)
{
	// Do required stuff
	string requiredstuff = "";
}  

[Read More]

Azure: Crossdomain.xml inside root of blob storage

Nov 23, 2011. | By: Owen Davies

My recent Azure adventures are working with a Flash client as the front end, which meant the need to implement a crossdomain.xml file to allow the Flash client to connect to my site.

What is Cross-Domain?

A cross-domain policy file is an XML document that grants a web client, such as Adobe Flash Player or Silverlight permission to handle data across domains. When a client hosts content from a particular source domain and that content makes requests directed towards a domain other than its own, the remote domain  needs to host a cross-domain policy file that grants access to the source domain, allowing the client to continue  the transaction.

And in Azure this is all fine for the hosted service/site. You can just create the xml file within your site and you’re ready to rock and roll.

The problem

The same thing must be done on your Blob storage account to allow your web client to access videos or other assets that are hosted in your Blob storage. From initial looks at how Blob storage works, which requires a container to place files/blobs into. But after a little digging I got to the root (hehe) of the solution.

By creating a container called “$root” this mimics the root directory and as far as a web client is concerned. It exists within the root of your blob storage URI (or whatever the URI of the CNAME you have pointed to your blob storage).

The solution

I like to setup everything necessary in code to create/run my Azure projects. So if you add the following method into the Run method of your web/worker role, it will automatically create the root folder and your defined crossdomain.xml file.

private void CreateCrossDomainFile()
{
	CloudBlobClient client = _cloudStorageAccount.CreateCloudBlobClient();

	client.GetContainerReference("$root").CreateIfNotExist();
	client.GetContainerReference("$root").SetPermissions(
    new BlobContainerPermissions 
    { 
      PublicAccess = BlobContainerPublicAccessType.Blob 
    });
	CloudBlob blob = client.GetBlobReference("crossdomain.xml");
	blob.Properties.ContentType = "text/xml";
	blob.UploadText(@"<?xml version=""1.0"" encoding=""utf-8""?>
    <cross-domain-policy>
    <allow-access-from domain=""www.YOURDOMAIN.co.uk"" secure=""false"" /> 
    <allow-access-from domain=""YOURDOMAIN.co.uk"" secure=""false"" />   
    </cross-domain-policy>");
}

Inside:

public class WorkerRole : RoleEntryPoint
{
    public override void Run()
    {
        CreateCrossDomainFile();
    }
}

[Read More]

Azure: Multiple sites per web role

Nov 3, 2011. | By: Owen Davies

When I originally began to dig into Azure, multiple sites per role wasn’t supported. And quite frankly was very important to take down costs for people like me who host lots of little development projects. Fortunately version 1.3 of Azure introduced full flavour IIS 7.5 which mean you can do this. This is great if you have a few websites which don’t really need their own instance each but you want them up there. Hopefully this will allow Azure to take off more, allowing developers and smaller sites to host easily and cheaply on the platform.

How to do it:

Use the following in your ServiceDefinition.csdef file:

    <Sites>
      <Site name="OwenBlog" physicalDirectory="..SampleWebApp">
        <Bindings>
          <Binding name="HttpIn" endpointName="HttpIn" hostHeader="www.owenadavies.co.uk" />
        </Bindings>
      </Site>
      <Site name="OwenTest" physicalDirectory="c:SampleWebApp">
        <VirtualApplication name="testapp" physicalDirectory="c:testapp" />
        <Bindings>
          <Binding name="HttpIn" endpointName="HttpIn" hostHeader="www.testsite.com" />
        </Bindings>
      </Site>
    </Sites>

You would then set up each of your 2 domains to map to your Azure domain url (http://YOURAPPNAME.cloudapp.net) via a CNAME, and azure will use the hostHeader to figure out which site to server. This is exactly the same mechanism as what is done in IIS if you ran on premises.

[Read More]

Azure SDK 1.5 Error Solved – DevFC.exe stopped working

Oct 26, 2011. | By: Owen Davies

I upgraded to the latest Azure SDK a few weeks ago to get some of the new features. Unfortunately I was greeted with “DevFC.exe stopped working” when I tried to start my solution.

Fortunately I found the following forum post on the MSDN forum

It seemed to be with regard to another application listening on port 12000/12001, but people were complaining about VMWare using the port (which I don’t have installed). Seems to actually be the HTC Sync application in my tasktray that I installed (and forgot about and never use).

Stopping HTC Sync, and trying my solution again… All works fine now… So am currently uninstalling HTC Sync to make sure I’m never bothered again. (Is this my fault for being a .NET developer without a Windows Phone?)

[Read More]

Amazon Simple Storage Service (Amazon S3) Maximum number of retry attempts reached : 3

Oct 13, 2011. | By: Owen Davies

Have had my head up in the cloud for over a year now. But very much inside Azure.

I know a lot of people us Amazon, but never had a reason to look into it, but needed to write into the Amazon S3 recently. So I downloaded the .NET sdk and the code samples, all looked simple enough.

After playing for while I got it going up but received this error:

Maximum number of retry attempts reached : 3

Couldn’t find much online to get me any further. Found some answers eventually.

I had to actually explicitly specify the AWSEUEndPoint, I’m not sure if this is a .NET thing or because it was registered to the EU endpoint (I don’t know what the third party specified) and maybe the sdk always assumes US. But it works.

Inside my app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<appSettings>
		<add key="AWSAccessKey" value="MyAccessKey"/>
		<add key="AWSSecretKey" value="MySuperSecretKey"/>
		<add key="bucketName" value="myBucket"/>
		<add key="AWSEUEndPoint" value="s3-eu-west-1.amazonaws.com"/>
	</appSettings>
</configuration>

My Code:

AmazonS3Config config = new AmazonS3Config();
config.ServiceURL = appConfig["AWSEUEndPoint"];
 
using (client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKeyID, secretAccessKeyID, config))

[Read More]

Azure SLA (Service Level Agreement)

Aug 18, 2011. | By: Owen Davies

One of the many benefits of moving your in-house servers up into the cloud is to off load the responsibility of the uptime.

But what does Microsoft offer its Azure customers in its Service Level Agreement?

A quote from the SLA:

“Windows Azure has separate SLA’s for compute and storage. For compute, we guarantee that when you deploy two or more role instances in different fault and upgrade domains your Internet facing roles will have external connectivity at least 99.95% of the time.”

1 Compute Instance

So basically if you only have 1 compute instance you won’t get any SLA. Which sounds a bit rubbish but the reasoning makes sense. If they need to repair the hardware your instance is on or even do an upgrade to the Azure framework, which we all want, they would need to take you down. Now realistically this is a fast process and they would bring you up on another piece of hardware, but that would incur downtime.

2+ Compute Instances

Now the SLA kicks in and you’re at 99.95% (which is pretty damn good).

When you deploy your Azure site package up to the cloud with only 1 instance you are greeted with the following warning/error, which explains about the SLA to you.

Warning

A warning has been encountered

A warning has been encountered.  Click “See more details” to see the warning.  Would you like to override and submit?
Warning: This deployment has at least one role with only one instance. We recommend that you deploy at least two instances per role to ensure high availability in case one of the instances becomes unavailable. Doing so also enables coverage of the Windows Azure Compute SLA (http://go.microsoft.com/fwlink/?LinkID=159704&clcid=0x409), which guarantees 99.95% uptime. For more information please visit http://go.microsoft.com/fwlink/?LinkID=202707 (http://go.microsoft.com/fwlink/?LinkID=202707).  Find more solutions in the Windows Azure support forum (http://go.microsoft.com/fwlink/?LinkID=206235).

[Read More]

Azure: Inbound bandwidth now FREE!

Jul 1, 2011. | By: Owen Davies

A very interesting announcement from the Azure team on the 22nd June. They are to make Ingress free, which is great news. I imagine this will get the attention of many companies which have applications with extremely large amounts of data going up to the cloud.

Not sure if I’m correct, but it seemed to rattle Amazon too, who announced a week later (29th June) that they too would over free inbound data. Not sure if they saw this as a great benefit to grab new customers, or if they were forced into it by Microsoft doing it first. I can’t really imagine that they are that worried about Azure, don’t get me wrong I think it’s a fantastic platform. But the uptake of Azure has been pretty slow (I believe) and Amazon have been around for quite a while now.

The possibilities for video upload sites, or applications that crunch huge data sets must suddenly open up greatly due to this announcement. I hope this will greatly promote the use of the cloud, as there are so many benefits.

Windows Azure Blog Announcement
Amazon Web Services Blog Announcement

[Read More]

Azure: Timeouts between compute and blob storage

May 6, 2011. | By: Owen Davies

Just a quick one here, been pulling my hair out for a while about this.

Basically I was getting timeouts when trying to copy data from my web role compute instance and the blob storage.

Couldn’t find any reason or proper answer.

Then found out that I happened to setup my compute in Anywhere Europe, and my blob to Western Europe. So they were in different data centres, which is obvious when you think about it. But just didn’t think. So I recreated my compute instance in Western Europe, and throughput has improved.

[Read More]

Windows Azure SDK 1.4 released

Apr 16, 2011. | By: Owen Davies

The azure team have released version 1.4 of the Windows Azure SDK.

This release integrates with the web deployment tool and means you don’t need to re-package the application and upload it via the Azure portal.

The product team are releasing things so often, changes are happening so fast.

I suggest you go get it!

Tools & SDK Download

Msdn blog announcement

[Read More]

Azure for MSDN subscribers

Mar 31, 2011. | By: Owen Davies

At the Azure conference on Friday they explained the FREE STUFF (I love free stuff) that you get with MSDN subscription with Azure. So I went onto my MSDN Subscription page last night, and very impressed. This gives me the power to have 750 hours for free every month (that’s 31 days worth). And bandwidth wise, 25gb IN, and OUT that sounds a lot.

Visual Studio Professional with MSDN Subscription Monthly Benefit:

Windows Azure

  • 750 hours of an extra small compute instance
  • 20 GB of storage
  • 250,000 storage transactions
  • SQL Azure
  • 1 Web Edition databases (up to 1 GB relational database each)
  • Windows Azure AppFabric
  • 100,000 Access Control transactions
  • 2 Service Bus connections***
  • 128 MB cache
  • Data Transfers (worldwide)
  • 25 GB in
  • 25 GB out
  • Any usage each month in excess of the monthly benefit will be charged at the Visual Studio Professional with MSDN rates.

[Read More]

Unlimited Load testing with visual studio Ultimate MSDN subscribers

Mar 11, 2011. | By: Owen Davies

It was announced a couple days ago that MSDN Subscribers with Visual Studio Ultimate will be able to download a feature pack to allow load testing with unlimited users.

This is fantastic news, I have been doing quite a bit of load testing over the last 6 months, and Visual Studio test suite is fantastic tool for this, but the 250 cap meant that you had to pay for addtional virtual user licenses for anything over 250 (and it wasn’t cheap).

This meant we we’re using wcat and the like for load testing, but Visual Studio make it so much easier.

This actually came in perfect timing for my current product. My current story is build load testing scenarios for the new site, thought I was going to be limited to 250.

MSDN blog annoucement

Great news! Running to MSDN to get my feature pack right now!

[Read More]

Nant error: [exec] svn: Error resolving case of '>'

Feb 10, 2011. | By: Owen Davies

Receiving this following error when doing an exec statement in nant, had me scratching my head for a while and took an age to track down.

[exec] svn: Error resolving case of '>'

Resolved it by using the output parameter within the exec element, you can’t use the > character for output from within Nant annoyingly.

So changed this:

<exec basedir="." program="c:myprogram.exe" commandline=" -L -x > c:xmloutput.xml" />

To this:

<exec basedir="." program="c:myprogram.exe" commandline=" -L -x" output="c:xmloutput.xml" />

[Read More]

About

Founded in 2009, Odity is a software consultancy based in the United Kingdom.

Social Links

Our Bunker

Odity LTD,
Unit 4,
89 High Street, London,
E17 7DB,
United Kingdom.