Last Updated on February 1, 2022 by sandeeppote

OrderCloud headstart configuration issue- resolved

Error- Running the Headstart.Api with non-compatible .net framework

Resolution – Install .net core 3.1 from here

Error – while running the HeadStart.Api from the Azure Api Configuration when Cosmos is not setup in ServiceCollectionExtensions.cs

When writing this blog there is a issue whilst connecting the Cosmos service is the configuration for the same is set.

Change the code to following in ServiceCollectionExtensions.cs file-

Change the highlighted line as the empty strings are not gracefully handled.

Resolution

==> ServiceCollectionExtensions.cs

if(string.IsNullOrEmpty(config.DatabaseName)|| 
                string.IsNullOrEmpty(config.EndpointUri) || 
                string.IsNullOrEmpty(config.PrimaryKey))
{
  // allow server to be started up without these settings
  // in case they're just trying to seed their environment
  // in the future we'll remove this in favor of centralized seeding   
  // capability

     return services;
}

Error – while running the HeadStart.Api from the Azure Api Configuration when Cosmos is not setup in CosmosExtensions.cs

When writing this blog there is a issue whilst connecting the Cosmos service is the configuration for the same is set.

Change the code to following in CosmosExtensions.cs file-

Change the highlighted line as the empty strings are not gracefully handled.

Resolution- Crate a cosmos endpoint or change the highlighted line of code to-

==> CosmosExtensions.cs

if( string.IsNullOrEmpty(endpointUrl) ||     
           string.IsNullOrEmpty(primaryKey) ||  
           string.IsNullOrEmpty(databaseName))
{
   // allow server to be started up without these settings
   // in case they're just trying to seed their environment
   // in the future we'll remove this in favor of centralized seeding 
   //capability

        return services;
}