gpt4 book ai didi

azure - 使用 ARM 模板从头开始重新部署 azure web 应用程序会导致 404 网站未找到

转载 作者:行者123 更新时间:2023-12-03 00:29:08 25 4
gpt4 key购买 nike

我正在使用 ARM 模板来部署我的 Azure 资源组,作为我的发布定义的一部分。对于我的开发环境,我将删除整个资源组,然后使用 ARM 模板重新部署它。

在部署过程中,我通过获取 swagger 定义中包含的版本号来测试部署到暂存槽的 API。这意味着此时我的网络应用程序可以正确访问。为了完成部署,我将生产槽与暂存槽交换。

之后,当我尝试访问我的网络应用程序 https://mywebapp.azurewebsite.net 时,Chrome 停留在蓝页上,并显示 404 Web Site not found。该页面提出了 2 个解决方案:

  • 确保自定义域正常工作,但我在此网络应用上没有自定义域。
  • 从命令行刷新 DNS 缓存。我做到了,但页面刷新后没有任何变化。

知道出了什么问题吗?

这显然与我删除整个资源组以重新创建它有关。我在 QA/Prod 环境中没有看到相同的行为,默认情况下我不会删除资源组。

此外,我在开发部署过程中注意到一些警告消息:

2018-05-11T14:12:07.6188142Z ##[debug][PUT]https://$mywebapp__maintenance:***@mywebapp-maintenance.scm.azurewebsites.net/api/deployments/5921526047927616
2018-05-11T14:12:12.8970287Z ##[debug]updateDeployment. Data: {"statusCode":403,"statusMessage":"Forbidden","headers":{"content-type":"text/html","server":"Microsoft-IIS/10.0","date":"Fri, 11 May 2018 14:12:12 GMT","connection":"close","content-length":"2399"},"body":"<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <title>Web App - Unavailable</title>\r\n <style type=\"text/css\">\r\n html {\r\n height: 100%;\r\n width: 100%;\r\n }\r\n\r\n #feature {\r\n width: 960px;\r\n margin: 95px auto 0 auto;\r\n overflow: auto;\r\n }\r\n\r\n #content {\r\n font-family: \"Segoe UI\";\r\n font-weight: normal;\r\n font-size: 22px;\r\n color: #ffffff;\r\n float: left;\r\n width: 460px;\r\n margin-top: 68px;\r\n margin-left: 0px;\r\n vertical-align: middle;\r\n }\r\n\r\n #content h1 {\r\n font-family: \"Segoe UI Light\";\r\n color: #ffffff;\r\n font-weight: normal;\r\n font-size: 60px;\r\n line-height: 48pt;\r\n width: 800px;\r\n }\r\n\r\n p a, p a:visited, p a:active, p a:hover {\r\n color: #ffffff;\r\n }\r\n\r\n #content a.button {\r\n background: #0DBCF2;\r\n border: 1px solid #FFFFFF;\r\n color: #FFFFFF;\r\n display: inline-block;\r\n font-family: Segoe UI;\r\n font-size: 24px;\r\n line-height: 46px;\r\n margin-top: 10px;\r\n padding: 0 15px 3px;\r\n text-decoration: none;\r\n }\r\n\r\n #content a.button img {\r\n float: right;\r\n padding: 10px 0 0 15px;\r\n }\r\n\r\n #content a.button:hover {\r\n background: #1C75BC;\r\n }\r\n </style>\r\n</head>\r\n<body bgcolor=\"#00abec\">\r\n <div id=\"feature\">\r\n <div id=\"content\">\r\n <h1 id=\"unavailable\">Error 403 - This web app is stopped.</h1>\r\n <p id=\"tryAgain\">The web app you have attempted to reach is currently stopped and does not accept any requests. Please try to reload the page or visit it again soon.</p>\r\n <p id=\"toAdmin\">If you are the web app administrator, please find the common 403 error scenarios and resolution <a href=\"http://blogs.msdn.com/b/waws/archive/2016/01/05/azure-web-apps-error-403-this-web-app-is-stopped.aspx\" target=\"_blank\">here</a>. For further troubleshooting tools and recommendations, please visit <a href=\"https://portal.azure.com/\">Azure Portal</a>.</p>\r\n </div>\r\n </div>\r\n</body>\r\n</html>\r\n"}
2018-05-11T14:12:12.9060930Z ##[warning]Error: Failed to update Deployment status. Error: Forbidden (CODE: 403)
2018-05-11T14:12:12.9071339Z ##[debug]Processed: ##vso[task.issue type=warning;]Error: Failed to update Deployment status. Error: Forbidden (CODE: 403)
...
2018-05-11T14:21:03.6299150Z ##[debug][PUT]https://$mywebapp:***@mywebapp.scm.azurewebsites.net/api/deployments/5921526048459655
2018-05-11T14:21:03.8067460Z ##[debug]updateDeployment. Data: {"statusCode":404,"statusMessage":"Site Not Found","headers":{"content-type":"text/html","server":"Microsoft-IIS/10.0","date":"Fri, 11 May 2018 14:21:03 GMT","connection":"close","content-length":"2778"},"body":"<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <title>Microsoft Azure Web App - Error 404</title>\r\n <style type=\"text/css\">\r\n html {\r\n height: 100%;\r\n width: 100%;\r\n }\r\n\r\n #feature {\r\n width: 960px;\r\n margin: 75px auto 0 auto;\r\n overflow: auto;\r\n }\r\n\r\n #content {\r\n font-family: \"Segoe UI\";\r\n font-weight: normal;\r\n font-size: 22px;\r\n color: #ffffff;\r\n float: left;\r\n margin-top: 68px;\r\n margin-left: 0px;\r\n vertical-align: middle;\r\n }\r\n\r\n #content h1 {\r\n font-family: \"Segoe UI Light\";\r\n color: #ffffff;\r\n font-weight: normal;\r\n font-size: 60px;\r\n line-height: 48pt;\r\n width: 800px;\r\n }\r\n\r\n a, a:visited, a:active, a:hover {\r\n color: #ffffff;\r\n }\r\n\r\n #content a.button {\r\n background: #0DBCF2;\r\n border: 1px solid #FFFFFF;\r\n color: #FFFFFF;\r\n display: inline-block;\r\n font-family: Segoe UI;\r\n font-size: 24px;\r\n line-height: 46px;\r\n margin-top: 10px;\r\n padding: 0 15px 3px;\r\n text-decoration: none;\r\n }\r\n\r\n #content a.button img {\r\n float: right;\r\n padding: 10px 0 0 15px;\r\n }\r\n\r\n #content a.button:hover {\r\n background: #1C75BC;\r\n }\r\n </style>\r\n <script type=\"text/javascript\">\r\n function toggle_visibility(id) {\r\n var e = document.getElementById(id);\r\n if (e.style.display == 'block')\r\n e.style.display = 'none';\r\n else\r\n e.style.display = 'block';\r\n }\r\n </script>\r\n</head>\r\n<body bgcolor=\"#00abec\">\r\n <div id=\"feature\">\r\n <div id=\"content\">\r\n <h1>404 Web Site not found.</h1>\r\n <p>You may be seeing this error due to one of the reasons listed below :</p>\r\n <ul>\r\n <li>Custom domain has not been configured inside Azure. See <a href=\"https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-custom-domain\">how to map an existing domain</a> to resolve this.</li>\r\n <li>Client cache is still pointing the domain to old IP address. Clear the cache by running the command <i>ipconfig/flushdns.</i></li>\r\n </ul>\r\n <p>Checkout <a href=\"https://blogs.msdn.microsoft.com/appserviceteam/2017/08/08/faq-app-service-domain-preview-and-custom-domains/\">App Service Domain FAQ</a> for more questions.</p>\r\n </div>\r\n </div>\r\n</body>\r\n</html>\r\n"}
2018-05-11T14:21:03.8165740Z ##[warning]Error: Failed to update Deployment status. Error: Site Not Found (CODE: 404)
2018-05-11T14:21:03.8166510Z ##[debug]Processed: ##vso[task.issue type=warning;]Error: Failed to update Deployment status. Error: Site Not Found (CODE: 404)
...
2018-05-11T14:22:19.4199443Z ##[debug][PUT]https://$mywebapp__maintenance:***@mywebapp-maintenance.scm.azurewebsites.net/api/deployments/5921526048539418
2018-05-11T14:22:19.6243408Z ##[debug]updateDeployment. Data: {"statusCode":404,"statusMessage":"Site Not Found","headers":{"content-type":"text/html","server":"Microsoft-IIS/10.0","date":"Fri, 11 May 2018 14:22:19 GMT","connection":"close","content-length":"2778"},"body":"<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <title>Microsoft Azure Web App - Error 404</title>\r\n <style type=\"text/css\">\r\n html {\r\n height: 100%;\r\n width: 100%;\r\n }\r\n\r\n #feature {\r\n width: 960px;\r\n margin: 75px auto 0 auto;\r\n overflow: auto;\r\n }\r\n\r\n #content {\r\n font-family: \"Segoe UI\";\r\n font-weight: normal;\r\n font-size: 22px;\r\n color: #ffffff;\r\n float: left;\r\n margin-top: 68px;\r\n margin-left: 0px;\r\n vertical-align: middle;\r\n }\r\n\r\n #content h1 {\r\n font-family: \"Segoe UI Light\";\r\n color: #ffffff;\r\n font-weight: normal;\r\n font-size: 60px;\r\n line-height: 48pt;\r\n width: 800px;\r\n }\r\n\r\n a, a:visited, a:active, a:hover {\r\n color: #ffffff;\r\n }\r\n\r\n #content a.button {\r\n background: #0DBCF2;\r\n border: 1px solid #FFFFFF;\r\n color: #FFFFFF;\r\n display: inline-block;\r\n font-family: Segoe UI;\r\n font-size: 24px;\r\n line-height: 46px;\r\n margin-top: 10px;\r\n padding: 0 15px 3px;\r\n text-decoration: none;\r\n }\r\n\r\n #content a.button img {\r\n float: right;\r\n padding: 10px 0 0 15px;\r\n }\r\n\r\n #content a.button:hover {\r\n background: #1C75BC;\r\n }\r\n </style>\r\n <script type=\"text/javascript\">\r\n function toggle_visibility(id) {\r\n var e = document.getElementById(id);\r\n if (e.style.display == 'block')\r\n e.style.display = 'none';\r\n else\r\n e.style.display = 'block';\r\n }\r\n </script>\r\n</head>\r\n<body bgcolor=\"#00abec\">\r\n <div id=\"feature\">\r\n <div id=\"content\">\r\n <h1>404 Web Site not found.</h1>\r\n <p>You may be seeing this error due to one of the reasons listed below :</p>\r\n <ul>\r\n <li>Custom domain has not been configured inside Azure. See <a href=\"https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-custom-domain\">how to map an existing domain</a> to resolve this.</li>\r\n <li>Client cache is still pointing the domain to old IP address. Clear the cache by running the command <i>ipconfig/flushdns.</i></li>\r\n </ul>\r\n <p>Checkout <a href=\"https://blogs.msdn.microsoft.com/appserviceteam/2017/08/08/faq-app-service-domain-preview-and-custom-domains/\">App Service Domain FAQ</a> for more questions.</p>\r\n </div>\r\n </div>\r\n</body>\r\n</html>\r\n"}
2018-05-11T14:22:19.6268196Z ##[warning]Error: Failed to update Deployment status. Error: Site Not Found (CODE: 404)
2018-05-11T14:22:19.6268967Z ##[debug]Processed: ##vso[task.issue type=warning;]Error: Failed to update Deployment status. Error: Site Not Found (CODE: 404)

最佳答案

该行为可能是由您计算机上的 DNS 缓存引起的。当您删除并重新创建应用程序时,它最终可能会出现在具有不同 IP 地址的不同规模单位上。但由于您可能只是使用具有相同主机名的旧应用程序,因此您的计算机已缓存其 IP。解决方法:

  • 等待 TTL 过期
  • 清除您的 DNS 缓存。可能很棘手,因为某些代理也可能有缓存
  • 如果您在其他未缓存该数据的计算机上尝试,它应该可以立即运行(例如使用您的手机尝试)

关于azure - 使用 ARM 模板从头开始重新部署 azure web 应用程序会导致 404 网站未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50295606/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com