Using Azure remote-storage on rasa container always fails to connect

I’m using latest version of rsa container using the following Dockerfile:


#FROM rasa/rasa:3.4.4-full FROM rasa/rasa:latest #ENTRYPOINT [“python3”]

ARG AZURE_CONTAINER ENV AZURE_CONTAINER $AZURE_CONTAINER ARG AZURE_ACCOUNT_NAME ENV AZURE_ACCOUNT_NAME $AZURE_ACCOUNT_NAME ARG AZURE_ACCOUNT_KEY ENV AZURE_ACCOUNT_KEY $AZURE_ACCOUNT_KEY

ENV PATH “$PATH:/app/.local/bin”

RUN /usr/bin/python3 -m pip install azure-storage-blob azure-identity RUN /usr/bin/python3 -m pip install pandas RUN /usr/bin/python3 -m pip install jieba RUN /usr/bin/python3 -m pip install python-git RUN /usr/bin/python3 -m pip install pyinstaller RUN /usr/bin/python3 -m pip install --upgrade pip

RUN alias python=“/usr/bin/python3” RUN alias python3=“/usr/bin/python3”

USER 1001 EXPOSE 80

CMD [ “run”, “–enable-api”, “–port”, “80”, “–model”, “models/20230801-152417-adiabatic-altitude.tar.gz”, “–remote-storage”, “azure”, “–cors”, “*”, “–debug”]

I’m filling the authentication variables during docker run.

docker build --no-cache --tag test_rasa --build-arg AZURE_CONTAINER=‘xxx’ --build-arg AZURE_ACCOUNT_NAME=‘xxx’ --build-arg AZURE_ACCOUNT_KEY=‘xxxxx’ -f Dockerfile . -t testentrypoint

Docker container have the right values on env varibles but is like python can’t load the installed azure plugins imported.

I have a python script using: from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient

Using this script from rasa container I’m able to list the container with the trained models.

Best regards,

Ricardo

I Forgot to share the error:

2023-08-07 16:15:43 DEBUG urllib3.connectionpool - Starting new HTTPS connection (1): api.segment.io:443 2023-08-07 16:15:44 DEBUG urllib3.connectionpool - https://api.segment.io:443 “POST /v1/track HTTP/1.1” 200 21 2023-08-07 16:15:44 DEBUG rasa.core.tracker_store - Connected to InMemoryTrackerStore. 2023-08-07 16:15:44 DEBUG rasa.core.lock_store - Connected to lock store ‘InMemoryLockStore’. 2023-08-07 16:15:44 DEBUG rasa.core.nlg.generator - Instantiated NLG to ‘TemplatedNaturalLanguageGenerator’. 2023-08-07 16:15:44 ERROR rasa.core.agent - Could not load model due to No module named ‘azure’. Traceback (most recent call last): File “/opt/venv/lib/python3.10/site-packages/rasa/core/agent.py”, line 250, in load_agent agent.load_model_from_remote_storage(model_path) File “/opt/venv/lib/python3.10/site-packages/rasa/core/agent.py”, line 541, in load_model_from_remote_storage persistor = get_persistor(self.remote_storage) File “/opt/venv/lib/python3.10/site-packages/rasa/nlu/persistor.py”, line 30, in get_persistor return AzurePersistor( File “/opt/venv/lib/python3.10/site-packages/rasa/nlu/persistor.py”, line 205, in init from azure.storage.blob import BlobServiceClient ModuleNotFoundError: No module named ‘azure’