从哪里可以获得我的实际Azure网站部署密码? [英] Where do I get my actual Azure Website Deployment password?

查看:71
本文介绍了从哪里可以获得我的实际Azure网站部署密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2015中,当我将网站/Webapp发布到Azure时,我能够自动创建新的发布配置文件(通过输入我的个人Azure帐户凭据),这将创建.pubxml.pubxml.user文件.部署用户名的格式为"$websiteName",密码由一连串的项目符号表示. .pubxml.user文件包含实际的密码,该密码已加密,因此只有我的Visual Studio可以通过使用本地Windows用户帐户对其进行解密来读取它-作为人类,我没有办法看到它.此外,.user文件从源代码管理中排除(但.pubxml文件包含在源代码控制中).

In Visual studio 2015, when I Publish my Website/Webapp to Azure, I'm able to create a new publishing profile automatically (by entering my personal Azure account credentials), this creates the .pubxml and .pubxml.user files. The deployment username is of the form "$websiteName" and the password is represented by a long series of bullet points. The .pubxml.user file contains the actual password, which is encrypted such that only my Visual Studio can read it, by decrypting it with my local Windows user account - I, as a human, have no way to see it. Also, the .user files are excluded from Source Control (but the .pubxml files are included in Source Control).

当我们团队中的另一个人尝试部署网站时,他们将获得相同的部署设置,但是会提示您输入"$website"帐户的密码.我不知道从何处获取此密码-Azure管理门户不会显示该密码.

When another person on my team tries to deploy the website, they get the same deployment settings, but are prompted for the password for the "$website" account. I have no idea where to get this password from - the Azure Management portal does not display it.

如果此人打开门户并选择重置发布配置文件,那么他们可以下载一个新的.pubxml文件,该文件包含一个加密的密码,据我了解,只有他们的个人Azure凭据可以解密,但这会破坏我和他人的部署其他用户,因为现在他们保存的密码(在.user文件中)已失效.

If the person opens the portal and chooses to Reset the publishing profile, then they can download a new .pubxml file that contains an encrypted password that I understand only their personal Azure credentials can decrypt, but that breaks deployment for me and other users because now their saved passwords (in the .user files) is invalidated.

我知道这与Azure门户上的部署凭据"刀片使用不同的用户名+密码,因为当前该网站未设置部署凭据,此外,如果要设置一个,则用户名也不同.门户网站指出,这些凭据仍可用于FTP访问-没有提及Web Deploy功能.

I understand this is a different username+password to the "Deployment Credentials" blade on the Azure portal because currently the website has no Deployment Credentials set, in addition if I were to set one, the username is different. The Portal states that those credentials are for FTP access anyway - no mention is made of the Web Deploy feature.

推荐答案

您可以通过Portal或PowerShell/CLI获取当前凭据.

You can get the current credentials via the Portal or PowerShell/CLI.

在门户网站上,webapp刀片服务器顶部有一个按钮,用于下载发布配置文件(不是部署凭证刀片服务器,而是主要的Web应用程序刀片服务器.)

On the portal, there is a button at the top of the webapp blade to download the publish profile (not the deployment credentials blade, but the main web app blade).

首先,确保已安装Azure PowerShell cmdlet: https://docs.microsoft.com/zh-CN/powershell/azure/install-azurerm-ps?view=azurermps-6.3.0

First, ensure the Azure PowerShell cmdlets are installed: https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-6.3.0

  1. 打开提升的PowerShell窗口.
  2. 输入$PSVersionTable.PSVersion.确保输出显示您具有专业版本5或更高版本.如果此命令给您一个错误,则说明您正在运行PowerShell v1,该版本此时已过时.
  3. 输入Install-Module -Name AzureRM(在这种情况下,系统可能会提示您更新NuGet)
  4. 等待它完成安装.
  5. 输入Import-Module AzureRM
  6. 输入Connect-AzureRmAccount并完成身份验证过程.
  7. 运行此命令可将发布配置文件保存到磁盘上的文件中(为便于阅读,添加了换行符,实际上将其放在一行中).适当设置$WebAppName$ResourceGroupName:

  1. Open an elevated PowerShell window.
  2. Enter $PSVersionTable.PSVersion. Ensure the output shows you have Major version 5 or later. If this command gives you an error then you're running PowerShell v1 which is ancient at this point.
  3. Enter Install-Module -Name AzureRM (you may be prompted to update NuGet, in which case you should)
  4. Wait for it to finish installing.
  5. Enter Import-Module AzureRM
  6. Enter Connect-AzureRmAccount and complete the authentication process.
  7. Run this command to save the publishing profile to a file on disk (line-breaks added for readability, in reality put this on a single line). Set $WebAppName and $ResourceGroupName as appropriate:

Get-AzureRmWebAppPublishingProfile
    -ResourceGroupName $ResourceGroupName
    -Name $WebAppName
    -OutputFile creds.xml
    -Format WebDeploy

.publishsettings文件

.publishsettings文件是XML文件(无换行符).在内部,您将找到具有此结构的文档.使用publishMethod="MSDeploy"<publishProfile>元素中查找userPWD属性.不要使用FTP凭据(在第二个<publishProfile>元素中),因为用户名不同.

.publishsettings file

The .publishsettings file is an XML file (without line-breaks). Inside you'll find a document with this structure. Look for the userPWD attribute in the <publishProfile> element with publishMethod="MSDeploy". Don't use the FTP credentials (in the second <publishProfile> element) because the username is different.

userPWD属性值未加密,但完全随机字节的base64(或base62?)编码是加密的.您可以将此值直接复制并粘贴到Visual Studio的发布向导中的凭据提示中.

The userPWD attribute value is not encrypted, but is the base64 (or base62?) encoding of completely random bytes. You can copy and paste this value directly into the credential prompt within Visual Studio's publishing wizard.

<publishData>
    <publishProfile
        profileName="SITE - Web Deploy"
        publishMethod="MSDeploy"
        publishUrl="SITE.scm.azurewebsites.net:443"
        msdeploySite="SITE"
        userName="$SITE"
        userPWD="YOUR PASSWORD IS HERE"                    <-- This attribute here
        destinationAppUrl="http://SITE.azurewebsites.net"
        SQLServerDBConnectionString=""
        mySQLDBConnectionString=""
        hostingProviderForumLink=""
        controlPanelLink=""
        webSystem="WebSites"
    >
        <databases />
    </publishProfile>

    <publishProfile
        profileName="SITE - FTP"
        publishMethod="FTP"
        publishUrl="ftp://SITE.ftp.azurewebsites.windows.net/site/wwwroot"
        ftpPassiveMode="True"
        userName="SITE\$SITE"
        userPWD="FTP PASSWORD IS HERE"
        destinationAppUrl="http://SITE.azurewebsites.net"
        SQLServerDBConnectionString=""
        mySQLDBConnectionString=""
        hostingProviderForumLink=""
        controlPanelLink=""
        webSystem="WebSites"
    >
        <databases />
    </publishProfile>
</publishData>

这篇关于从哪里可以获得我的实际Azure网站部署密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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