-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
When Logging into redis in the file app_settings_cache.py on Azure Gov the following line throws an error preventing startup
token = credential.get_token(cache_endpoint)
In the code it is the following line:
def configure_app_cache(settings, redis_cache_endpoint=None):
global _settings, update_settings_cache, get_settings_cache, APP_SETTINGS_CACHE, app_cache_is_using_redis
_settings = settings
use_redis = _settings.get('enable_redis_cache', False)
if use_redis:
app_cache_is_using_redis = True
redis_url = settings.get('redis_url', '').strip()
redis_auth_type = settings.get('redis_auth_type', 'key').strip().lower()
if redis_auth_type == 'managed_identity':
print("[ASC] Redis enabled using Managed Identity")
credential = DefaultAzureCredential()
redis_hostname = redis_url.split('.')[0]
cache_endpoint = redis_cache_endpoint
token = credential.get_token(cache_endpoint)
redis_client = Redis(
host=redis_url,
port=6380,
db=0,
password=token.token,
ssl=True
)Recommended Fix:
Add the Authority component to the default credential on the credential = DefaultAzureCredential() line.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Type
Projects
Status
Pending Assignment