Skip to content

Commit ecf2b57

Browse files
authored
Set AzureWebJobsStorage to use the storage emulator by default on all platforms (#4701)
1 parent a7cc417 commit ecf2b57

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
#### Changes
99

1010
- Add updated Durable .NET templates (#4692)
11+
- Set `AzureWebJobsStorage` to use the storage emulator by default on all platforms (#4685)

src/Cli/func/Actions/LocalActions/InitAction.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,9 @@ private void ValidateTargetFramework()
400400

401401
private static async Task WriteLocalSettingsJson(WorkerRuntime workerRuntime, ProgrammingModel programmingModel)
402402
{
403-
var localSettingsJsonContent = await StaticResources.LocalSettingsJson;
403+
string localSettingsJsonContent = await StaticResources.LocalSettingsJson;
404404
localSettingsJsonContent = localSettingsJsonContent.Replace($"{{{Constants.FunctionsWorkerRuntime}}}", WorkerRuntimeLanguageHelper.GetRuntimeMoniker(workerRuntime));
405-
406-
var storageConnectionStringValue = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
407-
? Constants.StorageEmulatorConnectionString
408-
: string.Empty;
409-
410-
localSettingsJsonContent = localSettingsJsonContent.Replace($"{{{Constants.AzureWebJobsStorage}}}", storageConnectionStringValue);
405+
localSettingsJsonContent = localSettingsJsonContent.Replace($"{{{Constants.AzureWebJobsStorage}}}", Constants.StorageEmulatorConnectionString);
411406

412407
if (workerRuntime == Helpers.WorkerRuntime.Powershell)
413408
{

src/Cli/func/Helpers/DotnetHelpers.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ await TemplateOperationAsync(
9595
var frameworkString = string.IsNullOrEmpty(targetFramework)
9696
? string.Empty
9797
: $"--Framework \"{targetFramework}\"";
98-
var connectionString = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
99-
? $"--StorageConnectionStringValue \"{Constants.StorageEmulatorConnectionString}\""
100-
: string.Empty;
98+
var connectionString = $"--StorageConnectionStringValue \"{Constants.StorageEmulatorConnectionString}\"";
10199
TryGetCustomHiveArg(workerRuntime, out string customHive);
102100
var exe = new Executable("dotnet", $"new func {frameworkString} --AzureFunctionsVersion v4 --name {name} {connectionString} {(force ? "--force" : string.Empty)}{customHive}");
103101
var exitCode = await exe.RunAsync(o => { }, e => ColoredConsole.Error.WriteLine(ErrorColor(e)));

0 commit comments

Comments
 (0)