Write the code that updates the Cosmos DB document for the product to include the image URL.
- [Instructor] The second piece of our image upload…is to go into our document DB or Cosmos DB Service.…We want to add an image to that product.…So we want to retrieve that JSON document…and update it by adding an image property.…So we need the URI for the document so we can access it.…We're going to use a URIFactory which is part…of the Cosmos DB or document DB SDK.…Then we're going to create a document URI.…And into that then we pass the various items.…
So we have the database name, we have the collection name,…and we have the actual ID of the item.…And this then will parse those out…and create for us the actual URI.…Collection name there.…Now that we've got the URI we can just go out…and get that document so we can await…the doc.Client.readdocuementAsync…and we'll pass in that URI and that will get us…back the document that we need.…
And now we can set a property on it,…so remember the resource is…going to give me the actual document…and now I can set a property value dynamically.…Now I can pass in the image URI.…
Author
Released
12/13/2018- Planning your web app
- Choosing compute, storage, integration, and networking solutions
- Creating the web app and API on Azure
- Creating the Azure Cosmos DB resources used by the app
- Data consumption in the app
- Creating an Azure Functions project
- Building, publishing, and testing Logic Apps
- Packaging resources
Skill Level Beginner
Duration
Views
Related Courses
-
Angular: Building on Azure Microservices
with Robby Millsap1h 46m Intermediate -
Azure Serverless Computing
with Mike Benkovich2h 6m Intermediate -
Azure Developer Tips
with Mike Benkovich2h 12m Intermediate
-
Introduction
-
What you should know1m 2s
-
1. Planning the Application
-
Integration: Logic Apps1m 3s
-
2. Creating the Web App and API on Azure
-
Deploy the web application2m 33s
-
Add API documentation5m 26s
-
Publish the Web API2m 9s
-
3. Data Admin in the Application
-
Create Cosmos DB resources4m 19s
-
-
4. Data Consumption in the Application
-
5. Creating the Azure Function
-
Implement Function logic6m 9s
-
6. Building the Logic App
-
Define the Logic App logic6m 18s
-
Publish the Logic App2m 7s
-
Test the Logic App1m 45s
-
7. Packaging the Resources
-
Exporting the ARM template3m 59s
-
Test the app2m 18s
-
-
Conclusion
-
Next steps1m 17s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Add an image link to Cosmos DB