我们的订阅中有一些Azure表存储表,由于性能原因,我们希望将它们迁移到CosmosDB表API。为此,我开始通过选择Table API创建cosmos数据库帐户,但我的部署失败,出现以下错误。当我尝试使用SQL API时,它是有效的。
{"code":"DeploymentFailed","message":"至少有一个资源部署操作失败。有关详细信息,请列出部署操作。"details":[{"code":"BadRequest","message":"{\r\n\"code\":\"BadRequest\",\r\n\"message\":\">CORS规则不支持此API\rMicrosoft.Azure.Documents.Common/2.1.0.0\"\r\n}"}]}
有人能告诉我这可能是什么原因吗?
@AngiSen,可能与Azure Cosmos DB资源提供商(Microsoft.DocumentDb/databaseAccounts(最近的(突破性的(更新有关,正如我今天(2018年11月28日(刚刚注意到的,Cosmos DB表API的先前运行的部署(截至2018年11日23日(现在失败,并出现相同错误:
9:16:23 AM - Resource Microsoft.DocumentDb/databaseAccounts 'xxx-xxx-xxx' failed with message '{
"code": "BadRequest",
"message": "CORS rules are not supported for this APIrnActivityId: xxx, Microsoft.Azure.Documents.Common/2.1.0.0"
}'
在我的情况下,我使用带有表API的22015-04-08版本,但我没有显式配置CORS部分,而且无论如何,在资源提供程序中都没有这样的配置选项。
使用挖掘现有的Cosmos DB实例https://resources.azure.com表明确实有一个CORS成员是定义的一部分:
{
"id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.DocumentDB/databaseAccounts/xxx",
"name": "xxx",
"location": "North Europe",
"type": "Microsoft.DocumentDB/databaseAccounts",
"kind": "GlobalDocumentDB",
"tags": {},
"properties": {
"provisioningState": "Succeeded",
"documentEndpoint": "https://xxx.documents.azure.com:443/",
"tableEndpoint": "https://xxx.table.cosmosdb.azure.com:443/",
"ipRangeFilter": "",
"enableAutomaticFailover": false,
"enableMultipleWriteLocations": false,
"isVirtualNetworkFilterEnabled": false,
"virtualNetworkRules": [],
"EnabledApiTypes": "Table, Sql",
"databaseAccountOfferType": "Standard",
"consistencyPolicy": {
"defaultConsistencyLevel": "BoundedStaleness",
"maxIntervalInSeconds": 86400,
"maxStalenessPrefix": 1000000
},
"configurationOverrides": {},
"writeLocations": [
{
"id": "xxx-northeurope",
"locationName": "North Europe",
"documentEndpoint": "https://xxx-northeurope.documents.azure.com:443/",
"provisioningState": "Succeeded",
"failoverPriority": 0
}
],
"readLocations": [
{
"id": "xxx-northeurope",
"locationName": "North Europe",
"documentEndpoint": "https://xxx-northeurope.documents.azure.com:443/",
"provisioningState": "Succeeded",
"failoverPriority": 0
}
],
"locations": [
{
"id": "xxx-northeurope",
"locationName": "North Europe",
"documentEndpoint": "https://xxx-northeurope.documents.azure.com:443/",
"provisioningState": "Succeeded",
"failoverPriority": 0
}
],
"failoverPolicies": [
{
"id": "xxx-northeurope",
"locationName": "North Europe",
"failoverPriority": 0
}
],
"cors": [],
"capabilities": [
{
"name": "EnableTable"
}
]
}
}
如果这确实是一个突破性的变化,希望它能尽快得到修复。。。
想在这里发表正式声明。我已经和Cosmos DB团队谈过了,他们已经准备好了修复程序,应该会在今晚部署。如果你有任何问题,请告诉我。感谢您发布此问题。