Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-model-and-package#csdef
  • https://msdn.microsoft.com/en-us/library/azure/gg557552.aspx

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.

like image 232
toshiomagic Avatar asked Apr 18 '18 13:04

toshiomagic


People also ask

What is cspkg file?

cspkg is a zip file that is generated from the ServiceDefinition. csdef and among other things, contains all the required binary-based dependencies. Azure creates a cloud service from both the ServicePackage. cspkg and the ServiceConfig. cscfg.

Which setting must be enabled within the configuration of the project role to enable diagnostics?

In the role's Properties dialog box, select the Configuration tab. In the Diagnostics section, make sure that the Enable Diagnostics check box is selected.

What is the default size available for crash dump in Azure Diagnostics?

The maximum amount of local disk space that may be consumed by the various types of diagnostic data collected by Azure Diagnostics. The default setting is 4096 MB.

What is Azure platform?

The Azure cloud platform is more than 200 products and cloud services designed to help you bring new solutions to life—to solve today's challenges and create the future. Build, run, and manage applications across multiple clouds, on-premises, and at the edge, with the tools and frameworks of your choice.


1 Answers

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".

like image 128
Vyrx Avatar answered Sep 20 '22 01:09

Vyrx