如何通过Azure PowerShell获得PublishUrl? [英] How can I get the PublishUrl via Azure PowerShell?
问题描述
我的目标是能够传递站点名称和位置并创建一个新站点,检索适当的凭据/URL并使用WebDeploy部署我的站点.
My goal is to be able to pass in a site name and location and have a new site created, retrieve the appropriate credentials/URLs and deploy my site with WebDeploy.
我从此处使用Azure Powershell工具: http://www.windowsazure .com/en-us/downloads/
I'm using the Azure Powershell Tools from here: http://www.windowsazure.com/en-us/downloads/
我可以使用以下方式创建新网站
I am able to create a new website with
New-AzureWebsite -Name site-name -Location "West US"
对此,我得到了有关所创建网站的详细信息,包括发布用户名和密码(PublishingUsername和PublishingPassword),我不需要的一条信息是发布URL(可以从XML格式的文件中的Azure管理门户).在XML文件中,它是publishProfile节点上的publishUrl属性.
In response to this I get details about the created site, including the publishing username and password (PublishingUsername and PublishingPassword), the one piece of information I do not get that I need is the publishing URL (which I can retrieve from the Azure Management portal in an XML formatted file). In the XML file it is the publishUrl attribute on the publishProfile node.
我的问题是,是否可以通过PowerShell获取发布URL或通过REST API,但是我更喜欢PowerShell.
My question is, is there a way via PowerShell to get the publishing URL, or via the REST API, but I would prefer PowerShell.
这是一个类似的问题,至少在撰写本文时,这听起来似乎还没有实现:
This is a similar question, which sounds like its not yet possible, at least at the time of writing: How can I get the FTP URL for my Azure website via the Management API?
推荐答案
Get-AzureWebSite-名称站点名称
Get-AzureWebSite -Name site-name
将在其输出中返回"Git存储库" URL
will return the 'Git Repository' url in it's output
Get-AzureWebSite-名称站点名称
Get-AzureWebSite -Name site-name
Property = SelfLink
Property=SelfLink
如果使用主机名并将api
替换为publish
,则具有发布URL.请记住,发布网址是安全的连接,因此它通过port 443
If you take the host name and replace api
with publish
you have the publishing url. Keep in mind that the publishing url is a secure connection so it connects over port 443
这篇关于如何通过Azure PowerShell获得PublishUrl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!