Yes.  Ability to change the size of Azure Virtual Machines is available via the AzureVmInstanceResize command available for resources of type Azure Virtual Machine.  Conditions for when this command can be issued are similar to any other actions and their conditions.  Condition/Expression can be time or performance based.  It does take sometime to change the size of the virtual machine, during which the VM is not responding.  Due to this, it is best to setup instrumentation of Azure VM size for when dealing with non-production VMs or VMs in availability sets.