Skip to content

Latest commit

 

History

History

Secrets

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Secrets demo

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

Open the demo_secrets.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. This code is automatically run by the demo.ps1 script if the -env parameter is passed and VAULTNAME environment variable is not found.

./demo.ps1 -deployOnly

The workspace consists of one top level folder Secrets. This folder holds the components/azure, components, and deploy folders. The components/azure and components folders are in the workspace 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 Key Vault while the local component is configured to use local file. The point to make comparing the files is that as long as the name of the component 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. 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

dapr run --app-id local --dapr-http-port 3500 --components-path ./components

Running in cloud

dapr run --app-id cloud --dapr-http-port 3500 --components-path ./components/azure

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

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