我正在尝试编写一个 PowerShell 脚本来启动我的开发环境所需的所有服务,并且正在努力寻找一种方法来启动 azure 存储模拟器。我所需要的只是一种启动服务的方法,但我在网上阅读的所有内容都不起作用。
提前致谢。
所以我有一个整天都在工作的azure函数。大约二十分钟前,我在尝试单击 Visual Studio 中的运行按钮时开始出现错误。它成功构建,然后在启动时显示并出错,只是指出“路径中的非法字符 - Visual Studio”。我检查了 git 日志并且没有进行任何更改,所以我真的不确定出了什么问题。
我附上了问题的 gif 来尝试说明问题。

我真的尝试了我能想到的一切。这是我所采取的所有步骤的列表。
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Zupa.Products.ProductsService.Models.Messages.V1;
namespace Zupa.ProductFileUploadFunction
{
public static class FileUploadProcessor
{
private const string FunctionName = nameof(FileUploadProcessor);
[FunctionName(FunctionName)]
public static void Run(
[BlobTrigger("%IncomingContainerPath%/{blobFileName}", Connection = "AzureWebJobsStorage")]Stream inputBlob,
[ServiceBus("%QueueName%", Connection = "QueueServiceBus")]out string outgoingMessage,
string blobFileName, ILogger log)
{
log.LogInformation($"{FunctionName} …Run Code Online (Sandbox Code Playgroud) 因此,我在尝试让 Visual Studio 将用户机密添加到作为数组的属性时遇到了问题。我有一种感觉这种事情无法完成,但我真的需要一种方法来遍历它们中的每一个我正在做的事情,并且出于显而易见的原因,我不允许将 clientSecrets 存储在标准 appsettings 文件中.
有没有办法做到这一点,如果没有,我是否可以更改此对象以使其在 c# 中可迭代,这也允许我将密码存储在用户机密中?
下面的对象显示了我试图将值存储到其中的 appsettings 的当前形状。
{
"TestClients": [
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
},
{
"ClientSecret": ""
}
]
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试将它变成一个 onject 并通过键进行迭代,但是当对象的形状像这样时,我正在使用的控制台应用程序似乎没有找到 TestClients 部分
{
"TestClients": {
"ClientName": {
"ClientSecret": ""
}
}
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激,因为它现在是一个拦截器,提前致谢,克里斯。
我正在尝试想出一种方法,允许在构建管道中轻松选择给定代理,仅用于调试目的。到目前为止,我有以下片段。两者都可以在没有 if 片段的情况下工作,但我试图根据设置的参数或设置的 inturn 变量来执行其中之一,这样如果处于调试模式,它将选择并代理,如果不是,则它只需使用池来选择一个代理来运行构建。但到目前为止还没有运气。
variables:
debugMode: 'false'
parameters:
- name: poolOption
type: string
default: 'ZupaDeploymentPool'
- name: debugMode
type: string
default: 'true'
- name: debugMachine
type: string
default: 'ZUPBUILD03'
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- README.md
${{ if ne($(debugMode), 'false') }}:
pool: ${{ parameters.poolOption }}
${{ if ne($(debugMode), 'true') }}:
pool:
name: ${{ parameters.poolOption }}
demands:
- Agent.Name -equals ${{ parameters.debugMachine }}
Run Code Online (Sandbox Code Playgroud) azure ×2
c# ×2
.net-core ×1
appsettings ×1
deployment ×1
powershell ×1
secret-key ×1
storage ×1
yaml ×1