Strange - I got exactly the same error, but for me, specifying "AZURE_TENANT_ID" or the connection-specific "<CONNECTION_NAME_PREFIX>__tenantId" in local.settings.json
worked:
{
"IsEncrypted": false,
"Values": {
"<CONNECTION_NAME_PREFIX>__fullyQualifiedNamespace": "<NAMESPACE>.servicebus.windows.net",
"<CONNECTION_NAME_PREFIX>__tenantId": "<tenantId>" // This line fixed the error for me
}
}
Using connection-specific settings as opposed to "AZURE_*" is described here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference?tabs=blob&pivots=programming-language-csharp#azure-sdk-environment-variables