5
votes

I'm automating the creation of Azure web apps using the management SDK (i.e. https://github.com/Azure/azure-sdk-for-net) and it's not obvious how to change a web apps app service plan pricing tier using this SDK. Specifically I want to change the web apps I'm creating from 'Free' to 'Shared'.

How can I do this?

2

2 Answers

4
votes

Look at WebHostingPlanOperations.UpdateAsync() (WebHostingPlanOperations.cs).

Notice that it takes a WebHostingPlanUpdateParameters object as a parameter (located in Models, here). Within that, you can set:

  • WorkerSize (0, 1, or 2 for Small, Medium or Large)
  • SkuOptions (which takes a SkuOptions enum, also in Models, here).

SkuOptions values:

  • Free = 0
  • Shared = 1
  • Basic = 2
  • Standard = 3
  • Premium = 4
-3
votes

You can change the pricing tier from the Portal

WebApps -> Select the Web App -> Scale -> Choose the desired Pricing Tier.

enter image description here