locked
Startup Task and ServiceDefintion.build.csdef RRS feed

  • Question

  • Hi,

    We have a custom build process were we use build azure projects.  We just recently upgraded from 1.2 to 1.4.  We did this because we need to take advantage of the new startup tasks.  We are having a small issue with the csdef files.  When we build instead of getting the normal servicedefinition.csdef we instead are getting a servicedefinition.build.csdef.  The servicedefinition.build.csdef has come extra sections and removes some comments.  It also appears to be removing the startup task.  Why is startup task being removed from the servicedefinition.build.csdef before we pack?

    Tuesday, May 24, 2011 8:01 PM

Answers

  • Hi AbdElRaheim,

    > AbLooking inside the csx folder I see that all the comments in the csdef file have been removed and the startuptask is no longer there. Poking around a little bit more I do see the startup task in RoleModel.xml.  It appears that the startup task is moved from the csdef and put into this file instead.

    I misunderstood you meant this file, [azure service project]\ServiceDefinition.build.csdef. Yes, I can confirm that startup task is removed from [azure service project]\\bin\Debug\[project name].csx\ServiceDefinition.build.csdef to RoleModel.xml of the role folder.

    I think behavior is fine and will work without problem.

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Tuesday, May 31, 2011 2:38 AM
    Friday, May 27, 2011 5:31 AM

All replies

  • Hi AbdElRaheim,

    > Why is startup task being removed from the servicedefinition.build.csdef before we pack?

    The ServiceDefinition.build.csdef file will be generated automatically when a build action is performance in Visual Studio. I have tried rebuilding the service project in Visual Studio and confirm that the startup task will be copied to ServiceDefinition.build.csdef. If it does not work for you, maybe there is an issue in your Azure SDK installation?

    Since ServiceDefinition.build.csdef (we can treat it as a temporary file) is automatically generated in build time by Visual Studio (for adding extra settings etc.), as you are using a custom build process, I'd recommend using ServiceDefinition.csdef instead of ServiceDefinition.build.csdef.

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, May 25, 2011 5:16 AM
  • I am seeing different behavior.  I created a sample wcf project with a startup task define in the csdef like below.

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition name="WindowsAzureProject6" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
      <WebRole name="WCFServiceWebRole1">
        <Sites>
          <Site name="Web">
            <Bindings>
              <Binding name="Endpoint1" endpointName="Endpoint1" />
            </Bindings>
          </Site>
        </Sites>
        <Endpoints>
          <InputEndpoint name="Endpoint1" protocol="http" port="80" />
        </Endpoints>
        <Imports>
          <Import moduleName="Diagnostics" />
        </Imports>
        <LocalResources>
          <LocalStorage name="WCFServiceWebRole1.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
        </LocalResources>
        <Startup>
          <Task commandLine="C:\windows\System32\calc.exe" executionContext="elevated" taskType="simple"/>
        </Startup>
      </WebRole>
    </ServiceDefinition>

    I build, publish, and the package is created.  Looking inside the csx folder I see that all the comments in the csdef file have been removed and the startuptask is no longer there.  From what I understand the configuration for roles is also added to the config file I guess during publish.  During this step our startup tasks disappear.

     

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WindowsAzureProject6" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
      <WebRole name="WCFServiceWebRole1">
        <LocalResources>
          <LocalStorage name="DiagnosticStore" sizeInMB="4096" cleanOnRoleRecycle="false" />
          <LocalStorage name="WCFServiceWebRole1.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
        </LocalResources>
        <ConfigurationSettings>
          <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
        </ConfigurationSettings>
        <Endpoints>
          <InputEndpoint name="Endpoint1" protocol="http" port="80" localPort="80" />
        </Endpoints>
        <Certificates />
      </WebRole>
    </ServiceDefinition>

    We could possibly do some wierd hacking in cloudservices.targets but I am sure I am just missing something here. 

    Thursday, May 26, 2011 12:12 AM
  • Poking around a little bit more I do see the startup task in RoleModel.xml.  It appears that the startup task is moved from the csdef and put into this file instead.  When we are deploying we extract the package, update environment specific settings, and repack.  The guy that works on this told me the startup task was not present.  So I think we might have a different problem now why the startup task is not running. 
    Thursday, May 26, 2011 12:20 AM
  • Hi AbdElRaheim,

    > AbLooking inside the csx folder I see that all the comments in the csdef file have been removed and the startuptask is no longer there. Poking around a little bit more I do see the startup task in RoleModel.xml.  It appears that the startup task is moved from the csdef and put into this file instead.

    I misunderstood you meant this file, [azure service project]\ServiceDefinition.build.csdef. Yes, I can confirm that startup task is removed from [azure service project]\\bin\Debug\[project name].csx\ServiceDefinition.build.csdef to RoleModel.xml of the role folder.

    I think behavior is fine and will work without problem.

    Thanks,


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Wenchao Zeng Tuesday, May 31, 2011 2:38 AM
    Friday, May 27, 2011 5:31 AM