我有一个带有网站和几个项目库的ASP.NET 5解决方案.我正在使用MVC 6和Entity Framework 7.本地应用程序工作正常,直到今天它还在Azure上部署为Azure网站.
但是今天在Azure上进行最新部署之后,我在启动时遇到了类似错误500(仍在本地工作正常):

我试图通过以下方式获得更多细节:
似乎在启动/配置步骤期间发生了错误/异常,但我仍然在没有详细信息的情况下获得通用错误页面.甚至在服务器上生成的版本(DetailedErrors文件夹)我得到了这个:

我启用了失败的请求跟踪但仍然没有有用的信息:

即使我在启动/配置中删除代码并按照建议添加try/catch,我也得到了相同的错误而没有发现.它似乎是一个配置/编译问题,但很难在没有任何信息的情况下进行调试.
在当前的技术预览中,Azure允许您创建10个ASP.NET网站.他们被赋予了域名,如http://yourappname.azurewebsites.net.目前有没有办法将域名指向此网站?或者有没有计划在未来支持这个?
我用windows azure进行了免费试用,我离开了这个国家,它已经用光了.
我现在已升级为即用即付帐户.都好.
但是,我之前的网站仍然使用我的旧订阅,有没有办法使用我的新付费订阅来重新激活这些网站?
很多时候,当我在VS13中点击Publish时,我会让网站进行编译,但在上传时我收到的错误是文件正忙.
更新文件(MyAzureSite\PrecompiledApp.config).
C:...\v12.0\Web\Microsoft.Web.Publishing.targets(4255,5):
错误ERROR_FILE_IN_USE:Web部署任务失败.
(文件'PrecompiledApp.config'正在使用中.有关
详细信息,请访问:http://go.microsoft.com/fwlink/?LinkId = 221672 #ERROR_FILE_IN_USE.)
当我按照提供的链接时,建议我应该启用appOffline规则."当然!",我想,对自己.但是如何?!我用谷歌搜索了它,只是为了获得一堆文件,这些文件应该在发布时取代网站.但是,我没有得到关于如何摆脱我的小问题的信息.
我轻松地从Azure网站下载了一个发布配置文件,现在我正在使用它(你知道,ALT+ B+ H).
现在我通过转到Azure的门户并手动使站点脱机来解决问题.然后我可以发布,之后我将网站上线.非常不切实际和痛苦乏味.
造成这种情况的原因是什么?如何杀死它?
理想情况下,我想使用构建变量(在VSTS上)配置我们的Azure Web App应用程序设置,例如:
我们使用Powershell脚本执行发布任务.要设置应用程序设置,可以使用以下脚本:
param($websiteName, $appSettings)
Set-AzureWebsite -Name $websiteName -AppSettings $appSettings
Run Code Online (Sandbox Code Playgroud)
我可以手动将这些构建变量传递给Powershell脚本构建任务,如下所示:
PrepareAppSettings.ps1 -websiteName "MyWebApp" -appsettings @{"MyConnectionString" = $(MyConnectionString);"MyRandomService" = $(MyRandomService);"MyRandomServiceClient"=$(MyRandomServiceClient);"MyRandomServicePassword"=$(MyRandomServicePassword)}
Run Code Online (Sandbox Code Playgroud)
有没有办法将所有构建变量传递给脚本而不必在哈希表中显式指定每个变量?
我在Azure网站(不是托管服务)中有网站,我需要在那里处理带有私钥的.pfx证书.
var x509Certificate2 = new X509Certificate2(certificate, password);
Run Code Online (Sandbox Code Playgroud)
但我遇到了以下异常:
System.Security.Cryptography.CryptographicException: The system cannot find the file specified.
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)
Run Code Online (Sandbox Code Playgroud)
在文章http://blog.tylerdoerksen.com/2013/08/23/pfx-certificate-files-and-windows-azure-websites/我发现它发生是因为默认情况下系统使用用户的本地目录存储密钥.但Azure网站没有本地用户配置文件目录.在同一篇文章中,作者建议使用X509KeyStorageFlags.MachineKeySetflag.
var x509Certificate2 = new X509Certificate2(certificate, password, X509KeyStorageFlags.MachineKeySet);
Run Code Online (Sandbox Code Playgroud)
但现在我还有其他例外:
System.Security.Cryptography.CryptographicException: Access denied.
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& …Run Code Online (Sandbox Code Playgroud) 我有一个Azure网站/ Web应用程序,提供静态JS和CSS文件非常慢,但似乎完全没有服务二进制文件.
为了测试这个问题,我上传了两个30MB的文件,一个是big.js,另一个是big.rar.如果我很幸运,JS文件的下载量大约为100KB/s.RAR文件的下载速度约为4,000KB/s.结果非常一致.
我已经检查了Fiddler并且两种情况都发生了gzip压缩.正如所料,JS文件使用MIME类型application/x-javascript发送,而RAR文件作为application/octet-stream提供.
我很难理解这一点 - 为什么IIS会比另一种更慢地提供一种静态内容?
我一直在调查我的生产应用程序的缓慢预热时间,我得到了一些意想不到的结果.
在各种Azure VM上进行测试表明,预热时间与应用程序服务器性能密切相关(因此它不是外部请求,包括sql),但真正有趣的是与Azure Web Apps和我自己的本地计算机的比较(所有时间都是从大约3次运行的平均值):
VM A0: >1m
VM A2: 13s
VM D2V2: 6.8s
VM D5V2: 7.8s
Wep App P2: 25s
Web App S2: 26.5s
My local machine: 6.6s
Run Code Online (Sandbox Code Playgroud)
我的本地机器是一台3.3GHz的i5.
即使本地计算机通过Internet连接到同一SQL Azure数据库,该本地计算机也是最快的,并且该请求包括实体框架的模型检查.
所有测试都使用.NET 4.6.1,这是目前最新的版本.
明显的结论:
这看起来很可疑.还有什么想法可能会发生什么?或者要测试什么?
在进行一些分析之后编辑:以下所有内容都没有解释我的问题,但它仍然是有趣的信息(在另一个A2 VM上测试,在连接分析器时总请求时间为20秒):
几乎没有并行化.
我正在寻找一些答案,在Azure上从那些在迷你帐户上托管的人,即10个免费网站.
特别:
试用期和10个终身免费的网站对开发人员很有吸引力,但很难理解,而且非常令人困惑.我们意识到Azure正试图与免费的亚马逊帐户匹配/竞争弹性计算.但是,服务不明确.
在以下页面 http://www.microsoft.com/Web/webmatrix/signin.aspx
它声明"如果您还没有Windows Azure网站,系统将提示您注册免费试用版,其中包括即使在免费试用期结束后您仍可以保留的10个网站."
这究竟是什么意思,其中包括10个网站,即使在免费试用结束后你仍可以保留?这是不是意味着,如果我不通过计算分配,我可以终身保留它,就像你早先的小企业一样
Azure错误是:
.Net Core:应用程序启动异常:System.IO.FileNotFoundException:找不到配置文件'appsettings.json',它不是可选的.
所以这有点模糊.我似乎无法解决这个问题.我正在尝试将一个.Net Core Web API项目部署到Azure,我收到此错误:
:(糟糕.500内部服务器错误启动应用程序时出错.
我已经部署了普通的.Net WebAPI,他们已经工作了.我已经按照在线教程进行了操作.但不知何故,我的项目已经破产.在Web.config上启用stdoutLogEnabled并查看Azure Streaming Logs给出了以下信息:
2016-08-26T02:55:12 Welcome, you are now connected to log-streaming service.
Application startup exception: System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional.
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Quanta.API.Startup..ctor(IHostingEnvironment env) in D:\Source\Workspaces\Quanta\src\Quanta.API\Startup.cs:line 50
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Microsoft.Extensions.Internal.ActivatorUtilities.GetServiceOrCreateInstance(IServiceProvider provider, …Run Code Online (Sandbox Code Playgroud) azure azure-web-sites .net-core asp.net-core asp.net-core-webapi
azure-web-sites ×10
azure ×8
asp.net ×2
asp.net-core ×2
.net-core ×1
azure-devops ×1
c# ×1
iis ×1
powershell ×1
publish ×1
tfs ×1