Azure的,错误请求:请求的主体是空的或者没有预期的内容 [英] Azure, BadRequest: The body of the request is empty or does not have the expected content
问题描述
这开始了作为一个<一个href=\"http://stackoverflow.com/questions/35080712/azure-missingregistrationforlocation-the-subscription-is-not-registered-for-th\">SubscriptionNotFound错误。
This started out as a SubscriptionNotFound error.
然后,我结束了一个<一个href=\"http://stackoverflow.com/questions/35080712/azure-missingregistrationforlocation-the-subscription-is-not-registered-for-th\">MissingRegistrationForLocation错误。
Then I ended up with a MissingRegistrationForLocation error.
而现在我在这里。
同一code:
var dnsClient = new DnsManagementClient(new Microsoft.Azure.TokenCloudCredentials(result.AccessToken));
var zone = dnsClient.Zones.CreateOrUpdate("someresourcegroup", "mydomain.com", new Microsoft.Azure.Management.Dns.Models.ZoneCreateOrUpdateParameters {
IfNoneMatch = "*",
Zone = new Microsoft.Azure.Management.Dns.Models.Zone {
Name = "mydomain.com",
Location = "global"
}
});
和这个错误:
错误请求:请求的主体是空的或者没有预期的内容。
BadRequest: The body of the request is empty or does not have the expected content.
另外2个错误是有道理的,但是这一次似乎有点像一条死胡同。
The other 2 errors makes sense, but this one seems a bit like a dead-end.
什么我身边做错了这个时间呢?
What Am I doing wrong this time around?
推荐答案
请改变你的code和包括属性
:
Please change your code and include Properties
:
var zone = dnsClient.Zones.CreateOrUpdate("someresourcegroup", "mydomain.com", new Microsoft.Azure.Management.Dns.Models.ZoneCreateOrUpdateParameters
{
IfNoneMatch = "*",
Zone = new Microsoft.Azure.Management.Dns.Models.Zone
{
Name = "mydomain.com",
Location = "global",
Properties = new ZoneProperties()//Add this line!
}
});
这应该照顾的问题。
这篇关于Azure的,错误请求:请求的主体是空的或者没有预期的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!