Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (13.1k points)
I have created Function in Azure which is going to triggered by Azure Service Bus Queue. Can I able to create a Azure Service Bus Queue during the build of a pipeline?

1 Answer

0 votes
by (26.7k points)

You can able to create Azure Service Bus Queue using Azure CLI, PowerShell, Terraform. But, you can use Azure CLI and PowerShell. Try the below command it is based on Azure CLI:

# 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)

Once done, set the settings for Azure functions :

az functionapp config appsettings set --name <FUNCTION_APP_NAME> \

--resource-group <RESOURCE_GROUP_NAME> \

--settings CUSTOM_FUNCTION_APP_SETTING=12345

I hope this will help.

Want to become an Azure expert? join azure architect certification now!!

Related questions

Browse Categories

...