Skip to content

Latest commit

 

History

History

Binding

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Binding demo

The purpose of this demo is to show the use of binding components locally and in the cloud.

Open the demo_binding.code-workspace file and click the Open Workspace button in the lower right corner. This will reload your Codespace and scope your Explorer to just the folders needed for this demo.

To provision the infrastructure before the demo execute the following command in the terminal.

./demo.ps1 -env azure -deployOnly

This code is automatically run by the demo.ps1 script if the -env azure parameter is passed and ./components/azure/local_secrets.json file is not found.

The workspace consists of one top level folder Binding. This folder contains the components, deploy, and tempfiles folders. The components folder contains an azure and local folder so you can show the difference between a local component and a component configured for the cloud. The component in the components/azure folder is configured to use Azure Blob Storage while the local component is configured to use local file storage. The point to make comparing the files is that as long as the name of the component (in our demo "files") does not change the code will work no matter what backing service is used.

The core of the demo is in the sampleRequests.http file. Do not change this file. To run the demos use the demo.ps1 file. It will update the sampleRequests.http for running locally or in the cloud for you. At the top of the file are two demo.ps1 commands. One for running the requests against local resources and one for running against the cloud resources. Copy the desired command and run it in the terminal. This will start Dapr pointing to the appropriate components for the demo. The Dapr run command issued is output if you want to explain during the demo.

Running local

./demo.ps1

Running in cloud

./demo.ps1 -env azure

Click the Send Request button above each of the requests to execute them.

send requests

When running locally you can expand the tempfiles folder to show the data being stored and deleted. When running in the cloud use the portal to show the data being stored and deleted.

When you are done with the demo you can clean up the cloud resources by running the cleanUp.ps1 script using the following commands:

./cleanUp.ps1