How to write Custom log before application start Azure

Copper Contributor

Hi ,

 

Issue : - 

 

In my code   .Connect(new Uri(appConfigEndpoint), credentials)  line is trowing exception and in azure  log stream its saying bad gate way 502.2 because its not able to connect with appconfig end point . I want to display a custom message like 

"Not able to connect to Appconfig end point" in azure app live log stream

 

  Log.WriteLog(context.HostingEnvironment, "Adding Application Configuration");

                            LogWriter.LogInformation(1, "Adding Application Configuration");

                            var appConfigEndpoint = GetAppConfigEndpoint();

                            var credentials = new ManagedIdentityCredential();

                            var pollingInterval = 30;

                            int.TryParse(GetPollingInterval(), out pollingInterval);

                            // Adding App Config

                            config.AddAzureAppConfiguration(options =>

                            options

                                 .Connect(new Uri(appConfigEndpoint), credentials)

0 Replies