【发布时间】:2020-12-08 22:14:47
【问题描述】:
【问题讨论】:
标签: azure azure-web-app-service
【问题讨论】:
标签: azure azure-web-app-service
转到 Azure 门户中的 WebApp 并下载发布配置文件。您将获得类似于以下内容的内容。
<publishProfile profileName="[app-name] - Web Deploy" publishMethod="MSDeploy" publishUrl="waws-prod.publish.azurewebsites.windows.net:443" msdeploySite="[app-name]" userName="$[app-name]" userPWD="***" destinationAppUrl="http://[app-name].azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
<databases />
</publishProfile>
<publishProfile profileName="[app-name] - FTP" publishMethod="FTP" publishUrl="ftp://waws-prod.ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="[app-name]\$[app-name]" userPWD="***" destinationAppUrl="http://[app-name].azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
<databases />
</publishProfile>
<publishProfile profileName="[app-name] - ReadOnly - FTP" publishMethod="FTP" publishUrl="ftp://waws-prod.ftp.azurewebsites.windows.net/site/wwwroot" ftpPassiveMode="True" userName="[app-name]\$[app-name]" userPWD="***" destinationAppUrl="http://[app-name].azurewebsites.net" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
<databases />
</publishProfile>
将 Web-Deploy 的第一个发布配置文件中的发布 url 更改为 [appname].scm.azurewebsites.net 而不是
waws-prod.publish.azurewebsites.windows.net
转到 Github 并转到存储库。
转到 .github/workflows 中的相应工作流 yml 文件并查找 ${{ secrets.<SECRET_NAME> }}。记住<SECRET_NAME>。
转到设置 > 机密,然后单击与您在上述步骤中记住的机密名称相对应的“更新”按钮。
将 XML 代码粘贴到 Value 中,然后点击“更新密码”。
转到“操作”并选择失败的工作流运行,然后单击“重新运行作业”。
现在您的 Web Zip 部署应该成功了。
【讨论】:
example-app,我是设置[example-app].scm.azurewebsites.net 还是example-app.scm.azurewebsites.net?
[example-app].scm.azurewebsites.net
就我而言,我想在上面的答案中添加您需要添加一个名为 WEBSITE_WEBDEPLOY_USE_SCM 的应用程序设置并将其设置为 true。 (我将 linux 用于我的应用服务)并获取发布配置文件。 您会注意到发布配置文件会自动将 waws-prod.publish.azurewebsites.windows.net 更改为 [example-app].scm.azurewebsites.net。
TLDR;
【讨论】: