@Egling From the sample it looks like you are using the resource endpoint as the variable to be read in the code. Ideally you would set an environment variable on your machine and then reference it in your application code. Here are the steps of setting and retrieving the environment variable in detail.
For example set a variable using this powershell command.
[System.Environment]::SetEnvironmentVariable('ENVIRONMENT_VARIABLE_KEY', 'value', 'User')
Retrieve it using the same ENVIRONMENT_VARIABLE_KEY, It should not be the value as it is currently used in your application. The variable my_value will hold the value of your endpoint or key.
using static System.Environment;
class Program
{
static void Main()
{
// Get the named env var, and assign it to the value variable
var my_value =
GetEnvironmentVariable(
"ENVIRONMENT_VARIABLE_KEY");
}
}
I hope this helps.