如何发布的Azure网站(xxx.azurewebsites.net)使用PowerShell? [英] How to publish an Azure web site (xxx.azurewebsites.net) with PowerShell?

查看:178
本文介绍了如何发布的Azure网站(xxx.azurewebsites.net)使用PowerShell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的网站建立一个文件夹中准备就绪。我知道如何使用Azure的PowerShell来创建网站。

I have my web site built ready in a folder. And I know how to use Azure PowerShell to create a site.

在Azure管理门户,我只需要通过FTP站点的文件复制。

In Azure management portal, I just need to copy the site files through FTP.

但我不知道如何使用PowerShell来我的网站文件推到Azure上。可能有人提供一些线索?

But I don't know how to use PowerShell to push my web site files to Azure. Could someone shed some light?

推荐答案

您可以使用发布-AzureWebsiteProject cmdlet来做到这一点。

You can use the Publish-AzureWebsiteProject cmdlet to do this.

例如,假设你有你的Azure网站已经在 contosows.azurewebsites.net 创建。在您运行Visual Studio 2013的本地计算机,发布您的Web应用程序作为Web部署软件包,并给它一个名称,如Contoso.WebSite.zip。

For example, suppose you have your Azure Website already created at contosows.azurewebsites.net. On your local computer running Visual Studio 2013, publish your web application as a Web Deploy Package and give it a name, such as Contoso.WebSite.zip.

现在,在PowerShell中,运行此命令

Now, in PowerShell, run this command

Publish-AzureWebsiteProject -Package .\Contoso.Website.zip -Name contosows

在短短秒钟,你就能在http://contosows.azurewebsites.net启动您的网站。

In a few short seconds, you will be able to launch your site at http://contosows.azurewebsites.net.

如果要自动包文件(.zip)的创建,所以你不必使用Visual Studio,那么你可以使用MSBuild.exe创建软件包。注:参见上面的图片上看到我的配置参数的值。例如...

If you want to automate the creation of the package (.zip) so you don't have to use Visual Studio, then you could use MSBuild.exe to create the package. Note: See the image above to see where I got the value for the Configuration parameter. For example...

msbuild "Contoso.Website.csproj" /T:Package /P:Configuration=ContosoWebsite;OutputPath=[PATH TO PLACE PACKAGE IN]

这篇关于如何发布的Azure网站(xxx.azurewebsites.net)使用PowerShell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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