问题我正在尝试在 Azure 上部署 Angular 应用程序(Angular 版本 - 8.2.14)。我已经习惯用 Kudu 来部署应用程序,代码是从我的 Github Repo 部署的。部署状态为“成功”。
访问已部署的 Web 应用程序的 URL 时出错“您无权查看此目录或页面。”
尝试解决问题的方法要获得有关错误的更多详细信息,我尝试启用应用服务日志部分中的“详细错误消息”。但我也无法从中获得太多信息。我在“详细错误消息”中找到的唯一信息是“当读取 Web 服务器或 Web 应用程序的配置文件出现问题时会发生此错误。在某些情况下,事件日志可能包含有关导致此问题的原因的更多信息错误。”
我还检查了事件日志,发现以下信息,
Exception: System.IO.IOException
Message: The handle is invalid.
StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__ConsoleStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(String value)
at System.IO.TextWriter.SyncTextWriter.Write(String value)
at Kudu.Core.Infrastructure.ProgressWriter.IdleWriter(Object state) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\ProgressWriter.cs:line 109
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback(Int32 id)</Data></EventData></Event><Event><System><Provider Name="HttpPlatformHandler"/><EventID>2000</EventID><Level>4</Level><Task>0</Task><Keywords>Keywords</Keywords><TimeCreated SystemTime="2020-05-01T16:57:34Z"/><EventRecordID>385268109</EventRecordID><Channel>Application</Channel><Computer>RD501AC5040133</Computer><Security/></System><EventData><Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05B6D878 [TID 6180] [PID 5664]</Data></EventData></Event><Event><System><Provider Name=".NET Runtime"/><EventID>1026</EventID><Level>1</Level><Task>0</Task><Keywords>Keywords</Keywords><TimeCreated SystemTime="2020-05-01T16:57:35Z"/><EventRecordID>385269218</EventRecordID><Channel>Application</Channel><Computer>RD501AC5040133</Computer><Security/></System><EventData><Data>Application: w3wp.exe
Framework Version: v4.0.30319
我正在尝试其他选项(主要是检查在 Azure 上部署 Angular 应用程序的教程),但还没有幸运地解决这个问题。网页配置
<!-- indicates that the index.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="index.js" verb="*" modules="iisnode" />
</handlers>
<!-- adds index.js to the default document list to allow
URLs that only specify the application root location,
e.g. http://mysite.antarescloud.com/ -->
<defaultDocument enabled="true">
<files>
<add value="index.js" />
</files>
</defaultDocument>
<system.web>
<customErrors mode="Off" />
</system.web>
</system.webServer>
</configuration>
根据您收到的错误消息,应用程序文件似乎未部署到预期位置。
请参考我的文章(法文):http : //espacenuagic.com/2019/03/10/deployer-une-application-angular-sur-azure-app-service/特别注意你的内容重新部署,如图:
在本例中,我正在部署“angled”文件夹的内容,而不是“dist”文件夹。
我希望这会有所帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句