我剛剛將代碼從github部署到了azure。 它是一個nodejs網絡應用程序。 在蔚藍的天氣中,我正在使用應用程序服務。從github源部署時,空白頁在azurewebsites中顯示。它是一個nodejs webapp
另外,我添加的代碼爲端口位於/ bin /萬維網
var port = process.env.port || 8080; // 8080 for local or whatever number u want
var listener = app.listen(port, function(){
console.log('Listening on port ' + port);
});
儘管如此,網頁沒有顯示在向上的https:// {APPNAME} .azurewebsites.net
這裏是部署日誌
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling node.js deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'package.json'
Using start-up script bin/www from package.json.
Generated web.config.
The package.json file does not specify node.js engine version constraints.
The node.js application will run with the default node.js version 4.2.3.
Selected npm version 3.5.1
{github-reponame}@0.0.0 D:\home\site\wwwroot
├── [email protected]
└── [email protected]
Finished successfully.
賈斯汀模式的評論... 在供應鏈管理,文件的結構,似乎是好的。
我沒有檢查部署日誌,部署成功但頁面未顯示。
在scm kudu中,文件的結構看起來沒問題。點擊https:// {appname} .azurewebsites.net時,只會出現一個空白頁面。網頁配置文件存在於根目錄中。嗨,Gary-Liu,MSFT, 。 這是在web.config看起來的樣子
<?xml version="1.0" encoding="utf-8"?>
<!--
This configuration file is required if iisnode is used to run node processes behind
IIS or IIS Express. For more information, visit:
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->
<configuration>
<system.webServer>
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
<webSocket enabled="false" />
<handlers>
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
<add name="iisnode" path="bin/www" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- Do not interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^bin/www\/debug[\/]?" />
</rule>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="bin/www"/>
</rule>
</rules>
</rewrite>
<!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
<security>
<requestFiltering>
<hiddenSegments>
<remove segment="bin"/>
</hiddenSegments>
</requestFiltering>
</security>
<!-- Make sure error responses are left untouched -->
<httpErrors existingResponse="PassThrough" />
<!--
You can control how Node is hosted within IIS using the following options:
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
* node_env: will be propagated to node as NODE_ENV environment variable
* debuggingEnabled - controls whether the built-in debugger is enabled
See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
-->
<!--<iisnode watchedFiles="web.config;*.js"/>-->
</system.webServer>
</configuration>
更新: 7月24日 - 下午11時05分EST - 看起來像有一些線索,以解決這個問題......但現在知道如何.. 添加從日誌文件的詳細信息: 日誌顯示「源文件中沒有匹配元素......」
2016-07-25T03:03:26 Start 'websitelogs' site extension transform
2016-07-25T03:03:26 :(6,10), No element in the source document matches '/configuration/system.applicationHost/sites/site[@name='~1{appname}']/application[@path='/websitelogs']'
2016-07-25T03:03:26 Not executing Remove (transform line 6, 68)
2016-07-25T03:03:26 StartSection Executing Insert (transform line 7, 65)
2016-07-25T03:03:26 on /configuration/system.applicationHost/sites/site[@name='~1{appname}']/application
2016-07-25T03:03:26 Applying to 'site' element (no source line info)
更新7月25日,1:25 PM EST 對於加里 - 劉MSFT的評論: 我試着在評論GitHub的「端口」行並重新部署它,它仍然湛藍只顯示空白頁時通過https:// {appname} .azurewebsites.net或http:{appname} .azurewebsites.net訪問
從應用程序日誌...
2016-07-25T16:41:15 PID [15128]警告配置默認提供 'MicrosoftAccount' 被忽略 ,因爲它未啓用。替代提供者將被任意選擇。 2016-07-25T16:41:15 PID [15128]信息發送回覆:401.71未授權
該網站仍然顯示空白頁....當通過http:// {appname} .azurewebsites.net或https:// {appname} .azurewebsites.net
代碼通過github回購進行部署。該網站正常工作沒有天藍。 它只是顯示一個空白頁面後,部署到天藍色的網絡應用程序...
更新:七月 25,下午1點39 EST 由於加里 - 劉MSFT 解決!謝謝! 評論港口線有幫助!非常感謝!它正在工作!謝謝! 另外...這是因爲,在這個網絡應用程序中,我已經啓用了對outlook acct的身份驗證/授權。把它關掉,現在沒有更多的空白頁面!該網站現在工作正常!原因是,我啓用它的前景科學是...我希望它會提示前景登錄!謝謝你的幫助!該網站現在正在運行在天藍色!
你有沒有使用SCM /捻接口來檢查部署的文件的結構?門戶中還應該有一個App Service的部署日誌。可以通過訪問https:// {site name} .scm.azurewebsites.net找到Kudu。此外,此視頻還介紹了設置您正在嘗試執行的操作:https://azure.microsoft.com/en-us/ documentation/videos/create-a-nodejs-site-deploy-from-github/ –
上面編輯的文章包含了這個scm/kudu /部署日誌信息。 – maggie