问题描述
我曾经使用Get-AzureWebsite -Name myportal
来获取PublishingPassword
我可以在Visual Studio中用来将WebApp发布到云中的内容.
I used to use Get-AzureWebsite -Name myportal
to get PublishingPassword
what I can use inside Visual Studio to publish the WebApp to the cloud.
但是现在我被分配了一个新的azure订阅,而旧的azure命令集(即Get-AzureSubscription
)看不到.
But now I was assigned with a new azure subscription that is not seen with the old azure command set (i.e. Get-AzureSubscription
).
但是,此订阅可以通过Get-AzureRmSubscription
(带有"Rm"关键字)看到.但是Get-AzureRmWebApp
不包含PublishingPassword
属性.
However this subscription is visible by Get-AzureRmSubscription
(with "Rm" keyword). But Get-AzureRmWebApp
doesn't contain PublishingPassword
property.
还有其他方法来获取带有新命令集(包含"Rm")的PublishingPassword
.
Is there any other way to get PublishingPassword
with new command set (that contains "Rm").
推荐答案
您要查找的cmdlet是Get-AzureRmWebAppPublishingProfile
当时我正在寻找一种更直接的方法,但没有启用.这有点令人费解,但它可以工作. (它实际上并没有写任何文件,但据我回忆,如果不包含文件,它会令人cho恼)
The cmdlet you are looking for is Get-AzureRmWebAppPublishingProfile
At the time I looked for a more direct method, but didn't turn one up. It is a little bit convoluted, but it works. (it doesn't actually write anything to file, but as I recall it choked if it wasn't included)
这就是我所做的...
This is what I did with it...
function Get-FTPCredentials
{
$Xml = [xml](Get-AzureRmWebAppPublishingProfile -OutputFile test.xml -Format Ftp -ResourceGroupName $AppServiceResourceGroupName -Name $AppServiceWebAppName )
$PublishProfile = $Xml.FirstChild.ChildNodes[1]
Write-Output ("FTP location is - " + $PublishProfile.publishUrl)
Write-Output ("FTP username is - " + $PublishProfile.userName)
Write-Output ("FTP password is - " + $PublishProfile.userPWD)
Write-Output ("Website URL is - " + $PublishProfile.destinationAppUrl)
}
这篇关于使用PowerShell为新的Azure门户获取网站的PublishingPassword的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!