How can I get the PublishUrl via Azure PowerShell?

拟墨画扇 提交于 2019-12-02 02:41:01

Get-AzureWebSite -Name site-name

will return the 'Git Repository' url in it's output


Get-AzureWebSite -Name site-name

Property=SelfLink

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

I achieved webpublish with these information :

$websiteName = "mywebsite"

#Get the website's propeties.
$website = Get-AzureWebSite -Name $webSiteName
$siteProperties = $website.SiteProperties.Properties

#extract url, username and password
$url = ($siteProperties | ?{ $_.Name -eq "RepositoryURI" }).Value.ToString() + "/MsDeploy.axd"
$userName = ($siteProperties | ?{ $_.Name -eq "PublishingUsername" }).Value
$pw = ($siteProperties | ?{ $_.Name -eq "PublishingPassword" }).Value

#build the command line argument for the deploy.cmd :
$argFormat = ' /y /m:"{0}" -allowUntrusted /u:"{1}" /p:"{2}" /a:Basic "-setParam:name=DeployIisAppPath,value={3}"'
$arguments = [string]::Format($argFormat, $url, $userName, $pw, $webSiteName)

I then use this line to call the cmd script generated with the publish package.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!