Azure / azure-functions-servicebus-extension

Service Bus extension for Azure Functions
MIT License
65 stars 35 forks source link

[BUG] Unable to query Trigger connection parameters from Keyvault - Azure functions v2 - Linux docker container #231

Open sudharsan2020 opened 4 months ago

sudharsan2020 commented 4 months ago

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

I am using the Service Bus trigger for my application. To load the Service Bus trigger connection string, currently, we rely on the Docker environment variable, which is dynamically set when the Azure pipeline is triggered

Code

@app.service_bus_topic_trigger(
    arg_name="azservicebus",
    subscription_name="mysubscription",
    topic_name="mysbtopic",
    connection="ServiceBusConnectionString",
)
def servicebus_topic_trigger(azservicebus: func.ServiceBusMessage):
    logging.info(
        "Python ServiceBus Topic trigger processed a message: %s",
        azservicebus.get_body().decode("utf-8"),
    )

The ServiceBusConnectionString is referred as a Docker environment variable in the Dockerfile as below:

FROM mcr.microsoft.com/azure-functions/python:4-python3.11

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureWebJobsFeatureFlags=EnableWorkerIndexing \
    PYTHON_ENABLE_DEBUG_LOGGING=1 \
    FUNCTIONS_WORKER_RUNTIME=python \
    ServiceBusConnectionString=#{MyOrg--ServiceBus--ConnectionString}#

Expected behavior

Provide a description of the expected behavior.

The Service bus trigger connection string should be successfully loaded from Azure Key vault upon function app startup

Actual behavior

Provide a description of the actual behavior observed.

image

Known workarounds

Provide a description of any known workarounds.

Contents of the requirements.txt file:

Provide the requirements.txt file to help us find out module related issues.
annotated-types==0.6.0
asgiref==3.7.2
azure-common==1.1.28
azure-core-tracing-opentelemetry==1.0.0b11
azure-core==1.30.0
azure-functions==1.18.0
azure-identity==1.15.0
azure-keyvault-secrets==4.7.0
azure-monitor-opentelemetry-exporter==1.0.0b22
azure-monitor-opentelemetry==1.2.0
azure-storage-blob==12.19.0
blis==0.7.11
catalogue==1.0.2
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
cryptography==42.0.2
cymem==2.0.8
dateparser==1.2.0
deprecated==1.2.14
fixedint==0.1.6
idna==3.6
importlib-metadata==6.11.0
isodate==0.6.1
joblib==1.3.2
msal-extensions==1.1.0
msal==1.26.0
msrest==0.7.1
murmurhash==1.0.10
numpy==1.26.4
oauthlib==3.2.2
opentelemetry-api==1.22.0
opentelemetry-instrumentation-asgi==0.43b0
opentelemetry-instrumentation-dbapi==0.43b0
opentelemetry-instrumentation-django==0.43b0
opentelemetry-instrumentation-fastapi==0.43b0
opentelemetry-instrumentation-flask==0.43b0
opentelemetry-instrumentation-psycopg2==0.43b0
opentelemetry-instrumentation-requests==0.43b0
opentelemetry-instrumentation-urllib3==0.43b0
opentelemetry-instrumentation-urllib==0.43b0
opentelemetry-instrumentation-wsgi==0.43b0
opentelemetry-instrumentation==0.43b0
opentelemetry-resource-detector-azure==0.1.3
opentelemetry-sdk==1.22.0
opentelemetry-semantic-conventions==0.43b0
opentelemetry-util-http==0.43b0
orjson==3.9.10
packaging==23.2
pandas==2.2.0
pillow==10.2.0
plac==1.1.3
portalocker==2.8.2
preshed==3.0.9
pycparser==2.21
pydantic-core==2.16.2
pydantic==2.6.1
pyhumps==3.8.0
pyjwt==2.8.0
python-dateutil==2.8.2
python-dotenv==1.0.0
pytz==2024.1
pyyaml==6.0.1
rapidfuzz==3.6.1
regex==2023.12.25
requests-oauthlib==1.3.1
requests==2.31.0
scikit-learn==1.4.0
scipy==1.12.0
six==1.16.0
spacy==2.3.9
srsly==1.0.7
thinc==7.4.6
threadpoolctl==3.2.0
tqdm==4.66.1
typing-extensions==4.9.0
tzdata==2023.4
tzlocal==5.2
urllib3==2.2.0
wasabi==0.10.1
wrapt==1.16.0
zipp==3.17.0

Related information

Provide any related information
bhagyshricompany commented 4 months ago

Thanks for reporting please share function name, timestamp, app name ,region etc.