Contents

Azure Bug

Contents

maybe a bug in azure when registering app

when registering app in azure,in the period of verifying the publisher domain ,it always said the error,“The server returned an unexpected content type header value. “,after google the problem,i found the solution in the github repo of offical document.it says,the github page does not support content type “application/json”,but return the mime type"application/json;charset=utf-8”.the azure doesn’t think it is correct,so the backend server must be own yours that support the custom content type.as also the example code(nodejs) just as follows,

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
var http = require("http");
//https://github.com/MicrosoftDocs/azure-docs/issues/39665
var server = http.createServer(function(request, res) {
    res.writeHead(200, {
        'Content-Type': 'application/json'
    });

    res.write(
        JSON.stringify({
            associatedApplications: [
                {
                    applicationId: '{replace of your own id}'
                }
            ]
        })
    );
    res.end();
});

server.listen(80);
console.log("Server is listening");

after do that ,it is well done,beer!


References

https://github.com/MicrosoftDocs/azure-docs/issues/39665