'Unable to allocate the required address spaces for the deployment in a new or predefined subnet that is contained within the specified virtual network' deploying cloud services to Azure

Author by Tim Gabrhel

Problem

I recently ran into an error while deploying an update to a cloud service in Microsoft Azure. I received the error below Unable to allocate the required address spaces for the deployment in a new or predefined subnet that is contained within the specified virtual network. "Unable" to do something isn't too descriptive, so your mileage may vary. So far this error has occurred while deploying a cloud service into a Virtual Network & Subnet

Fix

  1. You've run out of IP addresses in the subnet you are trying to deploy into. The number within parenthesis is the number of available addresses in this subnet. Make sure you aren't deploying more than what is available. 
     
  2. You aren't deploying all of your roles into the same Virtual Network. Each role in your cloud service needs it's own to include it in the virtual network.
Author

Tim Gabrhel

Application Developer