Azure Web应用程序克隆 powershell 脚本不起作用

发布于 2025-01-19 19:32:36 字数 721 浏览 2 评论 0 原文

我想将现有的WebApp复制到另一个应用程序计划。我已经从

但获得 ## [错误]长期运行操作失败了'internalServererror' 。

这是我的脚本,

$srcapp = Get-AzWebApp -ResourceGroupName abcd -Name Testapp1

$destapp = New-AzWebApp -ResourceGroupName abcd -Name Testapp2 -Location "West Europe" -AppServicePlan appplan-1 -SourceWebApp $srcapp

在网络上找不到任何有用的东西。有人可以帮忙吗?

I want to copy an existing webapp to another app plan. I have collected the command from https://learn.microsoft.com/en-us/azure/app-service/app-service-web-app-cloning

But getting ##[error]Long running operation failed with status 'InternalServerError'. error when i am trying to run webapp cloning script.

Here is my script,

$srcapp = Get-AzWebApp -ResourceGroupName abcd -Name Testapp1

$destapp = New-AzWebApp -ResourceGroupName abcd -Name Testapp2 -Location "West Europe" -AppServicePlan appplan-1 -SourceWebApp $srcapp

Didn't find anything helpful on the web. Can anyone help please?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看轻我的陪伴 2025-01-26 19:32:36

我们已根据给定的 Microsoft 文档 有问题。

您正在尝试的命令,可以在西欧地区创建新应用程序,并将其与现有的应用程序服务计划绑定。

注意:- 我们正在使用现有的应用程序服务计划是具有西欧位置的 P1V2。

与您收到的错误相同:-

在此处输入图像描述

尝试 az 注销 &再次 az login 并运行脚本,运行良好。

另外,请确保您已提供应用服务文件路径,如下所示。要获取路径(应用程序服务计划>属性>资源ID(复制和使用))。

$destapp = New-AzWebApp -ResourceGroupName RGNAME -Name appajtest13 -Location "West Europe" -AppServicePlan "subscriptions/subscriptionID/resourcegroups/my resourcegroup/providers/Microsoft.Web/serverFarms/existingappserviceplanname" -SourceWebApp $srcapp

成功创建输出详细信息:-

在此处输入图像描述

src="https://i.sstatic.net/VNU2E.png" alt="在此处输入图像描述" 我们使用的 az 版本如下所示:

在此处输入图像描述
输入图片此处描述

有关更多信息,您可以参考此SO THREAD|为什么我的应用程序服务不可用按照 @AjayKumar-MSFT 的建议,在 Azure 上正确克隆

We have tried the same script that you are using based on the given Microsoft Document in Question.

The command you are trying ,which can create the new app in the West Europe region, and tie it to an existing App Service Plan .

NOTE:- We are using an existing Appservice plan which is P1V2 with West Europe location.

Same error as you are getting:-

enter image description here

Tried to az logout & az login again and runned the script worked fine.

Also make sure that you have provided the App service file path as shown below.To get the path (APP SERVICE PLAN> PROPERTIES>RESOURCEID(COPY&USE)).

$destapp = New-AzWebApp -ResourceGroupName RGNAME -Name appajtest13 -Location "West Europe" -AppServicePlan "subscriptions/subscriptionID/resourcegroups/my resourcegroup/providers/Microsoft.Web/serverFarms/existingappserviceplanname" -SourceWebApp $srcapp

SUCCESFULLY CREATED OUTPUT DETAILS:-

enter image description here

enter image description here

The PowerShell & az version which we are using as shown below:

enter image description here
enter image description here

For more information you can refer this SO THREAD|Why won't my app service clone properly on Azure as suggested by @AjayKumar-MSFT.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文