0
votes

I'm able to add and delete documents fine with an azure function, and read them into my react app. The problem at hand is that the documents I create do not show up in the Data Explorer in portal.azure.com nor does it show up in the Azure Storage Explorer stand alone app.

What's odd is that if I make an object manually in the portal it will show up. I believe this is due to me not having some specific system keys included. I really prefer not to use their object structure as fields and properties are buried and it is messy accessing fields on the front end.

So my question: Is there a way to access and edit my documents that isn't in portal.azure.com nor Azure Storage Explorer?

Edit: Here is an object that I send to cosmos via azure function

{
"id": "e85ddc0d-7346-487b-bb58-a33c5ae95176",
"section_name": "Images",
"type": "images",
"fields": [
 {
  "name": "Khi",
  "images": [
    {
      "url": "URL",
      "version": "1"
    }
  ],
  "deleted": false,
  "_rid": "-pIVALPSjzgDAAAAAAAAAA==",
  "_self": "dbs/-pIVAA==/colls/-pIVALPSjzg=/docs/-pIVALPSjzgDAAAAAAAAAA==/",
  "_etag": "\"6a0169e8-0000-0200-0000-5dc9c1d50000\"",
  "_attachments": "attachments/",
  "_ts": 1573503445
 }
 ]
}

Here is an object that is created if you manually add a document via portal:

{
"$t": 3,
"$v": {
  "_id": {
    "$t": 7,
    "$v": "]ÊóÝúÒQ¤íÇ\u0007"
  },
  "id": {
    "$t": 2,
    "$v": "this is a manually entered document"
  },
  "data": {
    "$t": 2,
    "$v": "some data"
  }
},
"id": "NWRjYWYzZGRmYWQyOTE1MWE0ZWRjNzA3"
}]

The manually entered document will show up in the data explorer, the one i send via azure function does not

1
That cannot happen. are you sure you are storing in the correct container/collection?Sajeetharan
Did you include "PartitionKey" in the document? Please share more details as to how you are creating the document in Azure Function as well as in the Portal.Gaurav Mantri
@GauravMantri I dont believe there is a partitiokey no. I'm making the documents via azure function, using the 'Integrate' section to attach a connection to my cosmosdb. To explain what I think this I'll edit my question and show the different object typesJoelMercurio

1 Answers

0
votes

One possibility is that you have 2 Cosmos databases:

  1. One that you are connecting to via the portal and the Azure Storage Explorer
  2. One that you are connecting to via the app

Is your app using a local emulator?

Start by checking the connection string in your app.