Question

Ilija Injac [MVP] on Sat, 23 Nov 2013 09:17:29


During development I had several problems, pushing an existing configuration using the "Change Deployment Configuration" API-Call after adding extensions to roles. The "Add-Extension" API-Call works like a charm, without any problems.

After reading some threads on MSDN, including this one:

http://social.msdn.microsoft.com/Forums/windowsazure/en-US/31b6aedc-c069-4e32-8e8f-2ff4b7c30793/management-api-the-request-body-xml-was-invalid-or-not-correctly-specified?forum=windowsazuretroubleshooting

which was posted in 2011, the documentation has still not received an update. There are no XSD files publically available, to check your XML files against. So how can I do a reliable check of my XML files? I am spending more time with guessing and experimenting on how to put the files together, instead of moving forward with my development.

Here is what I learned so far:

  • The XML header HAS to be omitted
  • It is NOT necessary to remove newlines from the XML
  • It SEEMS to be necessary that empty elements are added. But it is NOT clear, which elements

Here is one version of the configuration XML, that has to activate an extension for a certain Role, that version is NOT working:

<ChangeConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/windowsazure">
  <Configuration>[CONFIG]</Configuration>
  <TreatWarningsAsError>False</TreatWarningsAsError>
  <Mode>Auto</Mode>
  <ExtensionConfiguration>
    <NamedRoles>
      <RoleName>SimpleTest</RoleName>
      <Extensions>
        <Id>[SOMEID]</Id>
      </Extensions>
    </NamedRoles>
  </ExtensionConfiguration>
</ChangeConfiguration>

And here is another version, that is working, but does contain the ExtensionConfiguration tag as an empty element:

<ChangeConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/windowsazure">
  <Configuration>[CONFIG]</Configuration>
  <Mode>Auto</Mode>
  <ExtensionConfiguration />
</ChangeConfiguration>

Both of this files are generated using XMLSerializer.

What I am now asking for is:

  • Where are the XSD files, if available?
  • And who can show me a completely valid ChangeConfiguration XML that is working, including all the optional elements (AllRoles and NamedRoles)?

Replies

Jambor yao on Mon, 25 Nov 2013 06:53:31


Hi,
I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

Best Regards

Ilija Injac [MVP] on Mon, 25 Nov 2013 08:36:29


Thank you :) I think many others are interested in a solution as well.

MingXu-MSFT on Mon, 25 Nov 2013 13:44:18


Hi,

  >> who can show me a completely valid ChangeConfiguration XML that is working, including all the optional elements (AllRoles and NamedRoles)?

Per my understanding, the detailed information of change deployment can be found on http://msdn.microsoft.com/en-us/library/windowsazure/ee460809.aspx. All elements are described. Based on the document, you can find the correct structure is:
 
<NamedRoles>
      <Role>
        <RoleName>role_name1</RoleName>
        <Extensions>
          <Extension>
            <Id>identifier-of-extension</Id>
          </Extension>
          ...
        </Extensions>
      </Role>
    </NamedRoles>
 
It seems you're missing the Role element.

  >> Where are the XSD files, if available?

I have not found the public available xsd schema. If it is needed, you can also submit a feedback on http://feedback.windowsazure.com/forums/34192-general-feedback-.

Best Regards,

Ming Xu

Ilija Injac [MVP] on Mon, 25 Nov 2013 14:51:43


Hello Ming,

I know where to find the information's you mentioned, that is not the problem.

The problem is that if those elements are  described as optional, do you need to add those as empty elements or not? Do you need to add an XML header or not?

Therefore, it would be great to have a complete example in C# to see how this can be done.

This is definitely not part of the documentation, and maybe you can shed some light on it.

Thank you.

Best Regards,

Ilija Injac

 

MingXu-MSFT on Wed, 27 Nov 2013 04:24:23


Hi llija,

Thanks a lot for your feedback, I'll pass the feedback to our document team. In the meanwhile, please try to add the Role element and try it again. As for the completed code sample, the good place to submit the idea is Microsoft All-In-One Code Framework: http://blogs.msdn.com/b/onecode/, which is a free, centralized code sample library driven by developers' real-world pains and needs.

Best Regards,

Ming Xu

Ilija Injac [MVP] on Wed, 27 Nov 2013 11:09:41


Hi Ming,

I will submit that request to the All-In-One Code Framework people, and submit code as well.

Best Regards,

Ilija