Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Scale Azure cloud service up and down from Rest API with WebAPI

Tags:

azure

I am creating a demo where I need to be able to scale up my cloud service deployment from a WebAPI.

I went over the rest API documentation and didn't seem to find what I need.

Is it possible to use Service Management API to scale a cloud service up and down ?

Alternative I will just enable auto scale on a queue and then post messages to the queue to get it to scale up :)

like image 888
Poul K. Sørensen Avatar asked Nov 11 '22 20:11

Poul K. Sørensen


1 Answers

As such there's no such function in Service Management REST API for scaling. Since the number of instances for a particular role is stored in the service configuration file, what you would need to do is read this configuration information using Get Deployment operation, locate the Instances node and change the value of count attribute. Then you would need to call Change Deployment Configuration for new instance count to be effective.

like image 192
Gaurav Mantri Avatar answered Nov 15 '22 00:11

Gaurav Mantri