Azure Compute Emulator error "The communication object ... cannot be used for communication because it is in the Faulted state."

error: unable to start the storage emulator.
azure storage emulator
azure storage emulator access is denied
failed to initialize microsoft azure storage emulator
azure storage emulator ui
azure storage emulator github
azure storage emulator docker
ssis azure storage emulator

I have some setup & teardown scripts that use csrun.exe to prepare a local compute emulator for some automated tests.

C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /removeall
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /devfabric:clean
C:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe /run:"c:\myapp\csx\Release";"c:\myapp\bin\Release\app.publish\ServiceConfiguration.Local.cscfg"

The csrun call to removeall inconsistently fails with this error:

Encountered an unexpected error The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
Server stack trace:
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.IDisposable.Dispose()
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.SingleInstanceFabricClient.Connect()
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabric.EnsureClient(Boolean checkConnection)
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.DevFabric.d__0.MoveNext()
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.RemoveAll()
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ParseArguments(String[] args, Boolean doActions)
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ExecuteActions(String[] args).

And the csrun call for deployment also inconsistently fails with the same error (slightly different stack trace):

Encountered an unexpected error The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
Server stack trace:
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.IDisposable.Dispose()
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.SingleInstanceFabricClient.RunServiceDeployment(String tenantName)
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.Deployment.Start()
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.Run(DirectoryInfo dir, FileInfo serviceConfiguration, Boolean launchBrowser, Boolean paused, String debugger, Boolean useIISExpress, List`1 portOverrides)
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ParseArguments(String[] args, Boolean doActions)
at Microsoft.ServiceHosting.Tools.CloudServiceRun.DoActions.ExecuteActions(String[] args).

This is the Compute Emulator v2.4.

I've confirmed the web.config is writable and valid. (As suggested by this thread.)

I've had a similar setup working on another machine with no issues. The only difference I'm aware of is that the working machine has a single-core CPU while this failing one is dual-core.

If the error reported in the files in %LocalAppData%\dftmp\DFServiceLogs looks like this:

DFService Information: 0 : [00002796:00000014, 2019/02/06 17:47:59.054] Exception:System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
   at GARStartRoleEx(UInt16* , UInt16* , UInt16* , _RUNTIME_CERTIFICATE_BLOB_TYPE , Byte* , UInt32 )
   at Microsoft.WindowsAzure.GuestAgent.EmulatorRuntime.EmulatorRuntimeImpl.StartRole(String roleInstanceId, CertificateBlobType certsBlobType, Byte[] certificatesBlob)
   at Microsoft.ServiceHosting.Tools.DevelopmentFabric.Fabricator.StartRoleInstance(RDConfig roleInstanceConfig)`

then your problem is probably that the C++ Runtime that the Compute Emulator depends on is not installed. It needs the VS 2012 C++ Runtime, which I'm guessing used to be installed by earlier versions of Visual Studio, but isn't by default with VS2017.

Installing the correct runtime from http://www.microsoft.com/en-us/download/details.aspx?id=30679 fixed the issue for me.

Azure Storage Emulator v5.5, Resolve these errors before attempting to run the storage emulator again. Error: The storage emulator needs to be initialized. Please run the 'init'  You get this error when you don't have adequate permissions to delete all of the resources not in the template. To avoid the error, change the deployment mode to incremental. Azure Resource Manager deployment modes. DeploymentNameInvalidCharacters. The deployment name can only contain letter, digit, '-', '.' or '_'.

In my case, I deleted the certificate used for SSL and created a new one. Fixed my problem.

Use the Azure storage emulator for development and testing , The Azure storage emulator provides a free local development on an append blob returns a FeatureNotSupportedByEmulator error (HTTP  If possible, you can reinstall the Compute Emulator. Really strange, it should be working as the document says, because it is a known issue. If you want, you can create a ticket to ask help from Contact Microsoft Support by clicking the icon at the right up corner in portal page.

After enabling more logging in c:\Program Files\Microsoft SDKs\Azure\Emulator\csrun.exe.config, investigating csrun.svclog, and investigating the logs in %LOCALAPPDATA%\dftmp , determined the root error was likely this happening in the dfservice.exe: "System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))".

Using Procmon, found that around the time of the error, dfservice.exe encountered a "FILE LOCKED WITH ONLY READERS" issue when attempting to access myapp\csx\Release\roles\MyWorkerRoleName\base\x64\WaHostBootstrapper.exe

My best guess is that the emulator is holding onto files from prior instances despite my efforts to do cleans and removes.

I think I solved it by changing my build scripts to create a fresh unique directory in %TEMP% for each build execution (and emulator deployment) where I can copy the contents of csx\Release\ beforehand; then I deploy to the emulator from that. (With some additional script code that later attempts to recursively delete all those temp files, but ignores any errors.)

Emulator Express to run/debug Azure cloud service on local box , The following issues are known limitations of Emulator Express: Emulator Express is not compatible with IIS Web Server. Your cloud service can  The Azure storage emulator may not start correctly if another storage emulator, such as Azurite, is running on the system. When the emulator is running, you'll see an icon in the Windows taskbar notification area. When you close the storage emulator Command Prompt window, the storage emulator will continue to run.

Same error in UI appears, if the Compute Emulator is not running at all. The inner exception from log is UnauthorizedAccessException, then. Starting it manually helps, because the Studio Debugger tries to start, but does not wait and the startup procedure takes a while and when it's up the debugger has already thrown the error and stopped.

The Microsoft.Azure.Compute.Emulator.Exe package fails to install , Azure.Compute.Emulator.Exe package fails to install with the error 1603 to uninstall Compute Emulator then install new however it is not able  Solution guidelines: Do: Use this space to post a solution to the problem. Feel free to be as detailed as necessary. Avoid: Asking questions or responding to other solutions. . If you need to ask questions, send a comment inste

Running Visual Studio as Administrator have solved the problem for me.

Error during installation of Microsoft Azure Compute Emulator , I have installed Visual Studio 2017, It gave Error : "Sorry , something went wrong. Couldn't install Microsoft.Azure.Compute.Emulator.exe'. Error handling. Azurite is aligned with Azure Storage error handling logic, but there are differences. For example, error messages may be different, while error status codes align. RA-GRS. Azurite supports read-access geo-redundant replication (RA-GRS). For storage resources, access the secondary location by appending -secondary to the account name. For example, the following address might be used for accessing a blob using the read-only secondary in Azurite:

I can't start the Azure Storage Emulator, databases.. One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again. Error: The  Compute Compute Access cloud compute capacity and scale on demand—and only pay for the resources you use Virtual Machines Provision Windows and Linux virtual machines in seconds Virtual Machine Scale Sets Manage and scale up to thousands of Linux and Windows virtual machines

Windows Azure Storage Emulator Failed to Install, CAQuietExec: Windows Azure Storage Emulator 3.0.0.0 command line tool CAQuietExec: Error: No available SQL Instance was found. Navigate to %LOCALAPPDATA%\AzureStorageEmulator. Locate the .config matching your version of the emulator. In my case it was AzureStorageEmulator.5.2.config. change LoggingEnabled to true. Restart Storage Emulator (very important) At the same time, you can see where the logs will be written under the LogPath node.

Troubleshooting Azure Storage Emulator Errors, In this blog post, we will explain how to get more insight into weird azure storage emulator problems. I just upgraded to SDK 1.5, and the Compute emulator won't start. When I click start in the try icon, it starts, and immediately shuts down again. When I try a deployment from

Comments
  • did you resolve this as I have just started getting this error?
  • I just started getting this too, can get around it by removing the https end point in my cloud service settings. my monthly azure credit ran out, I doubt this has something to do with it.
  • Fixed it it by moving the VM to another host
  • I never fixed it and I similarly just switched around which builds+tests run on which VMs.
  • I was able to resolve some warnings by importing certs into IIS. But the communication error remained.