Azure WebJobs SDK ServiceBus connection string 'AzureWebJobsAzureSBConnection' is missing or empty

后端 未结 2 1098
无人共我
无人共我 2021-02-15 14:27

I created an Azure Function App in Visual Studio 2015. The App has a trigger for service bus queues. The app works perfectly when I run it locally. It is able to read the data f

2条回答
  •  深忆病人
    2021-02-15 14:57

    Only environment variables are supported for app settings and connection strings.

    You need to make sure that the environment variable AzureWebJobsAzureSBConnection is set on your Function's app settings in the portal:

    and then once there, you need to add the AzureWebJobsAzureSBConnection variable with the proper connection string:

    and then you can access this via code by:

    Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process);
    

    This will obtain the value from either the appsettings.json or the environment variable depending on where the function is being executed from, (local debugging or deployed on Azure)

提交回复
热议问题