【问题标题】:Is it possible to create a connection string for an Azure function programmatically?是否可以以编程方式为 Azure 函数创建连接字符串?
【发布时间】:2020-12-04 01:29:30
【问题描述】:

我想知道是否有人知道如何使用 Powershell 脚本将连接字符串添加到 Azure 函数?也许类似这样:

az functionapp config appsettings set --name FunctionName --resource-group MyResourceGroup --settings "ConnectionStrings=connection_value_here"

此命令确实会创建应用程序设置。我找不到类似的连接。

TIA

【问题讨论】:

    标签: azure powershell connection azure-functions command-line-interface


    【解决方案1】:

    其实我找到了一个更简单的解决方案:

    az webapp config connection-string set -g "$ResourceGroup" -n "$FunctionAppName" -t custom --settings SchedulerServiceBusConnection="$FunctionConnectionString"

    只需要替换引号中的值。

    【讨论】:

    • em,您在问题中要求powershell script,但在您的答案中是azure cli。你最好写一个明确的问题:)。
    猜你喜欢
    • 2011-12-21
    • 2011-02-27
    • 1970-01-01
    • 2021-08-29
    • 2011-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多