> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/v1/on-premise-docker/microsoft-azure-setup/cache-azure-cache-for-redis.md).

# Cache - Azure Cache for Redis

Here, you can find a tutorial on how to setup a Redis Cache on Azure to work with DecisionRules.

## Creating Azure Cache for Redis

After navigating navigating to **Azure Cache for Redis**, hit Create. In the following screen assign your Resource group, give the cache a DNS name, choose a location and assing the **Standard C1** type. The type selection is up to you but we recommend a cache with at least 1GB of storage.&#x20;

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/qfMoSlQNrKZ19NMiIqQN/image.png" alt=""><figcaption><p>Basic Azure Cache for Redis settings</p></figcaption></figure>

Next up is the Networking settings.&#x20;

{% hint style="warning" %}
It is recommended to use a Private Endpoint connection but for hassle free non-Prod environment deployments a Public Endpoint is also an option.
{% endhint %}

After selecting **Private Endpoint** click Add private endpoint and fill in the settings. Location and resource group settings should correspond to those of your server containers'.&#x20;

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/OS0xrwuTxqo0Y1rT4eER/image.png" alt=""><figcaption><p>Networking settings</p></figcaption></figure>

Keep the rest of the settings default unless your use-case demands otherwise. Optionally also add tags for easier resource management.

Validate your settings and create the cache.

## Necessary settings and connection strings

**Maxmemory policy**

After the cache has been provisioned, navigate to it's Settings/Advanced Settings tab. Once there, change the Maxmemory policy to **allkeys-lru** or **allkeys-lfu**.

**Connection string**

The format of your connection string will depend on whether you're using SSL or non-SSL connection.

* **SSL** - `rediss://<access_key>@<hostname>:<port>`
* **Non-SSL** - `redis://<access_key>@<hostname>:<port>`

Note the difference is in the first part of the string `rediss://` x `redis://`.

* You can find the `<access_key>` under Settings / Access keys
* You can find the `<hostname>` and `<port>` under Settings / Properties

{% hint style="info" %}
Azure Cache for Redis tends to idle after a period of inactivity (10 minutes). To prevent this, and the corresponding expensive cache misses, we recommend setting the REDIS\_PING\_INTERVAL optional Environment Variable.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decisionrules.io/doc/v1/on-premise-docker/microsoft-azure-setup/cache-azure-cache-for-redis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
