简体   繁体   中英

Azure management API: How to change web app pricing tier?

I'm automating the creation of Azure web apps using the management SDK (ie 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?

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

You can change the pricing tier from the Portal

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

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM