标签: azure-web-sites

在Azure移动服务和Azure网站之间共享表

我想创建一个共享同一数据库的网站和Windows 8应用程序.我按照本教程创建了网站https://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/,我使用Azure管理门户创建了我的移动服务.

虽然它们中的每一个都能很好地工作,但我无法通过Web应用程序将表格显示在我的移动服务中.当我使用我的JS应用程序连接时

var mobileService = new Microsoft.WindowsAzure.MobileServices.MobileServiceClient(
 "url",
 "secret"
 );
Run Code Online (Sandbox Code Playgroud)

表不存在.

如何在两个服务之间共享这些表?

azure azure-web-sites azure-mobile-services

1
推荐指数
1
解决办法
1868
查看次数

如何知道Azure WebSite实例(WebApp)被关闭的原因?

通过查看我的Pingdom报告,我注意到我的WebSite实例正在被回收.基本上,Pingdom用于保持我的网站温暖.当我深入研究Azure日志即/ LogFiles/kudu/trace时,我注意到许多带有"shutdown"或"startup"后缀的小xml文件,即:

2015-07-29T20-05-05_abc123_002_Shutdown_0s.xml
Run Code Online (Sandbox Code Playgroud)

虽然我怀疑这可能与MS修补虚拟机有关,但我不确定.我的应用程序没有显示任何引发的异常,因此我怀疑它是在操作系统级别发生的.有没有办法找出我的实例被关闭的原因?

我也承认我使用的一个S2实例可以根据CPU的使用情况进行三次扩展.我们可能需要检查这个以使用2-3设置.显然,这会使成本翻倍.

编辑

我查看了我的操作日志,我看到的只是"UpdateWebsite"状态为"succeeded",但是我看到上述文件的时间没什么.所以似乎"实例"正在关闭,但事件没有出现在"操作日志"中.为什么会这样?昨天大概有5个,但最后一个"操作日志"条目是29/7.

昨天关闭xml文件之一的示例:

2015-08-05T13-26-18_abc123_002_Shutdown_1s.xml
Run Code Online (Sandbox Code Playgroud)

azure azure-web-sites

1
推荐指数
1
解决办法
817
查看次数

单个Azure Web App的多个实例共享一个磁盘吗?

我正在开发Azure Web Apps(以前称为Websites)中的应用程序,并希望确定我了解本地磁盘在多实例场景中的使用方式.当我扩展到多个实例时,它们是否与所有应用程序文件共享一个虚拟磁盘?

考虑这个例子:

  • 在5个实例上运行的应用程序
  • 应用程序中的一个页面,它将文件上传到本地磁盘,比如Server.MapPath("〜/ Content")(我知道存储会更好,但只是为了概念)
  • 是否所有5个实例都可以访问此文件,还是仅存在于上载的实例上?

azure azure-web-sites

1
推荐指数
1
解决办法
1256
查看次数

诊断记录设置是否会因设计而自行关闭?

我已经在我的azure网站上多次启用了诊断日志记录(仅对文件系统或blob的错误级别),并确认它正在运行.当我回来检查第二天它关闭.我似乎无法找到任何表明这是设计的文档.

azure azure-web-sites

1
推荐指数
2
解决办法
385
查看次数

SignalR中的内存使用情况重新启动ASP.NET Web应用

我正在试用一个用ASP.NET MVC(C#)编写的在线游戏,使用SignalR进行游戏的实时性,并作为Azure Web应用程序托管。这是一个相当简单的桌上型游戏,但是我遇到了一个问题,即在高峰负载(晚上和周末)下,应用程序使用了过多的内存,并且工作进程自动重新启动。

这是我的SignalR连接类的粗略代码概述(已删除日志记录,空检查等内容):

namespace MyApp.Connections
{
    public class GameConnection : PersistentConnection
    {
        protected override Task OnDisconnected(IRequest request, string connectionId, bool stopCalled)
        {
            Game game = GameService.GetGameByConnectionId(connectionId);
            List<Task> connectionTasks = new List<Task>();
            Player player = game.GetPlayer(connectionId);

            game.RemovePlayer(player);

            foreach (Player playerToUpdate in game.Players)
            {
                GameActionResponse response = new GameActionResponse(game);
                response.Message = string.Format("Player '{0}' has left the game.", player.Name);
                connectionTasks.Add(Connection.Send(playerToUpdate.ConnectionId, response));
            }          

            return Task.WhenAll(connectionTasks);
        }

        protected override Task OnReceived(IRequest request, string connectionId, string data)
        {
            Game game = GameService.GetGameByConnectionId(connectionId);
            List<Task> connectionTasks = …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc memory-management signalr azure-web-sites

1
推荐指数
1
解决办法
1676
查看次数

未为Azure WebApp调用OpenIdConnectAuthenticationNotifications.AuthorizationCodeReceived事件由Azure Active Directory保护

我的MVC WebApp部署到Azure Paas并使用Azure AD进行保护.身份验证设置使用下面的示例代码作为其基础,它在localhost中使用IISExpress或IIS.

https://github.com/Azure-Samples/active-directory-dotnet-webapp-webapi-openidconnect

但是在部署到Azure之后它无法正常工作.即使用户将正确进行身份验证,也永远不会调用AuthorizationCodeReceived委托.

这是设置身份验证的启动代码:

void ConfigureAuth(IAppBuilder app,  Container container) {
        _log.Debug("Configuring Azure Authentication");

        AzureActiveDirectoryAppSetting setting = container.GetInstance<IAzureActiveDirectoryAppSettingFactory>().Get();
        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
        app.UseCookieAuthentication(new CookieAuthenticationOptions());
        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions() {
                ClientId = setting.ClientID,
                Authority = setting.Authority,
                PostLogoutRedirectUri = setting.PostLogoutRedirectUrl,
                RedirectUri = setting.ReplyUrl,
                Notifications = new OpenIdConnectAuthenticationNotifications() {
                    AuthorizationCodeReceived = new Func<Microsoft.Owin.Security.Notifications.AuthorizationCodeReceivedNotification, System.Threading.Tasks.Task>(args => OnAuthorizationCodeReceived(args, container)),
                    AuthenticationFailed = new Func<Microsoft.Owin.Security.Notifications.AuthenticationFailedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>, System.Threading.Tasks.Task>(OnAuthorizationFailed),
                }
            }
        );
    }

    System.Threading.Tasks.Task OnAuthorizationFailed(Microsoft.Owin.Security.Notifications.AuthenticationFailedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> args) {
        _log.Error("Authorization Failed");
        return System.Threading.Tasks.Task.FromResult<string>(null);
    }
    System.Threading.Tasks.Task OnAuthorizationCodeReceived(Microsoft.Owin.Security.Notifications.AuthorizationCodeReceivedNotification args, Container container) {
        _log.Debug("Authorization Code …
Run Code Online (Sandbox Code Playgroud)

azure azure-web-sites azure-active-directory

1
推荐指数
1
解决办法
1802
查看次数

Microsoft Azure应用服务存储

我怀疑购买微软天蓝色应用程序服务来托管我的应用程序.我已经测试了免费配置文件,我担心切换到基本配置文件.那是我的问题.我看到的在Azure上的网站此表在这里,我将有一个磁盘空间10GB为我的应用程序文件.当我继续价格计算器时,我看到了这一点 我的问题是:为什么我在这里看到10GB的临时存储空间?我会随时丢失位于wwwroot文件夹中的应用程序文件吗?

c# azure azure-storage azure-web-sites azure-app-service-plans

1
推荐指数
1
解决办法
4642
查看次数

NodeJS 8.10.0 - Azure(iisnode) - 在严格模式之外尚不支持块范围的声明(let,const,function,class)

我在Microsoft Azure中托管NodeJs Web应用程序,我收到以下错误:

Sun Mar 25 2018 01:32:14 GMT+0000 (Coordinated Universal Time): Application has thrown an uncaught exception and is terminated: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (D:\home\site\wwwroot\server\helpers\email.js:1:77)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (D:\home\site\wwwroot\server\controllers\email.js:2:13)
    at …
Run Code Online (Sandbox Code Playgroud)

azure node.js azure-web-sites mailgun

1
推荐指数
1
解决办法
762
查看次数

ASP.NET Core + ApplicationInsights将错误记录为跟踪

我正在使用Microsoft.ApplicationInsights.AspNetCore(https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore)。

我通过在Programs.cs和启动类中添加.UseApplicationInsights()来启用应用程序见解:

    loggerFactory.AddApplicationInsights(app.ApplicationServices);
Run Code Online (Sandbox Code Playgroud)

一切正常,我可以在应用程序洞察中查看请求,但是当我尝试记录错误时(例如在控制器中):

        _logger.LogError("My Error Log");
        _logger.LogError("Test", new Exception("Test"));
Run Code Online (Sandbox Code Playgroud)

两者均记录为跟踪事件,而不是应用程序见解中的异常。

我如何使它记录为例外?

c# azure-web-sites azure-application-insights asp.net-core

1
推荐指数
2
解决办法
2108
查看次数

有没有在Azure中的应用程序之间共享配置的好方法?

我们有一个内置于Azure应用中的大型系统。它由用于我们的API的应用程序服务和用于后端处理的多个功能应用程序组成。

允许这些应用共享配置的最佳方法是什么?

当前,我们使用ARM模板为每个应用程序设置环境变量,这对于部署时很好,但是没有什么可以使配置在应用程序之间保持同步。

用例可能是控制子系统是否可运行的功能标志。我们可能希望在API和Functions App中使用此标志。目前,我们可以手动进入并在每个应用程序中设置变量,但是如果只需要在一个位置进行操作,则将更易于管理。

理想情况下,Azure会检测到对配置的任何更新,并触发服务的重新启动,就像本机实现中当前发生的那样。

有没有一种好的现成的方法来做到这一点?还是我将自己使用数据库中的表和轻量级函数滚动?

configuration azure azure-web-sites azure-functions

1
推荐指数
1
解决办法
205
查看次数