Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从Azure DevOps管道创建Azure服务队列?_Azure_Azure Devops_Azure Pipelines_Azure Pipelines Build Task - Fatal编程技术网

如何从Azure DevOps管道创建Azure服务队列?

如何从Azure DevOps管道创建Azure服务队列?,azure,azure-devops,azure-pipelines,azure-pipelines-build-task,Azure,Azure Devops,Azure Pipelines,Azure Pipelines Build Task,我创建了一个Azure函数,该函数由Azure服务总线队列触发。我还通过Azure管道部署了这些功能 我的问题是: 我可以在Azure Portal中手动创建队列。但是如何在构建和发布管道期间创建Azure服务总线队列 我可以为Azure功能手动添加应用程序配置(服务总线连接字符串)。但是我如何在构建和发布过程中添加它呢 Azure管道任务: 发布管道中有许多任务可用于创建Azure服务总线队列: Azure CLI 动力壳 ARM模板部署 地形 Azure CLI或PowerShell可以

我创建了一个Azure函数,该函数由Azure服务总线队列触发。我还通过Azure管道部署了这些功能

我的问题是:

  • 我可以在Azure Portal中手动创建队列。但是如何在构建和发布管道期间创建Azure服务总线队列
  • 我可以为Azure功能手动添加应用程序配置(服务总线连接字符串)。但是我如何在构建和发布过程中添加它呢
  • Azure管道任务:


    发布管道中有许多任务可用于创建Azure服务总线队列:

    • Azure CLI
    • 动力壳
    • ARM模板部署
    • 地形
    Azure CLI或PowerShell可以解决您的问题,您只需在脚本中授权,并使用您喜欢使用的任何命令-创建Azure Service Bus并将配置设置为Azure功能

    CLI中有一个示例:

  • 创建Azure服务总线队列(从)

  • 将设置设置为Azure功能(从)

    az functionapp config appsettings set--name\
    --资源组\
    --设置自定义功能应用设置=12345
    

  • 发布管道中有许多任务可用于创建Azure Service Bus队列:

    • Azure CLI
    • 动力壳
    • ARM模板部署
    • 地形
    Azure CLI或PowerShell可以解决您的问题,您只需在脚本中授权,并使用您喜欢使用的任何命令-创建Azure Service Bus并将配置设置为Azure功能

    CLI中有一个示例:

  • 创建Azure服务总线队列(从)

  • 将设置设置为Azure功能(从)

    az functionapp config appsettings set--name\
    --资源组\
    --设置自定义功能应用设置=12345
    

  • 我添加了Azure CLI任务并添加了上述PowerShell脚本。我添加了一个Azure CLI任务并添加了上面的PowerShell脚本。成功了。
    # Create a resource group
    resourceGroupName="myResourceGroup"
    
    az group create --name $resourceGroupName --location eastus
    
    # Create a Service Bus messaging namespace with a unique name
    namespaceName=myNameSpace$RANDOM
    az servicebus namespace create --resource-group $resourceGroupName --name $namespaceName --location eastus
    
    # Create a Service Bus queue
    az servicebus queue create --resource-group $resourceGroupName --namespace-name $namespaceName --name BasicQueue
    
    # Get the connection string for the namespace
    connectionString=$(az servicebus namespace authorization-rule keys list --resource-group $resourceGroupName --namespace-name $namespaceName --name RootManageSharedAccessKey --query primaryConnectionString --output tsv)
    
    az functionapp config appsettings set --name <FUNCTION_APP_NAME> \
    --resource-group <RESOURCE_GROUP_NAME> \
    --settings CUSTOM_FUNCTION_APP_SETTING=12345