当我尝试通过PowerShell在Windows 10上启动ssh-agent(右侧或不右侧),输入Start-Service ssh-agent我得到错误
无法启动ssh-agent服务,错误:1058
当我检查服务正在运行时,Get-Service ssh-agent返回该服务已停止.
如何让ssh-agent运行?
建立:
目标:
我怎样才能做到这一点?
我有 ISIN、股票代码(没有后缀,例如三星005930而不是005930.KS)和国家/地区名称。当我访问雅虎财经网站时,我可以使用 ISIN 进行搜索并获得我正在寻找的股票。
当我尝试通过调用 API 端点以编程方式执行此操作时,https://query2.finance.yahoo.com/v10/finance/quoteSummary/{ TickerSymbol }?modules=financialData它并不总是有效,因为在某些情况下缺少后缀。而且我还没有找到用 ISIN 查询的方法。
那么如何使用 Yahoo Finance API 分别使用 ISIN、股票代码(无后缀)和国家名称查找股票?
谢谢
我有一个具有多种功能的函数应用程序(v2、.NET Core)。此 Functions 应用程序部署到不同的环境(= 不同的订阅)。出于开发目的,我大量利用 (ILogger) 日志,但在部署到开发环境以外的其他环境时,我想关闭日志记录。Function 应用程序是通过 Azure DevOps 管道部署的。
您推荐哪种方法来实现这一点(在代码中,通过 appsettings,通过 host.json ......)?
谢谢
作为流分析部署解决方案的一部分,我想通过例如 listkeys() 函数在 ARM 模板中检索 Azure Function App 的 API 密钥。有没有办法在 ARM 部署期间分别通过 ARM 模板检索此密钥,如果是,如何?
谢谢
deployment azure azure-resource-manager azure-stream-analytics azure-functions
我遇到的问题是,基于某些输入生成的 ID 包含字符“/”。这会导致更新插入操作期间出现错误,因为文档 ID 中不允许使用“/”。
除此之外还有哪些字符是不允许的?遇到这样的情况有什么方法可以处理呢?
我使用 IHttpClientFactory 创建 HTTP 客户端并附加 Polly 策略(需要 Microsoft.Extensions.Http.Polly),如下所示:
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
IHost host = new HostBuilder()
.ConfigureServices((hostingContext, services) =>
{
services.AddHttpClient("TestClient", client =>
{
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
})
.AddPolicyHandler(PollyPolicies.HttpResponsePolicies(
arg1,
arg2,
arg3));
})
.Build();
IHttpClientFactory httpClientFactory = host.Services.GetRequiredService<IHttpClientFactory>();
HttpClient httpClient = httpClientFactory.CreateClient("TestClient");
Run Code Online (Sandbox Code Playgroud)
我如何使用 Moq 来模拟这个 HTTP 客户端?
编辑:Mock 意味着能够模拟 HTTP 的请求。应按照定义应用该政策。
出于部署目的,我创建了一个 PowerShell 脚本来设置应用程序设置。这通过
$currentAppSettings = $app.SiteConfig.AppSettings
$appSettings = @{}
# Add existing App Settings
ForEach ($currentAppSetting in $currentAppSettings) {
$appSettings[$currentAppSetting.Name] = $currentAppSetting.Value
}
# Add new App Settings
$appSettings["someKey"] = "someValue"
# Update App Settings
Set-AzWebApp -ResourceGroupName $resourceGroupName -Name $appName -AppSettings $appSettings
Run Code Online (Sandbox Code Playgroud)
当我现在使用实体框架时,我还需要设置连接字符串。首先我认为这应该像应用程序设置一样工作,只需添加 ConnectionStrings 参数:
$currentConnectionStrings = $app.SiteConfig.ConnectionStrings
$connectionStrings = @{}
ForEach ($currentConnectionString in $currentConnectionStrings) {
$connectionStrings[$currentConnectionString.Name] = $currentConnectionString.ConnectionString
}
$connectionStrings["someKey"] = "someValue"
Set-AzWebApp -ResourceGroupName $resourceGroupName -Name $appName -ConnectionStrings $connectionStrings
Run Code Online (Sandbox Code Playgroud)
但这失败并出现错误
Set-AzWebApp:无法验证参数“ConnectionStrings”上的参数。连接字符串类型值对必须是“System.Collections.Hashtable”类型
尽管事实上它$connectionStrings是类型System.Collections.Hashtable
尝试使用自定义对象、数组等也失败了。
如何正确传递连接字符串? 以及如何指定类型(例如 SQLAZURE)? …
powershell entity-framework connection-string azure-functions
到目前为止,我使用 Azure PowerShell 任务在 Azure 上下文 ( https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-powershell?view=vsts ) 中执行 PowerShell 脚本。由于泛化工作,我现在想创建一个运行 PowerShell 脚本的自定义任务(参见例如http://www.donovanbrown.com/post/how-do-i-upload-a-custom-task-for-build)在 Azure 上下文中,即针对 Azure DevOps 中的连接端点进行身份验证。
我怎样才能做到这一点?
azure ×3
deployment ×2
powershell ×2
windows-10 ×2
.net-core ×1
azure-devops ×1
c# ×1
httpclient ×1
hyper-v ×1
identifier ×1
logging ×1
moq ×1
openssh ×1
polly ×1
service ×1
share ×1
ssh ×1
yfinance ×1