source/TestCommon/source/FunctionApp.TestCommon/Azurite/AzuriteManager.cs
/// <summary>
/// Azure Storage Emulator is still started/used when starting the function app locally from some IDE's.
/// </summary>
Azure Storage Emulator is still started/used when starting the function app locally from some IDE's.
Azure Storage Emulator is still started / used when starting the function app locally from some IDE ' s .
private static void StopAzureStorageEmulator()
        {
            var storageEmulatorFilePath = @"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe";
            if (File.Exists(storageEmulatorFilePath))
            {
                using var storageEmulatorProcess = new Process
                {
                    StartInfo =
                    {
                        FileName = storageEmulatorFilePath,
                        Arguments = "stop",
                    },
                };
                var success = storageEmulatorProcess.Start();
                if (!success)
                {
                    throw new InvalidOperationException("Error when stopping Azure Storage Emulator.");
                }
                var timeout = TimeSpan.FromMinutes(2);
                var hasExited = storageEmulatorProcess.WaitForExit((int)timeout.TotalMilliseconds);
                if (!hasExited)
                {
                    KillAndDisposeProcess(storageEmulatorProcess);
                    throw new InvalidOperationException($"Azure Storage Emulator did not stop within: '{timeout}'");
                }
            }
        }
private static void StopAzureStorageEmulator ( ) { var storageEmulatorFilePath = @"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" ; if ( File . Exists ( storageEmulatorFilePath ) ) { using var storageEmulatorProcess = new Process { StartInfo = { FileName = storageEmulatorFilePath , Arguments = " " , } , } ; var success = storageEmulatorProcess . Start ( ) ; if ( ! success ) { throw new InvalidOperationException ( " " ) ; } var timeout = TimeSpan . FromMinutes ( 2 ) ; var hasExited = storageEmulatorProcess . WaitForExit ( ( int ) timeout . TotalMilliseconds ) ; if ( ! hasExited ) { KillAndDisposeProcess ( storageEmulatorProcess ) ; throw new InvalidOperationException ( $" Azure Storage Emulator did not stop within: ' { timeout } ' " ) ; } } }
Azure Storage Emulator is still started/used when starting the function app locally from some IDE's.
Azure Storage Emulator is still started / used when starting the function app locally from some IDE ' s .
// Azure Storage Emulator is stopped using a process that will exit right away.