The request body XML was invalid or not correctly specified - Managment API Change Configuration Call - Again
Category: azure troubleshooting
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:
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)?
Jambor yao on Mon, 25 Nov 2013 06:53:31
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.
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
>> 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
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-.
Ilija Injac [MVP] on Mon, 25 Nov 2013 14:51:43
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.
MingXu-MSFT on Wed, 27 Nov 2013 04:24:23
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.
Ilija Injac [MVP] on Wed, 27 Nov 2013 11:09:41
I will submit that request to the All-In-One Code Framework people, and submit code as well.