我有一个Azure Logic应用程序,当在SFTP服务器中添加或修改新文件时会触发该应用程序.发生这种情况时,文件将复制到Azure Blob存储,然后从SFTP服务器中删除.此操作每个文件大约需要2秒.
我唯一的问题是这些文件(平均500kb)是逐个处理的.鉴于我希望每天传输大约30,000个文件,这种方法变得非常慢(约18小时左右).
有没有办法扩展/并行化这些执行?
我正在使用 Azure 数据同步来同步两个还包含 ASP.NET 标识表的数据库。
直到几天前我在 Hub 数据库中插入了大约 1500 个用户之前,一切都运行良好。从那时起,我收到以下错误:
Sync failed with the exception "GetStatus failed with exception:Sync worker failed, checked by GetStatus method.
Failure details:Sync was aborted because more than 1000 changes failed to apply.
Examine your table schemas to look for conflicting constraints or incompatible data types that may prevent sync from succeeding.
Upload - errors for first 5 rows that failed to apply:
Error #1: SqlException Error Code: -2146232060 - SqlError Number:547, Message: The INSERT statement …Run Code Online (Sandbox Code Playgroud) 上下文
我正在创建一个Web应用程序,其功能之一是允许通过UI进行数据库查询.为了持久,它使用nHibernate ORM.下面是处理传入SQL查询的存储库方法:
public IList ExecuteSqlQuery(string sqlQuery)
{
var query = Session.CreateSQLQuery(sqlQuery);
var queryResult = query.SetResultTransformer(Transformers.AliasToEntityMap).List();
return queryResult;
}
Run Code Online (Sandbox Code Playgroud)
问题
上面的方法将返回一个字典列表,每个字典都包含具有Key = ColumnName和Value = ColumnValue的DictionaryEntry对象.
除了列名与原始SQL查询中指定的顺序不同之外,这一切都很好.例如,以下SQL查询:
select FirstName, LastName, c.Name
from SoftwareDeveloper sf
join Certification c on sf.SoftwareDeveloperId = c.SoftwareDeveloperId
Run Code Online (Sandbox Code Playgroud)
,每行的返回类似于:
["FirstName"] = "John"
["Name"] = "70-515 MCTS, .NET Framework 4, Web Applications"
["LastName"] = "Doe"
Run Code Online (Sandbox Code Playgroud)
请注意,不保留列的顺序.它应该是:
["FirstName"] = "John"
["LastName"] = "Doe"
["Name"] = "70-515 MCTS, .NET Framework 4, Web Applications"
Run Code Online (Sandbox Code Playgroud)
更新 在上面的示例中,字典的键按名称排序,但这仅适用于此示例,故意保持简单.对于较大的查询,不对键(=列)进行排序.
在这个上下文中的 …
我目前正在使用ADF按计划将文件从SFTP服务器复制到Blob存储.
文件名结构为AAAAAA_BBBBBB_CCCCCC.txt.
是否可以在复制到Blob存储之前重命名该文件,以便最终得到类似文件夹的结构,如下所示?
AAAAAA/BBBBBB/CCCCCC.txt
我正在将 Web 表单应用程序从表单身份验证迁移到 OpenID Connect(使用 OWIN 和 IdentityServer3)。该应用程序在 web.config 中已经有很多“授权”元素(针对不同位置),我想在迁移到 OWIN 后重用这些元素。
<authorization>
<deny users="?" />
</authorization>
<location path="Path/Page.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
...
Run Code Online (Sandbox Code Playgroud)
问题是,在我切换到 OWIN 而不是被重定向到登录页面后,我得到了 401(未经授权)。
目前,将用户重定向到登录页面的唯一方法是在 Page_Load 事件中手动进行质询:
if (!Request.IsAuthenticated)
{
HttpContext.Current.GetOwinContext().Authentication.Challenge();
}
Run Code Online (Sandbox Code Playgroud)
这是我的 Startup.Auth 的样子:
public void ConfigureAuth(IAppBuilder app)
{
//reset the mapping dictionary to ensure the claims are not mapped to .NET standard claims
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "ApplicationCookie",
AuthenticationMode = AuthenticationMode.Active
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions …Run Code Online (Sandbox Code Playgroud)