调用Azure REST API创建RestorePoint遇400错误:缺少必填参数
Azure还原点创建REST请求400错误排查
问题原因
Azure Compute创建还原点的REST API实际要求请求体必须包含RestorePoint对象结构,即便要使用默认配置,也不能传递空请求体——这一点当前官方文档存在描述遗漏。
解决方法
你需要传递一个最小化的合法请求体,示例如下:
{ "properties": { "restorePointType": "Consistent" } }
restorePointType可选值为Consistent或Incremental,根据备份需求选择- 若需基于特定虚拟机创建还原点,需额外添加
source字段指定VM资源ID,示例:
{ "properties": { "restorePointType": "Consistent", "source": { "id": "/subscriptions/{subscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/virtualMachines/{VMName}" } } }
验证说明
调整请求体后重新发送请求,即可避免"必填参数'RestorePoint'缺失"的400错误。Azure部分API的实际校验逻辑会比文档描述更严格,这类场景下必须提供符合资源结构的请求体,而非空值。
内容的提问来源于stack exchange,提问作者shlomi
相关产品推荐
相关产品推荐

