azureazure-worker-roleshangfire

Azure Tools cannot read Service Definition File


I have a hangfire worker role with the following service definition:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="Company.ServiceA.Cloud.Hangfire" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
  <WorkerRole name="Company.ServiceA.HangfireWorkerRole" vmsize="Standard_A8_v2">
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
      <Setting name="ServiceA.HangfireDb.Server" />
      <Setting name="ServiceA.HangfireDb.Password" />
      <Setting name="ServiceA.HangfireDb.User" />
      <Setting name="ServiceA.HangfireDb.Database" />
      <Setting name="ServiceA.ReadonlyDB.Server" />
      <Setting name="ServiceA.ReadonlyDB.Password" />
      <Setting name="ServiceA.ReadonlyDB.User" />
      <Setting name="ServiceA.Redis.Progress" />
      <Setting name="ServiceA.Redis.Progress.DatabaseId" />
      <Setting name="ServiceA.ReadonlyDB.Database" />
      <Setting name="ServiceA.DefaultDB.Server" />
      <Setting name="ServiceA.DefaultDB.Password" />
      <Setting name="ServiceA.DefaultDB.User" />
      <Setting name="ServiceA.DefaultDB.Database" />
      <Setting name="ServiceA.CalculationCache.Disabled" />
    </ConfigurationSettings>
  </WorkerRole>
</ServiceDefinition>

Some values changed for security reasons.

When I try to debug my cloud project, I see the following error:

Microsoft Azure Tools for Microsoft Visual Studio
Error reading Service Definition file
C:/Temp/ServiceDefinition.csdef

I'm using Azure Tools 2.7.1. Hangfire 1.6.19.

Is my file misformatted? I've read the documentation on Service Definition files here:

and everything seems to match up.

It's quite ridiculous how little error information is given. Surely microsoft can come up with something more specific than this.


Solution

  • I had this same problem because the compute emulator does not recognize the value of the vmsize attribute, even though it is a valid Azure instance size.

    In my case, it was failing for "Standard_D2_v3". I was able to debug locally when changing to "Standard_D2_v2".