/literalai-azure

This sample allows to deploy the LiteralAI platform on azure in a few minutes. Literal AI is an observability and evaluation platform for Generative AI applications.

Primary LanguageBicepMIT LicenseMIT

name description languages products page_type urlFragment
LiteralAI on Azure
Deploy LiteralAI to Azure Container Apps using the Azure Developer CLI.
bicep
azdeveloper
azure-database-postgresql
azure-container-apps
azure
sample
literalai-azure

LiteralAI on Azure

Use the Azure Developer CLI to deploy LiteralAI to Azure Container Apps with PostgreSQL Flexible server.

Setup

  1. Install the required tools:

  2. Create a new folder and switch to it in the terminal.

  3. Run this command to download the project code:

    azd init -t literalai-azure

    Note that this command will initialize a git repository, so you do not need to clone this repository.

  4. Create a Python virtual environment and install the required packages:

    pip install -r requirements.txt
  5. Open a terminal window inside the project folder.

Deploying to Azure

Follow these steps to deploy LiteralAI to Azure:

  1. Login to your Azure account:

    azd auth login
  2. Create a new azd environment:

    azd env new

    Enter a name that will be used for the resource group. This will create a new folder in the .azure folder, and set it as the active environment for any calls to azd going forward.

  3. (Optional) By default, the deployed Azure Container App will use the credentials authentication system, meaning anyone with routable network access to the web app can attempt to login to it. To enable Entra-based authentication, set the AZURE_USE_AUTHENTICATION environment variable to true:

    azd env set AZURE_USE_AUTHENTICATION true

    Then set the AZURE_AD_TENANT_ID environment variable to your tenant ID:

    azd env set AZURE_AD_TENANT_ID your-tenant-id
  4. Run this command to provision all the resources (you will be prompted for your LiteralAI docker PAT):

    azd provision

    This will create a new resource group, and create:

    • An Azure Container App (based on the latest LiteralAI docker image available)
    • A PostgreSQL Flexible server
    • A Redis cache inside that group
    • A storage account as well as a storage container

    If you enabled authentication, it will set up the necessary resources for Entra-based authentication, and pass the necessary environment variables to the Azure Container App.

Once the deployment is complete, you will see the URL for the Azure Container App in the output. You can open this URL in your browser to see the LiteralAI platform.

Update LiteralAI

Re running the azd provision command will update the LiteralAI deployment to the latest image.

Reverting to a specific version

To revert to a specific version, set the LITERAL_DOCKER_IMAGE_VERSION env variable. For instance if you want to revert to the version 0.0.602-beta run:

azd env set LITERAL_DOCKER_IMAGE_VERSION 0.0.602-beta
azd provision

Disclaimer

LiteralAI is an external project and is not affiliated with Microsoft.