Skip to content

Commit a5c172d

Browse files
committed
Remove logic to add a host id. Closes #86
1 parent 2adbcbc commit a5c172d

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs

-21
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ public override async Task RunAsync()
102102
var settings = SelfHostWebHostSettingsFactory.Create(ConsoleTraceLevel, scriptPath);
103103

104104
ReadSecrets();
105-
CheckHostJsonId();
106105

107106
var baseAddress = Setup();
108107

@@ -136,26 +135,6 @@ public override async Task RunAsync()
136135
}
137136
}
138137

139-
private void CheckHostJsonId()
140-
{
141-
if (FileSystemHelpers.FileExists(ScriptConstants.HostMetadataFileName))
142-
{
143-
var hostJsonContent = FileSystemHelpers.ReadAllTextFromFile(ScriptConstants.HostMetadataFileName);
144-
var hostConfig = string.IsNullOrEmpty(hostJsonContent)
145-
? new JObject()
146-
: JsonConvert.DeserializeObject<JObject>(hostJsonContent);
147-
if (hostConfig["id"] == null)
148-
{
149-
ColoredConsole.Out
150-
.WriteLine(WarningColor($"No \"id\" property defined in {ScriptConstants.HostMetadataFileName}."))
151-
.WriteLine(WarningColor($"Updating {ScriptConstants.HostMetadataFileName} with a new \"id\""));
152-
153-
hostConfig.Add("id", Guid.NewGuid().ToString("N"));
154-
FileSystemHelpers.WriteAllTextToFile(ScriptConstants.HostMetadataFileName, JsonConvert.SerializeObject(hostConfig, Formatting.Indented));
155-
}
156-
}
157-
}
158-
159138
private static void DisableCoreLogging(HttpSelfHostConfiguration config)
160139
{
161140
WebScriptHostManager hostManager = config.DependencyResolver.GetService<WebScriptHostManager>();

src/Azure.Functions.Cli/Actions/LocalActions/InitAction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class InitAction : BaseAction
4949
appsettings.json
5050
local.settings.json
5151
"},
52-
{ new Lazy<string>(() => ScriptConstants.HostMetadataFileName), $"{{\"id\":\"{ Guid.NewGuid().ToString("N") }\"}}" },
52+
{ new Lazy<string>(() => ScriptConstants.HostMetadataFileName), "{ }" },
5353
{ new Lazy<string>(() => SecretsManager.AppSettingsFileName), @"{
5454
""IsEncrypted"": true,
5555
""Values"": {

0 commit comments

Comments
 (0)