I'm trying to create a Service Connector (preview) to access a Redis Cache from an Azure Container App. I'm using a shell script (zsh) to automate the deployment.
I've already configured secrets in my container app, including a Redis connection string:
az containerapp secret set \
-g ${GROUP} \
-n ${SERVICE}-demo \
--secrets \
redis-connectionstring="rediss://:${REDIS_PASSWORD}@${REDIS_NAME}.redis.cache.windows:6380/0"
Now I'm trying to create a Redis service connector with the following parameters:
I've tried several approaches based on the Azure CLI documentation:
az containerapp connection create redis \
-g ${GROUP} \
-n ${SERVICE}-demo \
--connection redis_connection \
--server "${REDIS_SERVER}" \
--database 0 \
--client-type python \
--system-identity \
--secret \
AZURE_REDIS_CONNECTIONSTRING="rediss://:${REDIS_PASSWORD}@${REDIS_NAME}.redis.cache.windows:6380/0"
This attempt failed with the error: Unsupported Key {} is provided for parameter --auto-secret
Same error with:
az containerapp connection create redis \
-g ${GROUP} \
-n ${SERVICE}-demo \
--tg ${GROUP} \
--connection redis_connection \
--server ${REDIS_SERVER} \
--database 0 \
--client-type python \
--system-identity \
--secret \
redis-connectionstring=secretref:redis-connectionstring
New attempt without --secret
parameter:
az containerapp connection create redis \
-g ${GROUP} \
-n ${SERVICE}-demo \
--connection redis_connection \
--server "${REDIS_SERVER}" \
--database 0 \
--client-type python \
--system-identity
This attempt prompted me for additional parameters and displayed a message about Microsoft Entra authentication:
The container where the connection information will be saved (as environment variables).
(--container/-c): express-delivery-demo
The resource group which contains the redis server (--target-resource-group/--tg): DFYA.demo
Apply interactive input arguments: --container express-delivery-demo --target-resource-group DFYA.demo
Please enable Microsoft Entra Authentication on your Redis first.
Note that it will cause your cache instances to reboot to load new configuration and result in a failover.
How can I properly configure a Redis service connector for an Azure Container App using system identity and an existing connection string? I'd like to avoid restarting my Redis cache if possible.
For your information, I can create the connection manually from the Azure Portal:
az --version
azure-cli 2.70.0
core 2.70.0
telemetry 1.1.0
Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1
Python location '/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/bin/python'
Config directory '/Users/laurent/.azure'
Extensions directory '/Users/laurent/.azure/cliextensions'
Python (Darwin) 3.12.9 (main, Feb 4 2025, 14:38:38) [Clang 16.0.0 (clang-1600.0.26.6)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.