我发现在不活动期间向我们的Web角色发出请求会导致请求非常慢(最多30秒).在初始请求之后,角色将按预期执行.
经过大量谷歌搜索,我遇到了四种不同的策略(如下所列):
RoleEntryPoint.OnStart()public override bool OnStart()
{
using (var server = new ServerManager())
{
server.ApplicationPoolDefaults.ProcessModel.IdleTimeout = TimeSpan.Zero;
server.CommitChanges();
}
return base.OnStart();
}
Run Code Online (Sandbox Code Playgroud)
这也要求角色在更高的层次上运行.
RoleEntryPoint.Run()public override void Run()
{
var localuri = new Uri(string.Format("https://{0}/Help", RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["HttpsIn"].IPEndpoint));
while (true)
{
try
{
var request = (HttpWebRequest)WebRequest.Create(localuri);
request.Method = "GET";
var response = request.GetResponse();
}
catch { }
System.Threading.Thread.Sleep(3000);
}
}
Run Code Online (Sandbox Code Playgroud)
preloadEnabled和startMode在RoleEntryPoint.OnStart()public override void OnStart()
{
using (var serverManager = new ServerManager())
{
foreach …Run Code Online (Sandbox Code Playgroud) 我有一个通过VS 2012 Azure项目部署的项目(从VS的右侧,而不是手动).Web角色项目设置为在发布模式下构建"仅pdb"调试信息,但是部署PDB时未打包并复制到Azure上的Web角色VM.如何让PDB包含在包中并传输到服务器?
我想在生产中包含我的PDB的原因是因为我想在我的ELMAH报告中获取行号.
我是Windows Azure开发的新手,并且需要在Windows Azure存储表中存储一些数据.
该表实际上仅用于为位于azure存储驱动器上的某些文件提供快速查找机制.
因此,我计划在应用程序启动时填充此表(即在Web应用程序全局应用程序启动时)
而不是尝试维护此表以更改应用程序未运行时驱动器可能发生的更改.或者因为这个驱动器只是一个资源的vhd,我们可能偶尔上传一个新的vhd.
因此,而不是试图维持这一点的麻烦.在每次应用程序启动时重建此表就足够了.
我开始组合一些代码来检查表是否已经存在,如果它确实删除它,然后重新创建一个新表.
var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureStorage"].ConnectionString);
var tableClient = storageAccount.CreateCloudTableClient();
var rmsTable = tableClient.GetTableReference("ResourceManagerStorage");
rmsTable.DeleteIfExists();
rmsTable.Create();
Run Code Online (Sandbox Code Playgroud)
我曾预料到这不起作用.我收到以下错误:
The remote server returned an error: (409) Conflict.
HTTP/1.1 409 Conflict
Cache-Control: no-cache
Transfer-Encoding: chunked
Server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: c6baf92e-de47-4a6d-82b3-4faec637a98c
x-ms-version: 2012-02-12
Date: Tue, 19 Mar 2013 17:26:25 GMT
166
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>TableBeingDeleted</code>
<message xml:lang="en-US">The specified table is being deleted. Try operation later.
RequestId:c6baf92e-de47-4a6d-82b3-4faec637a98c
Time:2013-03-19T17:26:26.2612698Z</message>
</error>
0
Run Code Online (Sandbox Code Playgroud)
这样做的正确方法是什么?是否有一个事件可以订阅,以便在表被删除时通知您?有关实施此方法的最佳方法的其他建议吗?
据我所知,目前的情况如下:
你会选择什么?
我有一个在本地运行良好的MVC 4应用程序但在部署到Azure时失败并显示此消息:
[FileNotFoundException: Could not load file or assembly Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +0
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +40
我已经确定我引用了Microsoft.WindowsAzure.ServiceRuntime 1.8版并将其设置为复制本地.
我做谷歌,找不到任何准确的答案.
当我尝试将Web应用程序部署到不同的数据中心时,我收到以下错误消息:
Server response = 40652 Cannot move or create server.
Subscription 'xxxxxxxxxxxxx' will exceed server quota.
Run Code Online (Sandbox Code Playgroud)
请有人帮我理解如下:
在管理门户中,我在哪里可以找到给定订阅的最大配额?
上述错误是否表示Azure SQL Server或主机服务超出配额.
一个订阅可以创建多少台服务器?
我使用了Cerebrata云管理工作室,它显示了以下订阅详情:
核心:
9/20托管服务:4/20
存储:8/20
不确定Azure SQL Server是属于托管服务还是存储或上面未显示的其他内容.
谢谢.
我正在尝试将具有1个Web角色的Cloud Service部署到Azure.
当我这样做时,我得到这样的信息:
Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.
Run Code Online (Sandbox Code Playgroud)
该项目在本地运行得很好,我很难搞清楚如何开始调试这个问题.是否有任何常见问题导致此消息或步骤找出导致它的原因?
在2016年2月10日安装Windows更新后,azure角色无法在模拟器中启动(Full/Express).日志显示如下
[00005748:00006624, 2016/02/14, 12:03:24.391, FATAL] Role process exited with exit code of -2147024809
[00005748:00006624, 2016/02/14, 12:03:24.397, INFO ] Stopping role: deployment25(0).AzureCloudService2.WebRole1_IN_0. Notify: False Recycle: False StopTimeout: 30
[00005748:00006624, 2016/02/14, 12:03:24.398, IMPRT] State of deployment25(0).AzureCloudService2.WebRole1_IN_0 changed from RoleStateBusy to RoleStateStopping.
[00005748:00006624, 2016/02/14, 12:03:24.398, IMPRT] State of deployment25(0).AzureCloudService2.WebRole1_IN_0 changed from RoleStateStopping to RoleStateStopped.
[00005748:00006624, 2016/02/14, 12:03:24.398, ERROR] <- WapGetEnvironmentVariable=0x800700cb
[00005748:00006624, 2016/02/14, 12:03:24.398, WARN ] (Ignoring) Reading environment variable CleanupFirewallOnRoleRestart failed with HR: 800700cb
[00005748:00006624, 2016/02/14, 12:03:24.398, INFO ] The value of cleanupFirewallOnRoleRestart …Run Code Online (Sandbox Code Playgroud) azure azure-worker-roles azure-web-roles azure-compute-emulator
升级我们的项目以使用Azure SDK 2.5后,我在部署到Azure(Web角色)时遇到以下运行时异常:
无法加载文件或程序集'Microsoft.WindowsAzure.ServiceRuntime,Version = 2.4.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一.该系统找不到指定的文件.
NuGet引用的其中一个软件包仍在引用ServiceRuntime 2.4.0.0.根据我的理解,我需要做的就是bindingRedirect在我们的创建中web.config:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.5.0.0" newVersion="2.5.0.0"/>
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用.例外仍然存在.有人可以提供指导吗?
我的问题是我需要在构建后运行自定义cmd文件.我不想修改部署脚本,而只想轻松地向我的部署运行一些MSDOS命令.
我需要做的任务是在构建成功后在位于/source/copyextrafiles.cmd的存储库中运行cmd.
我怎样才能做到这一点?