我有一个引用第三方程序集的Web应用程序项目,该程序集又使用它在运行时需要查找的一些本机dll.因此,我想将这些dll添加到项目的bin文件夹中,以便绝对可以找到它们.
但是,如果我将文件添加到/ bin /中的项目,选择"复制到输出",文件将被编译并发布到/ bin/bin中.将它们添加到根文件夹是有效的,但几乎不是正确的解决方案.
将它们添加到构建目标"AfterBuild"在发布时无效(例如"构建部署包")
它还必须在通过TFS构建解决方案时工作,其中调用MSBuild目标_CopyWebApplicationLegacy.
如何获取对函数启动类中的ExecutionContext.FunctionAppDirectory的访问权限,以便我可以正确设置我的Configuration。请查看以下启动代码:
[assembly: WebJobsStartup(typeof(FuncStartup))]
namespace Function.Test
{
public class FuncStartup : IWebJobsStartup
{
public void Configure(IWebJobsBuilder builder)
{
var config = new ConfigurationBuilder()
.SetBasePath(“”/* How to get the Context here. I cann’t DI it
as it requires default constructor*/)
.AddJsonFile(“local.settings.json”, true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
}
}
}
Run Code Online (Sandbox Code Playgroud) azure azure-functions azure-functions-runtime azure-functions-core-tools
我们确实不得不从 Linq-Queries 转移到我们的 DocumentDB/CosmosDB。
原因主要是两个用例:
像这样连接(示例有点奇怪)。
SqlQuerySpec spec = new SqlQuerySpec(@"
SELECT value(n)
FROM books b
join p in b.author.parents
where b.isbn = @isbnId
AND lower(p.address.street) = @parentStreet
");
Run Code Online (Sandbox Code Playgroud)所以我们的查询看起来像这样:
IQueryable<Book> queryable = client.CreateDocumentQuery<Book>(
collectionSelfLink,
new SqlQuerySpec
{
QueryText = "SELECT * FROM books b WHERE (b.Author.Name = @name)",
Parameters = new SqlParameterCollection()
{
new SqlParameter("@name", "Herman Melville")
}
});
Run Code Online (Sandbox Code Playgroud)
但是,随着我们的需求变得越来越复杂,我们需要根据给定的参数使查询看起来不同。我们还有“in”查询,需要我们添加多个参数。
所以现在我们的代码看起来像这样......
var sqlParameterCollection = new SqlParameterCollection();
for (int i = 0; i …Run Code Online (Sandbox Code Playgroud) 我想创建一个 Powershell 脚本,该脚本执行一些AzureRm...命令并使用一些Az命令跟进这些命令。原因是某些命令只能通过Az.
尝试在发布管道中执行这些脚本时,脚本总是失败并显示以下错误:
ERROR: Please run 'az login' to setup account.
Run Code Online (Sandbox Code Playgroud)
执行任务中的Az命令Azure CLI按预期工作,因为Az Login由任务执行。
如果可能的话,我不想传递登录脚本所需的秘密。我宁愿退回到将脚本分成管道中的两个步骤。
是否可以Az在Azure Powershell不手动传递机密的情况下在任务中使用命令?
Azure PowerShellaz account showazure-powershell azure-cli azure-devops azure-pipelines azure-pipelines-release-pipeline
由于 .NET 5.0,我将我的构建切换为独立的。我知道有一个预览运行时,但我不想在我的生产环境中押注于此。我遇到过预览运行时无意中切换回来的情况(例如横向扩展)。
dotnet publish --configuration release --self-contained true --runtime win-x64
Run Code Online (Sandbox Code Playgroud)
完成独立构建后,我的网络作业不再启动。在查看日志时,我刚刚发现了这一点:
[12/22/2020 16:36:05 > 62427f: SYS INFO] Detected WebJob file/s were updated, refreshing WebJob
[12/22/2020 16:36:05 > 62427f: SYS INFO] Status changed to Starting
[12/22/2020 16:36:05 > 62427f: SYS INFO] WebJob singleton setting is False
[12/22/2020 16:36:07 > 62427f: SYS INFO] Run script 'createdump.exe' with script host - 'WindowsScriptHost'
[12/22/2020 16:36:07 > 62427f: SYS INFO] Status changed to Running
[12/22/2020 16:36:35 > 62427f: ERR ] createdump [options] pid
[12/22/2020 …Run Code Online (Sandbox Code Playgroud) 我最近发现了该az rest命令,它允许我执行经过身份验证的 REST 命令,而不必担心获取令牌。
https://www.codeisahighway.com/native-azure-rest-api-calls-now-available-in-azure-cli-2-0-67/
az rest --method patch --url "https://graph.microsoft.com/v1.0/users/johndoe@azuresdkteam.onmicrosoft.com" --body "{\"displayName\": \"jondoe2\"}"
Run Code Online (Sandbox Code Playgroud)
Azure Powershell 中是否有等效项?我需要进行一个无法通过任何AzAd...cmdlet 进行的调用。我会想象类似的东西Invoke-AzRestMethod,但这并不存在。
编辑:我想执行无法通过 Azure AD Cmdlet 执行的调用(目前)。例如直接使用新类型的replyUrls,或上传AAD B2C(测试版API)的自定义策略。
为什么在提供运行时标识符时我的构建/恢复失败win-x64?为什么它有效,而我却不起作用?我在尝试独立构建时偶然发现了这一点。
换句话说:为什么dotnet restore --runtime win-x64和dotnet restore具有不同的依赖图?
当我用作netcoreapp2.1目标框架时它可以工作,但它会因netcoreapp3.1or 而中断net5.0。当我删除任何一个直接依赖项时它也有效。
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.23" />
<PackageReference Include="Serilog.Sinks.RollingFileAlternate" Version="2.0.9" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
> dotnet restore
Determining projects to restore...
Restored ...\ConsoleApp1\ConsoleApp1.csproj (in 289 ms).
> dotnet restore --runtime win-x64
Determining projects to restore...
...\ConsoleApp1\ConsoleApp1.csproj : error NU1605: Detected package downgrade: System.Runtime.InteropServices from 4.3.0 to 4.1.0. Reference the package directly from the project to select a …Run Code Online (Sandbox Code Playgroud) 我有一个tiff文件和文本,它在早期阶段已被OCR.单词的确切位置为信息(左上角,右下角).我现在需要在用户绘制的矩形中阅读文本.
正常的段落没有问题,但我不知道我应该如何处理文本列.如果彼此相邻有两个段落,只需将该行作为单行将使结果无法使用.
是否有算法可以帮助我按正确的顺序排列单词?我猜我必须检查单词之间的空格来检测识别列的模式.我想避免直接处理图像,尽管应该可以(但没有OCR).
我也不确定列表/表格的影响,例如订单和账单.在这里,以线为导向的方法可能会更好.
我正在开发Delphi,但也可以欣赏其他语言的自适应算法.
编辑:我明天会尝试发布样本数据,但基本上我有一个单词数组,在图像上有各自的坐标(例如,我可以轻松地在它们周围画一个矩形).
我必须具有以下文件夹结构:
main
- server
-- server-module-1
--- a
--- b
--- c
-- server-module-2
--- d
--- e
--- f
- client
-- modules
--- client-module-1
--- client-module-2
--- client-module-3
- war-module
Run Code Online (Sandbox Code Playgroud)
Maven 结构类似——主要的 pom.xml:
<modules>
<module>server</module>
<module>client</module>
<module>war-module</module>
</modules>
Run Code Online (Sandbox Code Playgroud)
如果我将一个模块移动到一个单独的配置文件,问题就开始了,因为我并不总是需要 war-module(在 Jenkins 上)。
<modules>
<module>server</module>
<module>client</module>
</modules>
<profiles>
<profile>
<id>createModule</id>
<modules>
<module>war-module</module>
</modules>
</profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)
在此更改后,我的 IntelliJ 我的项目结构如下所示:
main and modules
- client and modules
-- client-modules and modules
--- client-module-1
--- client-module-2
--- client-module-3
--- modules
---- client-module-1 …Run Code Online (Sandbox Code Playgroud) 考虑以下代码。它创建一个应用程序洞察,然后它检索检测密钥并将其分配给我的 web 应用程序。
az monitor app-insights component create -g $resourceGroup --app $webapp --application-type web --kind web --tags $defaultTags
$instrumentationKey = az monitor app-insights component show -g $resourceGroup -a $webapp --query 'instrumentationKey' -o tsv
az webapp config appsettings set -g $resourceGroup -n $webapp --settings APPINSIGHTS_INSTRUMENTATIONKEY=$instrumentationKey APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=$instrumentationKey
Run Code Online (Sandbox Code Playgroud)
但是,这不会打开此屏幕截图中所示的 web 应用程序的应用程序洞察力。我不知道如何从 azure cli 打开它。