我们最近在Azure应用服务计划下的网站上内存不足.
这会在所有应用程序上引发"内存资源耗尽"错误.
单击"CPU百分比和内存百分比"表示在过去24小时内峰值达到82%.
导航到"每个实例的度量标准(应用服务计划)"我可以看到所有Web应用程序.在应用程序服务计划使用率达到82%时,以MB为单位添加所有工作集的比例高达22%.
这个答案建议在Kudu中查看内存使用情况.
Azure Dashboard或Kudu有没有办法显示特定"应用服务计划"内存使用情况?
我要求允许我们的内部支持用户冒充我们的客户用户.
我目前正在使用IdentityServer4,Implicit Flow和OIDC Client.
迄今为止找到的资源.
鉴于在线资源有限,我是否可以/应该使用IdentityServer4实施模拟?
impersonation asp.net-core identityserver4 implicit-flow oidc-client-js
我有2个POCO,课程和特征与int PKs.我设置了导航属性,以便我可以成功地$expand
这样:
http://localhost:54321/odata/Lessons?$expand=Traits
http://localhost:54321/odata/Traits?$expand=Lessons
我将从Net 461迁移到.Net Core 2的最后一个障碍是创建关系.
具体来说,当我尝试调用以下方法时,通过以下请求,我得到一个404.
[AcceptVerbs("POST", "PUT")]
public async Task<IActionResult> CreateRef(
[FromODataUri] int key, string navigationProperty, [FromBody] Uri link)
{
.... Do Work
}
Run Code Online (Sandbox Code Playgroud)
邮差要求:
http://localhost:54321/odata/Lessons(1)/Traits/$ref
Run Code Online (Sandbox Code Playgroud)
身体:
{
"@odata.id":"http://localhost:54321/OData/traits(1)"
}
Run Code Online (Sandbox Code Playgroud)
以下是我的Startup.Configure
方法.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
...
var builder = ConfigureOdataBuilder(app);
app.UseMvc(routeBuilder =>
{
routeBuilder.Select().Expand().Filter().OrderBy().MaxTop(null).Count();
routeBuilder.MapODataServiceRoute("ODataRoute", "odata", builder.GetEdmModel());
// Work-around for #1175
routeBuilder.EnableDependencyInjection();
routeBuilder.MapRoute(name: "default", template: "{controller=Home}/{action=Index}/{id?}"); // enable mvc controllers
});
}
private ODataConventionModelBuilder ConfigureOdataBuilder(IApplicationBuilder app)
{ …
Run Code Online (Sandbox Code Playgroud) 我有一个ASP.NET Core 1.1 Web项目.
我已经安装了Microsoft.OData.Core,并在http://odata.github.io/下链接了"Getting Started" .
该页面上的以下链接均适用于.Net 45
这个月的旧答案链接到Microsoft.AspNetCore.OData,它不归Microsoft所有,最近一年前更新过.
这个SO答案暗示"ASP.net核心中的OData支持"
我看到这个第三方解决方案AutoODataEF.Core自动生成控制器.
最后,我看到这个git问题表明ASP.Net Core的OData WebAPI即将推出,但最终目前无法使用.
假设我有一个Person模型和一个EF DbContext.
如何实现最小的OData控制器?
我需要为Angular2客户端WebApp实现授权/身份验证以与资源服务器(WebApi)进行通信.
我正在调查IdentiyServer4并选择Grant Type/Flow.这里
使用Implicit Flow时,如何不要求SPA的用户每隔3600秒输入一次密码?推荐的access_token生命周期.我认为在获取新的授权URL时我有一些不明白的地方.
我看过的资源.
谢谢Scott的回答.我有一些阅读要做.
是否需要对Angular CLI Hello World应用优化,还是这是一个有效的"性能"结果?
在将Lighthouse应用于我们的live angular 4项目时,我们将与Angular CLI Hello World进行了比较.
从控制台:
npm install -g @angular/cli
ng new my-dream-app
cd my-dream-app
ng serve --prod
Run Code Online (Sandbox Code Playgroud)
在Chrome中 - > F12 - >审核 - >运行灯塔.
更新1
感谢@Moshe,使用:
ng serve --prod --build-optimizer
Run Code Online (Sandbox Code Playgroud)
提供以下内容: - 性能为96/100. - First Meaningful Paint是2,040ms - 感知速度指数:2,054(目标:<1,250); 等级92/100
最终难以形成一个单一,简明的问题.我理解 ng serve
不是为了生产使用,即使使用ags ..但这允许我在发布之前在我的localhost上进行测试.
使用带有隐式流/授权类型的Identity Server 4,.NetCore2.0和MS Identity;
我不清楚以下的责任,因为每个具体涉及验证/授权持票人令牌.
我有以下启动:
public void ConfigureServices(IServiceCollection services) {
...
services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority = GetAuthentication().ApiURL;
options.RequireHttpsMetadata = false;
options.ApiName = "afapps";
});
// Below needed to inject UserManager<ApplicationUser> userManager
// elsewhere in app as this happens to be the authORization server
// as opposed to authENtication server.
services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<AuthDbContext>()
.AddDefaultTokenProviders();
}
public void Configure(IApplicationBuilder app) {
app.UseAuthentication();
app.UseMvc();
}
Run Code Online (Sandbox Code Playgroud)
如果我services.AddIdentity<ApplicationUser, IdentityRole>()...
在启动时省略.在控制器我可以成功地使用[授权]和我的其他自定义ActionFilters
显示HttpContext.User.Identity.IsAuthenticated
的== true
.
但是,添加后services.AddIdentity<ApplicationUser, IdentityRole>()...
才能启用Identity的使用UserManager<ApplicationUser> …
我的数据看起来像:
客户表
CustomerId CustomerName CustomerEmail
------------------------------------------
1 Ben Ben@gmail.com
2 Robert Robert@gmail.com
3 Paul Paul@gmail.com
Run Code Online (Sandbox Code Playgroud)
客户联系人表
CustomerContactId CustomerId ContactName ContactEmail
----------------------------------------------------------
99 1 Lisa Lisa@msn.com
98 3 Jane Jane@msn.com
97 3 Wendy Wendy@msn.com
Run Code Online (Sandbox Code Playgroud)
这是我正在寻找的结果:
[
{
"CustomerId": 1,
"Names": [ "Ben","Lisa" ],
"Emails": [ "Ben@gmail.com","Lisa@msn.com" ]
},
{
"CustomerId": 2,
"Names": [ "Robert" ],
"Emails": [ "Robert@gmail.com" ]
},
{
"CustomerId": 3,
"Names": [ "Paul","Jane","Wendy" ],
"Emails": [ "Paul@gmail.com","Jane@msn.com","Wendy@msn.com" ]
}
]
Run Code Online (Sandbox Code Playgroud)
我尝试过的: 我很尴尬地说我还没有接近:
CustomerId CustomerName CustomerEmail
------------------------------------------ …
Run Code Online (Sandbox Code Playgroud) 有许多叠加层需要在window-resize
事件发生后重新定位。
当前配置的初始值PositionStrategy
具有依赖于外部变量来对齐 Overalys 的逻辑,类似于 CSS 网格/Flexbox 行为。
这个material2 github问题似乎表明只能使用OverlayRef.dispose()
=> OverlayRef.create()
。
有没有满足以下条件的解决方案:
最好能够从服务而不是OverlayRef
组件实例中调用。
为了清楚起见,编辑 1:
鉴于以下内容PositionStrategy
,OverlayRef.updatePosition()
似乎不适用于重新计算 px 的需要。 *笔记 window.innerWidth
private setChannelPosition(): PositionStrategy {
const chatWidth = 280;
const chatSpace = 5;
const distanceFromEdge = 80;
const existingModalCount = this.channelModals.size;
const numModalsCanFit =
Math.floor((window.innerWidth - 2 * distanceFromEdge) / (chatWidth + chatSpace));
const distFromRight =
distanceFromEdge + ((existingModalCount % numModalsCanFit) * (chatWidth + …
Run Code Online (Sandbox Code Playgroud) overlay angular-material angular-material2 angular angular-cdk
asp.net-core ×3
angular ×2
odata ×2
.net-core ×1
angular-cdk ×1
angular-cli ×1
azure ×1
for-json ×1
lighthouse ×1
oauth-2.0 ×1
overlay ×1
restier ×1
sql ×1
t-sql ×1