我发现通过powershell交换天蓝色插槽似乎是无法实现的(我猜想它给出了一个错误响应,我看不到,或者正在默默地失败,但声称成功)。交换的插槽在两个非生产插槽之间,如脚本所示。大约10%的时间,它似乎成功了。我不知道它为什么会成功或失败,希望有人能说明我在这里做错了什么。
我已经编写了一个脚本,它运行在Teamcity上的一个构建作业上,脚本如下:
param ([string]$publishFilePath = "%system.teamcity.build.checkoutDir%\3.
deployment\Fu.publishsettings")
Import-AzurePublishSettingsFile $publishFilePath;
Select-AzureSubscription "Visual Studio Professional with MSDN";
Set-AzureSubscription -SubscriptionName "Visual Studio Professional with MSDN";
Switch-AzureWebsiteSlot -Name FuWebsite -Slot1 Build-Automation -Slot2 Staging -Force -Verbose
Switch-AzureWebsiteSlot -Name FuServices -Slot1 Build-Automation -Slot2 Staging -Force -Verbose我得到的唯一日志是:
[10:20:12][Step 5/5] VERBOSE: Performing the operation "Swapping website
production slot ..." on
[10:20:12][Step 5/5] target "FuWebsite".
[10:21:16][Step 5/5] VERBOSE: Performing the operation "Swapping website production slot ..." on
[10:21:16][Step 5/5] target "FuMeServices".
[10:22:19][Step 5/5]
[10:22:19][Step 5/5]
[10:22:19][Step 5/5] Process exited with code 0发布于 2016-09-19 03:35:44
大约10%的时间,它似乎成功了。我不知道为什么它成功或失败
如果你不确定它是成功还是失败。我建议您使用-Debug模式测试下面的代码。
Switch-AzureWebsiteSlot -Name FuWebsite -Slot1 Build-Automation -Slot2 Staging -Force -Verbose -Debug这是我站在我这边的结果:

详细的信息将帮助您找到解决方案。在加法中,如果执行交换命令,则站点不会更改。请尝试清理IE会话和cookie,然后再试一次。或者使用KUDU查看原始文件是否被更改。
https://stackoverflow.com/questions/39556923
复制相似问题