无法初始化/运行Azure存储仿真程序

无法初始化/运行Azure存储仿真程序,azure,azure-storage,azure-functions,azure-storage-emulator,Azure,Azure Storage,Azure Functions,Azure Storage Emulator,无法初始化/运行Azure存储仿真程序 我试图创建一个Azure函数,但一开始就遇到了问题。我有VS 2017 enterprise,我创建了一个模板Azure函数,当我去调试时,它会让我知道典型的(意译)“无法启动Azure Storage Emulator,请以管理员身份运行azurestorageemulator.exe start。”。我已经用VSStudio作为管理员和普通运行完成了这项工作,结果是一样的 (顺便说一句,当我昨天开始这项工作时,我使用的是emulator的5.4.x.x

无法初始化/运行Azure存储仿真程序

我试图创建一个Azure函数,但一开始就遇到了问题。我有VS 2017 enterprise,我创建了一个模板Azure函数,当我去调试时,它会让我知道典型的(意译)“无法启动Azure Storage Emulator,请以管理员身份运行azurestorageemulator.exe start。”。我已经用VSStudio作为管理员和普通运行完成了这项工作,结果是一样的

(顺便说一句,当我昨天开始这项工作时,我使用的是emulator的5.4.x.x…我检查了所有我能找到的东西,包括删除/重新启动localdb实例…然后有一个有趣的地方,我决定更新visual studio和所有组件,在完成这项工作并重新启动之后,我打开了VS模板项目。)t并运行调试,它刚刚工作,emulator命令窗口打开并运行,显示所有预期的输出,等等。我关闭了一晚,但第二天又回来了,现在我回到了最初的问题状态。)

所以我开始这样做(从第一段开始,以管理员的身份运行storage emulator),我基本上得到了一个错误探测(localdb)/MSSQLLocalDB(完整的错误日志将在底部):

正在探测SQL实例:'(localdb)\MSSQLLocalDB'。 探测SQL终结点时捕获异常。目标主体名称不正确。无法生成SSPI上下文

总结出的错误是应该运行init,尽管我认为问题更多的是首先访问本地数据库……不过,我尝试了init,但也遇到了类似的问题:

我已经完成了删除mssqllocaldb和azurestorageemulator mdf以及类似文件的步骤,正如预期的那样,没有问题……以下是数据库的当前信息详细信息:


以下是模拟器启动/初始化调用的完整输出。如有任何帮助或想法,将不胜感激




以下是完整的AzureStorageEmulator.exe.config文件,以防有用:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="StorageEmulatorConfig" type="Microsoft.WindowsAzure.Storage.Emulator.Controller.Configuration.StorageEmulatorConfigurationHandler, Microsoft.Azure.Storage.Emulator.Controller"/>
  </configSections>

  <StorageEmulatorConfig>
    <services>
      <service name="Blob" url="http://127.0.0.1:10000/"/>
      <service name="Queue" url="http://127.0.0.1:10001/"/>
      <service name="Table" url="http://127.0.0.1:10002/"/>
    </services>

    <!-- NOTE: These are preconfigured accounts with well known keys. The purpose of the
      authentication supported by the Storage Emulator is simply to allow you to test
      your authentication code. It has no security purpose.
      It is strongly recommended that you DO NOT use your actual storage account or key over here.
      These keys are stored unencrypted on disk and in SQL databases.
      -->
    <accounts>
      <account name="devstoreaccount1" authKey="{ActualValueRemoved}" />
    </accounts>
  </StorageEmulatorConfig>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Windows.Forms" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Core" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Xml" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Drawing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.Serialization" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>

      <dependentAssembly>
        <assemblyIdentity name="System.Data.Services" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Data" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>


此外,以下是AppData\Local\AzureStorageEmulator\AzureStorageEmulator.5.7.config中配置文件的内容:

<?xml version="1.0"?>
<StorageEmulator xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SQLInstance />
  <PageBlobRoot>C:\Users\{I STRIPPED OUT MY USER PROFILE NAME}\AppData\Local\AzureStorageEmulator\PageBlobRoot</PageBlobRoot>
  <BlockBlobRoot>C:\Users\{I STRIPPED OUT MY USER PROFILE NAME}\AppData\Local\AzureStorageEmulator\BlockBlobRoot</BlockBlobRoot>
  <LogPath>C:\Users\{I STRIPPED OUT MY USER PROFILE NAME}\AppData\Local\AzureStorageEmulator\Logs</LogPath>
  <LoggingEnabled>false</LoggingEnabled>
</StorageEmulator>

C:\Users\{我删除了我的用户配置文件名}\AppData\Local\AzureStorageEmulator\PageBlobRoot
C:\Users\{我去掉了我的用户配置文件名}\AppData\Local\AzureStorageEmulator\BlockBlobRoot
C:\Users\{我去掉了我的用户配置文件名}\AppData\Local\AzureStorageEmulator\Logs
假的

您是否遵循了上提供的所有说明?您是否尝试使用forceCreate标志?您是否尝试使用专用的SQLExpress实例而不是localDb?它给您的错误很明显:它试图用于连接localDb的Windows主体没有访问权限。我已经尝试了所有这些,这似乎在外部典型模式。我从过去的VS安装中安装了3个版本的localdb,我想…我第一次在更新azure SDK时让它工作了,它工作了很短,我认为一切都很好…但在重新启动后,它又回到了这个问题。我最终删除了所有版本,并从2017 Visual Studio Ins重新安装了localdb更高(正在进行维修),然后它又开始工作了…我以为我很稳定,开发了一两天,但后来我重新启动了,再次回到了相同的状态。看起来我可以通过重新安装localdb暂时修复它,但它只能在重新启动之前工作,这很耗时,而且我想我丢失了数据库中存储的任何东西。你遵守了所有的规则吗在上提供的说明?您是否尝试使用forceCreate标志?您是否尝试使用专用的SQLExpress实例而不是localDb?它给您的错误很明显:它试图用于连接localDb的Windows主体没有访问权限。我已经尝试了所有这些,这似乎超出了典型模式。我从过去的VS安装中安装了3个版本的localdb,我猜…我第一次在更新azure SDK时让它工作了,它工作了很短,我认为一切都很好…但在重新启动后,它又回到了这个问题。我最终删除了所有版本,并从2017 Visual Studio安装程序中重新安装了localdb(运行修复),修复后它又开始工作了…我以为我是可靠的,开发了一两天,但后来我重新启动,再次回到相同的状态。似乎我可以通过重新安装localdb暂时修复它,但它只在重新启动之前工作,这很耗时,而且我想我丢失了数据库中存储的任何东西。
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init
Windows Azure Storage Emulator 5.7.0.0 command line tool
Empty SQL Instance. Autodetecting SQL Instance to use.
Looking for a LocalDB Installation.
Probing SQL Instance: '(localdb)\MSSQLLocalDB'.
Caught exception while probing for SQL endpoint. The target principal name is incorrect.  Cannot generate SSPI context.
Number of SqlErrors Reported: 1
SqlError: System.Data.SqlClient.SqlError: The target principal name is incorrect.  Cannot generate SSPI context.
Could not find a LocalDB Installation.
Probing SQL Instance: 'localhost\SQLExpress'.
Caught exception while probing for SQL endpoint. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Number of SqlErrors Reported: 1
SqlError: System.Data.SqlClient.SqlError: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
No available SQL Instance was found.
One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again.
Error: No available SQL Instance was found.

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>
<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="StorageEmulatorConfig" type="Microsoft.WindowsAzure.Storage.Emulator.Controller.Configuration.StorageEmulatorConfigurationHandler, Microsoft.Azure.Storage.Emulator.Controller"/>
  </configSections>

  <StorageEmulatorConfig>
    <services>
      <service name="Blob" url="http://127.0.0.1:10000/"/>
      <service name="Queue" url="http://127.0.0.1:10001/"/>
      <service name="Table" url="http://127.0.0.1:10002/"/>
    </services>

    <!-- NOTE: These are preconfigured accounts with well known keys. The purpose of the
      authentication supported by the Storage Emulator is simply to allow you to test
      your authentication code. It has no security purpose.
      It is strongly recommended that you DO NOT use your actual storage account or key over here.
      These keys are stored unencrypted on disk and in SQL databases.
      -->
    <accounts>
      <account name="devstoreaccount1" authKey="{ActualValueRemoved}" />
    </accounts>
  </StorageEmulatorConfig>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Windows.Forms" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Core" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Xml" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="mscorlib" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Drawing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.Serialization" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>

      <dependentAssembly>
        <assemblyIdentity name="System.Data.Services" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Data" publicKeyToken="b77a5c561934e089" culture="neutral"/>
        <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
<?xml version="1.0"?>
<StorageEmulator xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SQLInstance />
  <PageBlobRoot>C:\Users\{I STRIPPED OUT MY USER PROFILE NAME}\AppData\Local\AzureStorageEmulator\PageBlobRoot</PageBlobRoot>
  <BlockBlobRoot>C:\Users\{I STRIPPED OUT MY USER PROFILE NAME}\AppData\Local\AzureStorageEmulator\BlockBlobRoot</BlockBlobRoot>
  <LogPath>C:\Users\{I STRIPPED OUT MY USER PROFILE NAME}\AppData\Local\AzureStorageEmulator\Logs</LogPath>
  <LoggingEnabled>false</LoggingEnabled>
</StorageEmulator>