mirror of https://github.com/dapr/docs.git
				
				
				
			Improve walk through by using consistent file path + dir (#3459)
Signed-off-by: joshvanl <me@joshvanl.dev> Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
		
							parent
							
								
									5696e3ccdf
								
							
						
					
					
						commit
						a97a5b58b3
					
				|  | @ -16,17 +16,7 @@ In this tutorial, you will create a component definition file to interact with t | ||||||
| 
 | 
 | ||||||
| ## Step 1: Create a JSON secret store | ## Step 1: Create a JSON secret store | ||||||
| 
 | 
 | ||||||
| Dapr supports [many types of secret stores]({{< ref supported-secret-stores >}}), but for this tutorial, create a local JSON file named `mysecrets.json` with the following secret: | 1. Create a new directory named `my-components` to hold the new secret and component file: | ||||||
| 
 |  | ||||||
| ```json |  | ||||||
| { |  | ||||||
|    "my-secret" : "I'm Batman" |  | ||||||
| } |  | ||||||
| ``` |  | ||||||
| 
 |  | ||||||
| ## Step 2: Create a secret store Dapr component |  | ||||||
| 
 |  | ||||||
| 1. Create a new directory named `my-components` to hold the new component file: |  | ||||||
| 
 | 
 | ||||||
|    ```bash |    ```bash | ||||||
|    mkdir my-components |    mkdir my-components | ||||||
|  | @ -38,6 +28,16 @@ Dapr supports [many types of secret stores]({{< ref supported-secret-stores >}}) | ||||||
|    cd my-components |    cd my-components | ||||||
|    ``` |    ``` | ||||||
| 
 | 
 | ||||||
|  | 1. Dapr supports [many types of secret stores]({{< ref supported-secret-stores >}}), but for this tutorial, create a local JSON file named `mysecrets.json` with the following secret: | ||||||
|  | 
 | ||||||
|  | ```json | ||||||
|  | { | ||||||
|  |    "my-secret" : "I'm Batman" | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | ## Step 2: Create a secret store Dapr component | ||||||
|  | 
 | ||||||
| 1. Create a new file `localSecretStore.yaml` with the following contents: | 1. Create a new file `localSecretStore.yaml` with the following contents: | ||||||
| 
 | 
 | ||||||
|    ```yaml |    ```yaml | ||||||
|  | @ -51,13 +51,13 @@ Dapr supports [many types of secret stores]({{< ref supported-secret-stores >}}) | ||||||
|      version: v1 |      version: v1 | ||||||
|      metadata: |      metadata: | ||||||
|      - name: secretsFile |      - name: secretsFile | ||||||
|        value: <PATH TO SECRETS FILE>/mysecrets.json |        value: ./mysecrets.json | ||||||
|      - name: nestedSeparator |      - name: nestedSeparator | ||||||
|        value: ":" |        value: ":" | ||||||
|    ``` |    ``` | ||||||
| 
 | 
 | ||||||
| In the above file definition: | In the above file definition: | ||||||
| - `type: secretstores.local.file` tells Dapr to use the local file component as a secret store.  | - `type: secretstores.local.file` tells Dapr to use the local file component as a secret store. | ||||||
| - The metadata fields provide component-specific information needed to work with this component. In this case, the secret store JSON path is relative to where you call `dapr run`. | - The metadata fields provide component-specific information needed to work with this component. In this case, the secret store JSON path is relative to where you call `dapr run`. | ||||||
| 
 | 
 | ||||||
| ## Step 3: Run the Dapr sidecar | ## Step 3: Run the Dapr sidecar | ||||||
|  | @ -65,7 +65,7 @@ In the above file definition: | ||||||
| Launch a Dapr sidecar that will listen on port 3500 for a blank application named `myapp`: | Launch a Dapr sidecar that will listen on port 3500 for a blank application named `myapp`: | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| dapr run --app-id myapp --dapr-http-port 3500 --resources-path ./my-components | dapr run --app-id myapp --dapr-http-port 3500 --resources-path . | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| {{% alert title="Tip" color="primary" %}} | {{% alert title="Tip" color="primary" %}} | ||||||
|  | @ -104,4 +104,4 @@ Invoke-RestMethod -Uri 'http://localhost:3500/v1.0/secrets/my-secret-store/my-se | ||||||
| {"my-secret":"I'm Batman"} | {"my-secret":"I'm Batman"} | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| {{< button text="Next step: Set up a Pub/sub broker >>" page="pubsub-quickstart" >}} | {{< button text="Next step: Set up a Pub/sub broker >>" page="pubsub-quickstart" >}} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue