# 2024.44 - Infrastructure & Configuration Release Notes

## Fixed

### Bug in `node-chat` where Upload and Chat with Document Intelligence was not working correctly

#### `[terraform]` Provision an identity

```hcl
module "workload_identities" {
  …
  identities = {
    …
    node-ingestion-worker-chat = {
      keyvault_id = module.chat.keyvault_id
      namespace   = "chat"
      roles       = ["Cognitive Services User" /* Document Intelligence */]
    }
  }
}
```

#### `[terraform]` Extend matching deployments of the FormRecognizer

```hcl
module "document-ingelligence-…" {
  source           = "<src>/az-document-intelligence"
  …
  user_assigned_identity_ids = [\
    …\\
    module.workload_identities.user_assigned_identity_ids["node-ingestion-worker-chat"]\
  ]
}
```

#### `[helm]` Service Account must be added (needs matching Infrastructure change, see below)

```yaml
# node-ingestion-worker-chat.values.yaml
serviceAccount:
  enabled: true
  workloadIdentity:
    clientId: <clientId>
    enabled: true
```

Failing to set namespace and the matching key correctly (matches the service account name) will result in a broken deployment (logged error: `CredentialUnavailableError`).

### Run data migrations for assistants at service startup

#### `[helm]` hooks.migration.command must be edited to include assistant migrations

```yaml
# node-chat.values.yaml
hooks:
  migration:
    command: |
      cd /node/dist/apps/node-chat; npx prisma migrate deploy; cd /node; RUNNING_MODE=DATA_MIGRATION  node /node/dist/apps/node-chat/main.js up;
```

### WAF module secure–by-default update

Clients using Unique's WAF module should upgrade their configuration according to the release repositories example file.

## Changed

### Terraform modules

Check the release repository and these notes to update your infrastructure and make sure you use the latest modules where necessary 🚀

Where applicable, extend your own modules.

### Helm Charts

Check the product release notes for details how to migrate to Unique's new helm charts 🎉

## Added

### Support for multiple Document Intelligence locations or Switzerland GA version of `FormRecognizer`

Consult your Unique Data Science Expert to learn if you require this change and how to perform it best.

#### `[terraform]` Provision an identity

```hcl
module "workload_identities" {
  …
  identities = {
    …
    assistants-core = {
      keyvault_id = module.chat.keyvault_id
      namespace   = "chat"
      roles       = ["Cognitive Services User" /* Document Intelligence */]
    }
  }
}
```

#### `[terraform]` Add identity to existing deployments and/or make new deployments

```hcl
module "document-ingelligence-switzerlandnorth" {
  source           = "<src>/az-document-intelligence"
  context          = module.context
  account_location = "switzerlandnorth"

user_assigned_identity_ids = [\
    …\\
    module.workload_identities.user_assigned_identity_ids["assistants-core"]\
  ]
}
```

#### `[terraform]` Extend Unique Chat secrets

```hcl
module "chat" {
  …
  azure_document_intelligence_endpoints = [\
    module.document-ingelligence-westeurope.endpoint,\
    module.document-ingelligence-switzerlandnorth.endpoint,\
  ]
  azure_document_intelligence_endpoint_definitions = [\
    module.document-ingelligence-westeurope.endpoint_definition,\
    module.document-ingelligence-switzerlandnorth.endpoint_definition,\
  ]
  …
}
```

#### `[helm]` Service Account must be added (needs matching Infrastructure change, see below)

```yaml
# assistants-core.values.yaml
serviceAccount:
  enabled: true
  workloadIdentity:
    clientId: <clientId>
    enabled: true
```

The matching clientId must be filled based on the created identity (see below)

#### `[helm]` New environment variables can be added (needs matching Infrastructure change, see below)

```yaml
# assistants-core.values.yaml
…
AZURE_DOCUMENT_INTELLIGENCE_LOCATION: "switzerlandnorth"
AZURE_DOCUMENT_INTELLIGENCE_API_VERSION: "2023-07-31"

# or, if multiple locations are required

AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT_DEFINITIONS: >-
  [{\
    "endpoint": "<url>",\
    "location": "westeurope"\
  }, {\
    "endpoint": "<url>",\
    "location": "switzerlandnorth"\
  }]
…
```

Clients using Unique's `terraform` module will see `AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT_DEFINITIONS` getting auto-created and can use the secret provider to load it.

#### `[helm]` Auto-load new environment variables from secret provider using CSI Driver

```yaml
# assistants-core.values.yaml
secretProvider:
  vaults:
    <vault-name>:
      …
      AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT_DEFINITIONS: azure-document-intelligence-endpoint-definitions
```

#### `[helm]` Increase replica count

```yaml
# assistants-core.values.yaml
…
replicaCount: 2
```

### Support for DocumentTranslator in `node-chat`

Consult your Unique Data Science Expert to learn if you require this change and how to perform it best.

#### New `INTERNAL_MODULES_CONFIG` entry must be added (if DocumentTranslator should be used)

```json
…
{"name": "DocumentTranslator", "apiURL": "http://assistants-core.chat.svc.cluster.local:8081/core/document_translator"}
…
```

## Depending on contract

### `[helm]` Set `UNIQUE_INSTALLATION_ID`

Set the ID on: `scope-management`, `client-insights-exporter` and `chat` (the node service)

```
UNIQUE_INSTALLATION_ID: domain.where.unique.lives
```

This is for the `client-insights` service to be able to identify the installation.

## Feature Flags

### Chat frontend (`next-chat` or `web-app-chat`)

```
FEATURE_FLAG_ENABLE_ASSISTANT_ACCESS_UN_5775: 'true' | 'false'
FEATURE_FLAG_KNOWLEDGE_SCOPE_UN_5773: 'true' | 'false'
```

Check in the [Release 2024.44](https://docs.unique.ai/it-operators/installing-and-upgrading-unique/release-notes-and-calendar/release-notes-2024/release-2024-44) if you would like to enable or disable these features.
