Skip to content

Commit

Permalink
Update Azure Function service name logic (#2508)
Browse files Browse the repository at this point in the history
As titled.
  • Loading branch information
stevejgordon authored Nov 29, 2024
1 parent 7dd5b11 commit ed91a91
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ private void UpdateServiceInformation(Service? service)
return;
}

if (service.Name == AbstractConfigurationReader.AdaptServiceName(AbstractConfigurationReader.DiscoverDefaultServiceName()))
var defaultServiceName = AbstractConfigurationReader.AdaptServiceName(AbstractConfigurationReader.DiscoverDefaultServiceName());

// In local development `WEBSITE_SITE_NAME` may not be set, in which case, we use the discovered default service name
if (service.Name == defaultServiceName && MetaData.WebsiteSiteName is not null)
{
// Only override the service name if it was set to default.
service.Name = MetaData.WebsiteSiteName;
}

service.Framework = new() { Name = "Azure Functions", Version = MetaData.FunctionsExtensionVersion };
var runtimeVersion = service.Runtime?.Version ?? "n/a";
service.Runtime = new() { Name = MetaData.FunctionsWorkerRuntime, Version = runtimeVersion };
Expand Down

0 comments on commit ed91a91

Please sign in to comment.