{"id":23946,"library":"langchain-azure-dynamic-sessions","title":"LangChain Azure Dynamic Sessions","description":"An integration package connecting Azure Container Apps dynamic sessions with LangChain. It provides tools to execute code snippets (Python, bash) in isolated, ephemeral sessions within Azure Container Apps. Current version 1.0.2, released on 2025-01-14, with periodic patch updates. Requires Python >=3.10, <4.0.","status":"active","version":"1.0.2","language":"python","source_language":"en","source_url":"https://github.com/langchain-ai/langchain-azure","tags":["langchain","azure","dynamic-sessions","container-apps","tool"],"install":[{"cmd":"pip install langchain-azure-dynamic-sessions","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core LangChain abstractions for tools, chains, etc.","package":"langchain-core","optional":false}],"imports":[{"note":"The tool is in the 'tool' submodule; direct import fails with ImportError.","wrong":"from langchain_azure_dynamic_sessions import AzureDynamicSessionsTool","symbol":"AzureDynamicSessionsTool","correct":"from langchain_azure_dynamic_sessions.tool import AzureDynamicSessionsTool"},{"note":"Similar to above; must import from 'tool' submodule.","wrong":"from langchain_azure_dynamic_sessions import SessionsPythonTool","symbol":"SessionsPythonTool","correct":"from langchain_azure_dynamic_sessions.tool import SessionsPythonTool"}],"quickstart":{"code":"import os\nfrom langchain_azure_dynamic_sessions.tool import AzureDynamicSessionsTool\n\npool_endpoint = os.environ.get(\"AZURE_CONTAINER_SESSION_POOL_ENDPOINT\", \"https://<your-pool>.region.azurecontainerapps.io\")\ntool = AzureDynamicSessionsTool(pool_endpoint=pool_endpoint)\nresult = tool.run(\"print('Hello from dynamic sessions!')\")\nprint(result)","lang":"python","description":"Initialize the tool with your pool endpoint (set the environment variable or replace the placeholder) and execute a Python snippet."},"warnings":[{"fix":"Upgrade to Python 3.10+ or use a compatible environment.","message":"The library requires Python >=3.10. Attempting to install on older versions will fail due to requires_python constraints.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Always use the full endpoint URL: https://<pool-name>.<region>.azurecontainerapps.io","message":"The pool_endpoint must be a full URL (including https://). Earlier beta versions allowed just the pool name.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Set AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, or use Azure CLI login.","message":"Authentication is handled via Azure Identity (DefaultAzureCredential). If you have multiple credentials, ensure the correct one is used (e.g., via environment variables).","severity":"gotcha","affected_versions":"*"},{"fix":"Replace SessionsPythonTool with AzureDynamicSessionsTool.","message":"The SessionsPythonTool is deprecated in favor of AzureDynamicSessionsTool. New projects should use AzureDynamicSessionsTool.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from langchain_azure_dynamic_sessions.tool import AzureDynamicSessionsTool","cause":"Wrong import path – the tool is in the 'tool' submodule.","error":"ImportError: cannot import name 'AzureDynamicSessionsTool' from 'langchain_azure_dynamic_sessions'"},{"fix":"Set AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET or run 'az login'.","cause":"No Azure credentials available; missing environment variables or Azure CLI login.","error":"azure.core.exceptions.ClientAuthenticationError: DefaultAzureCredential failed to retrieve a token"},{"fix":"Use format: https://<pool-name>.<region>.azurecontainerapps.io","cause":"Pool endpoint provided without https:// prefix or missing region.","error":"ValueError: Invalid pool endpoint. Expected a full URL."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}