App Service 服務URL沒法訪問,進入門戶中的Advanced Tools(Kudu)、App Service Editor (Preview)等頁面沒法打開, 打開就出現 The service is unavailable 錯誤。php
因爲沒法打開高級工具(Kudu)並收集當前應用的日誌,而根據錯誤消息「The service is unavailable」代表後端Host當前App Service的虛擬機實例出現了問題,那麼能夠經過人爲的操做來改變後端實例。根據App Service不一樣訂價層所使用的VM大小不同,及多實例的設計原理,能夠經過如下兩種方式來改變後端實例:web
1)增長訂價層,把當前的實例級別提高(在 Azure 應用服務中縱向擴展應用:https://docs.azure.cn/zh-cn/app-service/manage-scale-up#scale-up-your-pricing-tier)後端
2)增長,減小實例個數(增長用於運行應用的 VM 實例數。 能夠根據訂價層,最多向外縮放到 30 個實例)app
經過以上操做後,進入Kudu站點,查看 Logfiles 中日誌,最終收集到App Service的日誌,在日誌中發現異常關鍵信息: There is not enough space on the disk.ide
異常消息全文:工具
System.Exception: Per site php.ini file was not created. ---> System.IO.IOException: There is not enough space on the disk.ui
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)spa at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)設計 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)3d at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.CreatePerSitePhpSettingsFile(StartSiteContext startSiteContext, String phpIniConfigPath, String phpInstallationPath, Version phpVersion) --- End of inner exception stack trace --- at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.CreatePerSitePhpSettingsFile(StartSiteContext startSiteContext, String phpIniConfigPath, String phpInstallationPath, Version phpVersion) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.SetupPhpCallback(StartSiteContext startSiteContext, ICollection`1 configurationFiles, Version version, Boolean is64bit, String installationPath) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.<>c__DisplayClass16_0.<CreateWorkItem>b__0(Version version, Boolean is64bit, String path) at Microsoft.Web.Hosting.StartSiteContext.SetupPhp(Func`4 versionCallback) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.CreateWorkItem(StartSiteContext startSiteContext, DateTime requestTimestamp, ServiceContextMode mode, PerfData coldStartPerfData, String coldStartRequestId, Boolean handlingChangeNotification, Boolean isPrewarmPing, GetZipFromFileCacheTask getZipTask) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.ProvisionSiteInNormalMode(DateTime startTime, StartSiteContext startSiteContext, PerfData coldStartPerfData, String appHostPath, String requestId, Boolean isRequestFromExternalSource, Boolean isPrewarmPing) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.StartHostNameInternal(String hostName, Int32 serverPort, String token, String requestId, Boolean isHttpForward, Boolean isPrewarmPing) at Microsoft.Web.Hosting.ProcessModel.SiteStartAndChangeManager.StartHostName(String hostName, Int32 serverPort, String token, String requestId, Boolean isHttpForward, Boolean isPrewarmPing) |
進入Kudu -> Debug Console,而後選擇 cmd
,以下圖:
du -sh *
查看具體文件佔用大小,如圖所示:
在 Azure 應用服務中縱向擴展應用:https://docs.azure.cn/zh-cn/app-service/manage-scale-up#scale-up-your-pricing-tier
如何檢測 Web 應用沙盒環境文件系統存儲量: https://docs.azure.cn/zh-cn/articles/azure-operations-guide/app-service-web/aog-app-service-web-howto-detect-file-storage-in-sandbox-environment