发布Azure的网站从PowerShell的非根文件夹 [英] Publish Azure Website to non-root folder from PowerShell
问题描述
我此刻的测试我的假设。我有我的Asp.Net MVC应用程序位于 www.myapp.com/app </ code>和
www.myapp.com/第三方CMS系统
。
I'm testing my assumptions at the moment. I have my Asp.Net MVC application located at www.myapp.com/app
and a third-party CMS system on www.myapp.com/
.
该网站设置了像这个答案
目前,我可以从Visual Studio单独和手动两种发布的应用程序,它工作正常。
At the moment I can publish both of the applications separately and manually from Visual Studio and it works fine.
不过,我想从那里我使用Azure的电源外壳scriplets构建服务器发布我的应用程序:
However, I'm trying to publish my application from a build server where I'm using Azure Power-Shell scriplets:
PS> Publish-AzureWebsiteProject -Name myApp -Package MyWebDeployPackage.zip
不过,文档没有提到,如果你可以用这个发布scriplet到非根文件夹。
However, documentation does not mention if you can publish with this scriplet to a non-root folder.
什么办法可以从命令行发布应用程序〜/应用程序
?
Any way I can publish an application to ~/app
from a command line?
UPD :我可以从的MSBuild
通过
msbuild .\SolutionName.sln /p:DeployOnBuild=true /p:PublishProfile=ProfileName /p:Password=passwordForAzurePublishing /p:AllowUntrustedCertificate=true
其中,配置文件名
是配置部署到Azure中的Web站点的子文件夹和网络部署配置文件密码
从Azure的部署配置文件的密码。
Where ProfileName
is a web-deploy profile configured to deploy to sub-folder of Azure Web-Site and Password
is deployment password from Azure profile.
然而,这并不是最佳的解决方案:部署到测试和生产环境,我需要构建应用程序的两倍,这是我想避免:如果我编译的看法,它需要7-10分钟(我们有800视图)。这样做两次是在浪费时间。
However this is not an optimal solution: to deploy to test and to production environment, I need to build the application twice, which I'd like to avoid: if I compile views, it takes 7-10 minutes (we have 800 views). Doing this twice is a waste of time.
2 UPD :创建在Azure SDK工具库中的一个问题:的 https://github.com/Azure/azure-sdk-tools/issues/2667
UPD 2: Created an issue on Azure SDK Tools repository: https://github.com/Azure/azure-sdk-tools/issues/2667
推荐答案
我不认为这是PowerShell的可能,但我可能是错误的。在他们发布code这里看<一个href=\"https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1136-L1168\" rel=\"nofollow\">https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1136-L1168
I don't think this is possible from PowerShell, but I might be mistaken. Looking at their publish code here https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1136-L1168
和也在这里<一个href=\"https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1218-L1229\" rel=\"nofollow\">https://github.com/Azure/azure-sdk-tools/blob/master/src/ServiceManagement/Services/Commands.Utilities/Websites/WebsitesClient.cs#L1218-L1229
它们不具有用于应用名称的参数,并在第二链路的code构建网站名称/插槽手动
they don't have a parameter for the app name, and the code in the second link builds the site name/slot manually.
我会说这里开一个问题 https://github.com/Azure/azure -sdk工具/问题为此,有人从Azure的PowerShell团队应该关注一下吧。
I would say open an issue here https://github.com/Azure/azure-sdk-tools/issues for this and somebody from the Azure PowerShell team should look at it.
这篇关于发布Azure的网站从PowerShell的非根文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!