Azure CosmosDB (14) 使用Postman访问CosmosDB Windows Azure Platform 系列文章目录

  《Windows Azure Platform 系列文章目录

  今天研究了一下如何使用Postman访问Azure CosmosDB。

  CosmosDB API接口,可以参考:https://docs.microsoft.com/en-us/rest/api/cosmos-db/get-a-document

  1.首先,我们登录https://portal.azure.cn,获得url和秘钥

  

  2.安装Postman,导入下面两个文件:

  (1)环境变量

  https://github.com/leizhang1984/Postman/blob/master/CosmosDB/DocumentDBOptions.postman_environment.json

  修改DocumentDBMasterKey的Value,修改为上图的Primary Key

  修改DocumentDBHost的Value,修改为CosmosDB的DNS Name

  

  (2)导入Collection

  https://github.com/leizhang1984/Postman/blob/master/CosmosDB/DocumentDB%20copy.postman_collection.json

  

  3.打开Postman,选择DocumentDBOptions

    

  Collection可以访问的API有:

  (1)List Databases

  (2)Get All Collections

  修改DNS Name:https://{{DocumentDBHost}}/dbs/[这里修改为DatabaseName]/colls

  (3)Get All Document

  (4)Query Collection MemberInfo

  (5)Get a Document

猜你喜欢

转载自www.cnblogs.com/threestone/p/11460134.html