Azure 核心工具 - 如何在获取连接字符串时指定不同的键名

Azure core tools - how to specify a different key name when fetching connection string

有没有办法告诉工具在获取连接字符串时我想更新 local.settings.json 文件中的哪个字段名称?所以具体来说,当我 运行 这个命令时:

func azure storage fetch-connection-string $STORAGE_ACCOUNT_NAME

默认情况下,它获取我的存储帐户 (mystorage123) 的名称并向其附加“_STORAGE”。所以你最终得到这样的结果:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "mystorage123_STORAGE": "DefaultEndpointsProtocol=https;AccountName=mystorage123;AccountKey=<key>"
  },
  "ConnectionStrings": {}
}

我只想创建一个 json 与实际帐户名称匹配的字段/键 - 在本例中为“mystorage123”。 有没有办法做到这一点? 我知道我可以编写 powershell 代码来手动更新我的 json 文件。但如果我能告诉命令如何调用该字段会更好。

谢谢。

I would like it just to create a json field / key that just matches the actual account name - in this case "mystorage123". Is there a way to do this? I know I can write powershell code to update my json file manually. But it'd be better if I can just tell the command what to call the field.

我认为没有这种方法。这个连接串原来是拼接的