I am working on an asp.net core web api project and its hosted on azure app service. What I'm trying is to put my cosmos db connection string in app service connection string. I added a document db type connection string but when I'm calling it, it wont get read.
I tried this,
CosmosDBAccountPrimaryKey = _configuration.GetConnectionString("DOCDBCONNSTR_COSMOSDBCONNSTR");
this also,
CosmosDBAccountPrimaryKey = _configuration.GetConnectionString("COSMOSDBCONNSTR");
But none worked. For just checking i tried to put the connection string in app setting variables and tried this,
CosmosDBAccountPrimaryKey = _configuration["COSMOSDBCONNSTR"];
This worked but when I'm calling from connection string, its not working.

The issue was
Typeof connection string when creating it in app service. I was setting its type toDocument DBwhich was not working. But when I set it up toCustomthen it started working