更新Azure的网站实例的大小(小,中,大)使用PowerShell [英] Update Azure Website instance size (Small, Medium, Large) with Powershell

查看:394
本文介绍了更新Azure的网站实例的大小(小,中,大)使用PowerShell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有缩放的Azure网页的实例的大小使用PowerShell的(而不是实例计数)的方法吗?我还没有发现的方式。

Is there a way to scale an Azure WebSite instance size (not instance count) using PowerShell? I haven't found the way.

我知道它可以使用Azure的CLI或从门户网站做的,但我希望能够使用PowerShell来做到这一点。这是更多钞票?

I know it can be done using Azure CLI or from the Portal, but I want to be able to do it with PowerShell. Is this posible?

我要的更新现有的网站实例的大小,而不是创建一个新的网站。

I want to update an existing WebSite instance size, not create a new website.

推荐答案

是的,你首先需要知道哪些网站所属,您可以从的新的Azure门户。然后您可以将工人大小更改为0(小),1(中)或2(大)。

Yes, you first need to know the name of the Resource Group and Web Hosting Plan to which your website belongs, which you can get from the new Azure Portal. Then you can change the worker size to 0 (Small), 1 (Medium) or 2 (Large).

Switch-AzureMode AzureResourceManager

$resourceGroup = "MyResourceGroup"
$webHostingPlan = "MyWebHostingPlan"

$whp = Get-AzureResource `
    -Name $webHostingPlan `
    -ResourceGroupName $resourceGroup `
    -ResourceType "Microsoft.Web/serverFarms" `
    -ApiVersion 2014-04-01

$newWorkerSize = 1
$whp.Properties.workerSize = $newWorkerSize
$whp.Properties.workerSizeId = $newWorkerSize

Set-AzureResource `
    -Name $webHostingPlan `
    -ResourceGroupName $resourceGroup `
    -ResourceType "Microsoft.Web/serverFarms" `
    -ApiVersion 2014-04-01 `
    -PropertyObject $whp.Properties

这篇关于更新Azure的网站实例的大小(小,中,大)使用PowerShell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆