2015-11-20 50 views
7

創建使用Azure的SDK 2.7和Node.js的工具在Visual Studio 2015年的Node.js應用天青:「您沒有權限查看該目錄或頁面

我已成功設置。 CI與BitBucket在我的web應用程序,我可以看到,更改存儲庫確實會觸發構建和部署。

但是,我達到的頁面(http://ftct.azurewebsites.net/)抱怨:您沒有權限查看此目錄或

我在我的no中指定了一個默認文件(kinda) de.js通過使用:app.get('/',routes.index);

因此試圖直接導航到此文件http://ftct.azurewebsites.net/signin.html會產生不同的錯誤:您正在查找的資源已被刪除,名稱已更改或暫時不可用。

我將應用程序配置爲在Visual Studio中的端口1337上運行,但使用此端口不能解決問題。嘗試導航到移植的地址會產生超時。

任何想法?

回答

4

編輯:嘗試從圖庫https://portal.azure.com創建「Node JS空Web應用程序」,並將web.config和網站與您擁有的內容進行比較。有可能您錯過了一些配置設置。

enter image description here

以前的答案:第一關,只有端口80和443都在Azure的Web應用程序(天青網站的新名稱)。所以港口1337將無法正常工作。將您的應用重新配置爲在端口80或443上運行。關於權限問題,您是否啓用了應用服務驗證?通過編輯Web應用程序的設置,確保它被禁用,如下所示。

enter image description here

+0

我現在在端口80上運行,身份驗證已禁用... grr ... – serlingpa

+0

將您的應用與圖庫應用進行比較,正如我在上面的編輯中所述。 – theadriangreen

+0

我可以在Azure中找到node.js初學者應用程序!我在「新建」部分搜索了「節點」。 – serlingpa

3

你可以試着從舊的門戶http://manage.windowsazure.com圖庫打造「節點JS空Web應用程序」的實例,見下文。

enter image description here

enter image description here

然後,在Web應用程序信息中心頁quick glanceset up deployment from source control部署Web應用程序。

enter image description here

enter image description here

現在,瀏覽網頁應用http://<app-name>.azurewebsites.net工作正常。

3

我有同樣的問題,

你需要web.config中的package.json,服務器。在根JS

的web.config:

<configuration> 
    <system.webServer> 
     <handlers> 
      <!-- indicates that the app.js file is a node.js application to be handled by the iisnode module --> 
      <add name="iisnode" path="server.js" verb="*" modules="iisnode" /> 
     </handlers> 
     </system.webServer> 
</configuration> 

中的package.json,你需要有:

... 
    "scripts": { 
    "start": "node server" 
    }, 
... 

,並在您server.js確保您設置的服務器端口號到

process.env.PORT || 1337;

相關問題