Hi @Terru Ahmad ,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
There are ways to mask the Application Insights connection string in your application. Here are some options:
Use Azure Key Vault: You can store the Application Insights connection string in Azure Key Vault and retrieve it at runtime in your application. This way, the connection string is not exposed in your application code or configuration files. You can use Azure Managed Identity to authenticate your application to Azure Key Vault.
Use Azure App Configuration: You can store the Application Insights connection string in Azure App Configuration and retrieve it at runtime in your application. This way, the connection string is not exposed in your application code or configuration files. You can use Azure Managed Identity to authenticate your application to Azure App Configuration.
Use environment variables: You can store the Application Insights connection string as an environment variable on the machine where your application is running. Your application can retrieve the connection string from the environment variable at runtime. This way, the connection string is not exposed in your application code or configuration files.
Use Azure Functions: You can create an Azure Function that retrieves the Application Insights connection string from a secure location such as Azure Key Vault or Azure App Configuration and returns it to your application. Your application can call the Azure Function to retrieve the connection string at runtime. This way, the connection string is not exposed in your application code or configuration files.
These are some of the options to mask the Application Insights connection string in your application. You can choose the option that best suits your requirements and security needs.
If you have any further queries, do let us know. If the Answer is helpful, please click "Accept Answer".