From 1143d0d2d976526f6f2ff02d1b6004f70529a95a Mon Sep 17 00:00:00 2001 From: MD Ashique Date: Fri, 6 Oct 2023 19:26:06 +0530 Subject: [PATCH] Adding documentation (#165) * Adding documentation Signed-off-by: MD Ashique * Adding documentation Signed-off-by: MD Ashique * Adding documentation Signed-off-by: MD Ashique * Adding documentation Signed-off-by: MD Ashique * Adding documentation for tenant id Signed-off-by: MD Ashique * Adding documentation Signed-off-by: MD Ashique * Adding documentation Signed-off-by: MD Ashique --------- Signed-off-by: MD Ashique --- README.md | 139 +++--------------- .../README.md => deploy/aca/aca-deployment.md | 11 +- .../aca}/azure-function.bicep | 0 .../aca}/azure-services.bicep | 0 .../aca}/dapr-components.bicep | 0 .../aca}/deploy-samples.bicep | 0 deploy/kubernetes/kubernetes-deployment.md | 69 +++++++++ deploy/local/local-deployment.md | 64 ++++++++ docs/development/development.md | 62 +++++++- docs/dotnet-out-of-proc.md | 41 +----- docs/quickstart.md | 15 +- samples/dapr-kafka/README.md | 5 + samples/dotnet-azurefunction/README.md | 9 +- .../dotnet-isolated-azurefunction/README.md | 7 +- samples/java-azurefunction/README.md | 7 +- samples/javascript-azurefunction/README.md | 7 +- samples/powershell-azurefunction/README.md | 7 +- samples/python-azurefunction/README.md | 7 +- samples/python-v2-azurefunction/README.md | 7 +- samples/quickstart/README.md | 1 + 20 files changed, 248 insertions(+), 210 deletions(-) rename samples/sample-infra/README.md => deploy/aca/aca-deployment.md (70%) rename {samples/sample-infra => deploy/aca}/azure-function.bicep (100%) rename {samples/sample-infra => deploy/aca}/azure-services.bicep (100%) rename {samples/sample-infra => deploy/aca}/dapr-components.bicep (100%) rename {samples/sample-infra => deploy/aca}/deploy-samples.bicep (100%) create mode 100644 deploy/kubernetes/kubernetes-deployment.md create mode 100644 deploy/local/local-deployment.md create mode 100644 samples/dapr-kafka/README.md create mode 100644 samples/quickstart/README.md diff --git a/README.md b/README.md index 83e65ca6..fee7d6e1 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,13 @@ The Azure Functions Dapr extension allows you to easily interact with the Dapr A This extension supports all the languages that Azure Function supports - [C# Isolated](./samples/dotnet-isolated-azurefunction), [C# Inproc](./samples/dotnet-azurefunction), [Java](./samples/java-azurefunction), [JavaScript / TypeScript](./samples/javascript-azurefunction), [Python V2](./samples/python-v2-azurefunction), [Python V1](./samples/python-azurefunction), [PowerShell](./samples/powershell-azurefunction). + +If you are new to Azure Functions, it's recommended to [try out an Azure Function's quickstart first](https://docs.microsoft.com/azure/azure-functions/) to understand the basics of the programming model. + +You can run through a quickstart of developing JavaScript Azure Functions that leverage Dapr following this [tutorial](./docs/quickstart.md) + +You can easily deploy Azure Functions with the Dapr extension in Azure Container Apps (ACA) using a Bicep template. Follow the steps outlined in the [accompanying guide](./deploy/aca/aca-deployment.md). + ## Function Triggers Azure Function triggers cause a function to run. A trigger defines how a function is invoked and a function must have exactly one trigger. Triggers have associated data, which is often provided as the payload of the function. @@ -36,44 +43,6 @@ Azure Function bindings is a way of declaratively connecting another resource to | [daprPublish][publish-output-docs] | Output | Publish a message to a Dapr topic | [C# Isolated][csharp-isolated-publish-output], [C# Inproc][csharp-publish-output], [JavaScript][javascript-publish-output], [Python V2][python-v2-publish-output], [Python V1][python-publish-output], [Java][java-publish-output], [PowerShell][powershell-publish-output] | | [daprBinding][binding-output-docs] | Output | Send a value to a Dapr output binding | [C# Isolated][csharp-isolated-binding-output], [C# Inproc][csharp-binding-output], [JavaScript][javascript-binding-output], [Python V2][python-v2-binding-output], [Python V1][python-binding-output], [Java][java-binding-output], [PowerShell][powershell-binding-output] | -## Quickstart - -If you are new to Azure Functions, it's recommended to [try out an Azure Function's quickstart first](https://docs.microsoft.com/azure/azure-functions/) to understand the basics of the programming model. - -You can run through a quickstart of developing JavaScript Azure Functions that leverage Dapr following this [tutorial](./docs/quickstart.md) - -## Installing the extension - -### .NET Functions - -Run the following command from the path where your csproj is located to add the Nuget package to your Azure Function project - -**Isolated Worker Process:** - -``` -dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Dapr -``` - -**In-process** - -``` -dotnet add package Microsoft.Azure.WebJobs.Extensions.Dapr -``` - -### Non-.NET Functions - -Since this extension is in Preview, you need to add the preview extension by adding or replacing the following code in your host.json file: - -``` -{ - "version": "2.0", - "extensionBundle": { - "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", - "version": "[4.*, 5.0.0)" - } -} -``` - ## Dapr ports and listeners When you are triggering a function from Dapr, the extension will expose port 3001 automatically to listen to incoming requests from the Dapr sidecar. This port is configurable, you can provide any other available port in your app settings for `DAPR_APP_PORT` env variable instead of 3001. @@ -86,91 +55,15 @@ You can override the Dapr address used by input and output bindings by setting t The function app will still expose another port and endpoint for things like HTTP triggers (locally this defaults to 7071, in a container it defaults to 80). -## Running and debugging an app - -Normally when debugging an Azure Function you use the `func` command line tool to start up the function app process and trigger your code. When debugging or running an Azure Function that will leverage Dapr, you need to use `dapr` alongside `func` so both processes are running. - -So when running a Dapr app locally using the default ports, you would leverage the `dapr` CLI to start the `func` CLI. - -### If no Dapr triggers are in the app -`dapr run --app-id functionA --dapr-http-port 3501 -- func host start --no-build` - -### If Dapr triggers are in the app -`dapr run --app-id functionA --app-port 3001 --dapr-http-port 3501 -- func host start --no-build` - -## Deploying to Kubernetes - -You can annotate your function Kubernetes deployments to include the Dapr sidecar. - -> IMPORTANT: Port 3001 will only be exposed and listened if a Dapr trigger is defined in the function app. When using Dapr, the sidecar will wait to receive a response from the defined port before completing instantiation. This means it is important to NOT define the `dapr.io/port` annotation or `--app-port` unless you have a trigger. Doing so may lock your application from the Dapr sidecar. Port 3001 does not need to be exposed or defined if only using input and output bindings. - -To generate a Dockerfile for your app if you don't already have one, you can run the following command in your function project: -`func init --docker-only`. - -The Azure Function core tools can automatically generate for you Kubernetes deployment files based on your local app. It's worth noting these manifests expect [KEDA](https://keda.sh) will be present to manage scaling, so if not using KEDA you may need to remove the `ScaledObjects` generated, or craft your own deployment YAML file. We do recommend including KEDA in any cluster that is running Azure Functions containers (with or without Dapr), but it is an optional component to assist with scaling. - -An example of a function app deployment for Kubernetes can be [found below](#sample-kubernetes-deployment). - -The following command will generate a `deploy.yaml` file for your project: -`func kubernetes deploy --name {container-name} --registry {docker-registry} --dry-run > deploy.yaml` - -You can then edit the generated `deploy.yaml` to add the dapr annotations. You can also craft a deployment manually. - -### Azure Storage account requirements - -While an Azure Storage account is required to run functions within Azure, it is NOT required for functions that run in Kubernetes or from a Docker container. The exception to that is functions that leverage a Timer trigger or Event Hub trigger. In those cases the storage account is used to coordinate leases for instances, so you will need to set an `AzureWebJobsStorage` connection string if using those triggers. You can set the `AzureWebJobsStorage` value to `none` if not using any of the triggers that require it. - -### Sample Kubernetes deployment - -```yml -apiVersion: v1 -kind: Service -metadata: - name: my-function - namespace: default -spec: - selector: - app: my-function - ports: - - protocol: TCP - port: 80 - targetPort: 80 - type: LoadBalancer ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: my-function - namespace: default - labels: - app: my-function -spec: - replicas: 1 - selector: - matchLabels: - app: my-function - template: - metadata: - labels: - app: my-function - annotations: - dapr.io/enabled: "true" - dapr.io/id: "functionapp" - # Only define port of Dapr triggers are included - dapr.io/port: "3001" - spec: - containers: - - name: my-function - image: myregistry/my-function - ports: - # Port for HTTP triggered functions - - containerPort: 80 ---- -``` - ## Known Issues -- **By Design:** In out-of-proc model, support for POCO model isn't available for output bindings and triggers, all the payloads must send JSON data and these data should be used as JsonElement type in Azure Functions. Please look at the [Note section][dotnet-out-of-proc] to find out required values for each bindings and triggers. +- **By Design:** In isolated mode, there's no support for using POCO (Plain Old CLR Object) models in output bindings and triggers. All payloads must be sent as JSON data, and these data should be treated as the JsonElement type in Azure Functions. You can refer to the [input bindings][input-binding-details], [output bindings][output-binding-details], and [triggers][trigger-details] sections to understand the data format and the necessary properties for each type of binding. + +## Deployments +Please follow below documentation to deploy Azure Functions with Dapr Extension. +1. [Local](./deploy/local/local-deployment.md) +2. [ACA](./deploy/aca/aca-deployment.md) +3. [Kubernetes](./deploy/kubernetes/kubernetes-deployment.md) [binding-trigger-docs]: ./docs/triggers.md#input-binding-trigger [service-invocation-trigger-docs]: ./docs/triggers.md#service-invocation-trigger @@ -253,6 +146,8 @@ spec: [powershell-binding-output]: ./samples/powershell-azurefunction/SendMessageToKafka/run.ps1 -[dotnet-out-of-proc]: ./docs/dotnet-out-of-proc.md#Note +[input-binding-details]: ./docs/input-bindings.md +[output-binding-details]: ./docs/output-bindings.md +[trigger-details]: ./docs/triggers.md diff --git a/samples/sample-infra/README.md b/deploy/aca/aca-deployment.md similarity index 70% rename from samples/sample-infra/README.md rename to deploy/aca/aca-deployment.md index 84332e5d..ab7d94d2 100644 --- a/samples/sample-infra/README.md +++ b/deploy/aca/aca-deployment.md @@ -1,9 +1,16 @@ -# azure-functions-dapr-aca-deployment +# Quickstart: Deploying to ACA Steps to deploy the Azure Function with Dapr extension in ACA. +## Clone the Azure function Dapr Extension Repo +``` +git clone https://github.com/Azure/azure-functions-dapr-extension.git + +cd azure-functions-dapr-extension/aca-deployment +``` + ## Create resource group ``` -az group create --name {resourceGroupName} --location eastasia +az group create --name {resourceGroupName} --location {region} ``` ## Deploy azure function samples with Dapr extension in ACA diff --git a/samples/sample-infra/azure-function.bicep b/deploy/aca/azure-function.bicep similarity index 100% rename from samples/sample-infra/azure-function.bicep rename to deploy/aca/azure-function.bicep diff --git a/samples/sample-infra/azure-services.bicep b/deploy/aca/azure-services.bicep similarity index 100% rename from samples/sample-infra/azure-services.bicep rename to deploy/aca/azure-services.bicep diff --git a/samples/sample-infra/dapr-components.bicep b/deploy/aca/dapr-components.bicep similarity index 100% rename from samples/sample-infra/dapr-components.bicep rename to deploy/aca/dapr-components.bicep diff --git a/samples/sample-infra/deploy-samples.bicep b/deploy/aca/deploy-samples.bicep similarity index 100% rename from samples/sample-infra/deploy-samples.bicep rename to deploy/aca/deploy-samples.bicep diff --git a/deploy/kubernetes/kubernetes-deployment.md b/deploy/kubernetes/kubernetes-deployment.md new file mode 100644 index 00000000..86e0f536 --- /dev/null +++ b/deploy/kubernetes/kubernetes-deployment.md @@ -0,0 +1,69 @@ +# Quickstart: Deploying to Kubernetes + +You can annotate your function Kubernetes deployments to include the Dapr sidecar. + +> IMPORTANT: Port 3001 will only be exposed and listened if a Dapr trigger is defined in the function app. When using Dapr, the sidecar will wait to receive a response from the defined port before completing instantiation. This means it is important to NOT define the `dapr.io/port` annotation or `--app-port` unless you have a trigger. Doing so may lock your application from the Dapr sidecar. Port 3001 does not need to be exposed or defined if only using input and output bindings. + +To generate a Dockerfile for your app if you don't already have one, you can run the following command in your function project: +`func init --docker-only`. + +The Azure Function core tools can automatically generate for you Kubernetes deployment files based on your local app. It's worth noting these manifests expect [KEDA](https://keda.sh) will be present to manage scaling, so if not using KEDA you may need to remove the `ScaledObjects` generated, or craft your own deployment YAML file. We do recommend including KEDA in any cluster that is running Azure Functions containers (with or without Dapr), but it is an optional component to assist with scaling. + +An example of a function app deployment for Kubernetes can be [found below](#sample-kubernetes-deployment). + +The following command will generate a `deploy.yaml` file for your project: +`func kubernetes deploy --name {container-name} --registry {docker-registry} --dry-run > deploy.yaml` + +You can then edit the generated `deploy.yaml` to add the dapr annotations. You can also craft a deployment manually. + +### Azure Storage account requirements + +While an Azure Storage account is required to run functions within Azure, it is NOT required for functions that run in Kubernetes or from a Docker container. The exception to that is functions that leverage a Timer trigger or Event Hub trigger. In those cases the storage account is used to coordinate leases for instances, so you will need to set an `AzureWebJobsStorage` connection string if using those triggers. You can set the `AzureWebJobsStorage` value to `none` if not using any of the triggers that require it. + +### Sample Kubernetes deployment + +```yml +apiVersion: v1 +kind: Service +metadata: + name: my-function + namespace: default +spec: + selector: + app: my-function + ports: + - protocol: TCP + port: 80 + targetPort: 80 + type: LoadBalancer +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: my-function + namespace: default + labels: + app: my-function +spec: + replicas: 1 + selector: + matchLabels: + app: my-function + template: + metadata: + labels: + app: my-function + annotations: + dapr.io/enabled: "true" + dapr.io/id: "functionapp" + # Only define port of Dapr triggers are included + dapr.io/port: "3001" + spec: + containers: + - name: my-function + image: myregistry/my-function + ports: + # Port for HTTP triggered functions + - containerPort: 80 +--- +``` \ No newline at end of file diff --git a/deploy/local/local-deployment.md b/deploy/local/local-deployment.md new file mode 100644 index 00000000..b0a1c785 --- /dev/null +++ b/deploy/local/local-deployment.md @@ -0,0 +1,64 @@ +# Quickstart: Deploying to Local + +## Installing the extension + +### .NET Functions + +Run the following command from the path where your csproj is located to add the Nuget package to your Azure Function project + +**Isolated Worker Process:** + +``` +dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Dapr --prerelease +``` + +**In-process** + +``` +dotnet add package Microsoft.Azure.WebJobs.Extensions.Dapr --prerelease +``` + +### Non-.NET Functions + +Since this extension is in Preview, you need to add the preview extension by adding or replacing the following code in your host.json file: + +``` +{ + "version": "2.0", + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", + "version": "[4.*, 5.0.0)" + } +} +``` + +## Using Dapr Extension local build + +The samples in this repo (other than the quickstart) are set up to run using a local build of the extension. + +You can use a development build of the extension for any function by: + +- Referencing the Microsoft.Azure.WebJobs.Extensions.Dapr project in your .NET function +- Publishing the extension to the `bin/` directory of your non-.NET function + +Example for non-.NET function: + +```sh +dotnet publish /path/to/Microsoft.Azure.WebJobs.Extensions.Dapr -o bin/ +``` + +## Running and debugging an app + +Normally when debugging an Azure Function you use the `func` command line tool to start up the function app process and trigger your code. When debugging or running an Azure Function that will leverage Dapr, you need to use `dapr` alongside `func` so both processes are running. + +So when running a Dapr app locally using the default ports, you would leverage the `dapr` CLI to start the `func` CLI. + +### If no Dapr triggers are in the app +```sh +dapr run --app-id functionA --dapr-http-port 3501 -- func host start --no-build +``` + +### If Dapr triggers are in the app +```sh +dapr run --app-id functionA --app-port 3001 --dapr-http-port 3501 -- func host start --no-build +``` diff --git a/docs/development/development.md b/docs/development/development.md index 048a217b..1f5182f6 100644 --- a/docs/development/development.md +++ b/docs/development/development.md @@ -1,13 +1,69 @@ # Setup Local Development -This document is a TODO. +This guide will help you set up the Azure Functions Dapr Extension in your local development environment. Follow these steps to get started. ## Prerequisites -## Clone the repository +Before you begin, ensure you have the following prerequisites installed: + +- Setup Dapr: Follow instructions to [download and install the Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) and [initialize Dapr](https://docs.dapr.io/getting-started/install-dapr-selfhost/) +- [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local) +- [.NET SDK](https://dotnet.microsoft.com/download) +- [Docker](https://www.docker.com/get-started) +- [Setup Dapr components](https://github.com/Azure/azure-functions-dapr-extension/tree/master/samples/components) if you need one + +## Clone the Repository + +To start, clone the Azure Functions Dapr Extension repository to your local machine. Use the following command in your terminal or Git client: + +```bash +git clone https://github.com/Azure/azure-functions-dapr-extension.git +``` ## Build the project +Once you have cloned the repository, navigate to the project directory and build the project. Use the following commands: +``` +cd azure-functions-dapr-extension +dotnet build +``` ## Run tests - +To ensure everything is functioning correctly, it's a good practice to run the tests. Use the following command to run the tests: +``` +dotnet test +``` ## Debugging +To debug the Azure Functions Dapr Extension locally, you can use your preferred development environment, such as Visual Studio Code or Visual Studio. Set breakpoints in your code where needed, and use the appropriate debugging tools for your chosen development environment. + +### Debugging in Visual Studio Code +1. Create/reuse existing samples to debug the extension. +2. Run the function app with below command. + + > [!WARNING] + > Provide ` --app-port 3001` only when you have Dapr trigger(s) in your Azure function + + ``` + dapr run --app-id functionapp --app-port 3001 --dapr-http-port 3501 -- func host start + ``` +3. Open Visual Studio Code, navigate to the project folder, and open the relevant code file. +4. Add breakpoints in your code where needed. +5. In Visual Studio Code, open the "Run and Debug" sidebar, select the configuration for your function, and click the "Run" button. +6. Visual Studio Code will automatically attach the debugger to the running process, and you can enjoy debugging. + +### Debugging in Visual Studio +1. Create/reuse existing samples to debug the extension. +2. Run the function app with below command. + + > [!WARNING] + > Provide ` --app-port 3001` only when you have Dapr trigger(s) in your Azure function + ``` + dapr run --app-id functionapp --app-port 3001 --dapr-http-port 3501 -- func host start + ``` +3. Open Visual Studio, navigate to the project folder, and open the relevant code file. +4. Add breakpoints in your code where needed. +5. In Visual Studio, select the "Debug" menu, then choose "Attach to Process..." +6. Choose the func process or provide the corresponding process ID. +7. Click the "Attach" button to attach the debugger. + + +That's it! You're now set up for local development with the Azure Functions Dapr Extension. You can start building and testing your Azure Functions with Dapr support locally. \ No newline at end of file diff --git a/docs/dotnet-out-of-proc.md b/docs/dotnet-out-of-proc.md index 9a871fec..b11e01e3 100644 --- a/docs/dotnet-out-of-proc.md +++ b/docs/dotnet-out-of-proc.md @@ -1,45 +1,12 @@ -# Azure Functions Dapr Extension - Out-of-Proc Support +# Azure Functions Dapr Extension - Isolated worker support -This repository contains sample code demonstrating the out-of-proc support in the Dapr extension for Azure Functions using the .NET Isolated process. +Azure function Dapr extension supports .Net isolated mode. In isolated mode your functions runs in an isolated worker process in Azure. This allows you to run your .NET class library functions on a version of .NET that is different from the version used by the Functions host process. To learn more about .Net isolated process follow [this link](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide). -## Overview - -The out-of-proc support allows you to host your Azure Functions runtime in a separate process from Dapr, enabling better isolation and scalability. With this approach, the Azure Functions runtime and Dapr run as separate processes but communicate with each other using gRPC. +To learn the differences between isolated worker model and in-process model .NET Azure Functions follow [this link](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-in-process-differences) ## Getting Started -To run the sample Azure Functions with out-of-proc support, follow [these steps][dotnet-out-of-proc-samples] - -## Note - -**Required fields in the payload for dapr bindings and triggers in out-of-proc execution model.** - -# Function Triggers -[daprBindingTrigger][binding-trigger-docs] - -| Field | Required | Example | -| -- | -- | -- | -| data | Y | ```'{\"data\":{\"message\": \"hello!\" }}'``` | - -## Function output Bindings - -[daprState][state-output-docs] - -| Field | Required | Example | -| -- | -- | -- | -| value | Y | ```'{\"value\":{\"message\": \"hello!\" }}'``` | - -[daprPublish][publish-output-docs] - -| Field | Required | Example | -| -- | -- | -- | -| payload | Y | ```'{\"payload\":{\"message\": \"hello!\" }}'``` | - -[daprBinding][binding-output-docs] - -| Field | Required | Example | -| -- | -- | -- | -| data | Y | ```'{\"data\":{\"message\": \"hello!\" }}'``` | +To run the sample Azure Functions Dapr Extension in Isolated process, follow [these steps][dotnet-out-of-proc-samples] [dotnet-out-of-proc-samples]: ../samples/dotnet-isolated-azurefunction/README.md diff --git a/docs/quickstart.md b/docs/quickstart.md index 239e352f..7fd47f51 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -5,7 +5,7 @@ The following will get you started with a Function app that leverages the Dapr e ## Prerequisites * [Dapr configured locally (and optionally in Kubernetes)](https://docs.dapr.io/getting-started/install-dapr/) -* [Azure Functions Core Tools - v3](https://github.com/azure/azure-functions-core-tools#installing) +* [Azure Functions Core Tools - v4](https://github.com/azure/azure-functions-core-tools#installing) * [Docker](https://docs.docker.com/get-docker/) * [.NET Core SDK](https://dotnet.microsoft.com/download) - enables building of the extension locally in the project * [Node 12](https://nodejs.org/) for local debugging of the JavaScript app @@ -24,10 +24,17 @@ The following will get you started with a Function app that leverages the Dapr e ## Installing the Dapr extension -While this extension is in preview it is not included in the default extension bundle for functions. We can still include it, but will need to manually install it into the project, and opt-out to using the default extensions. +Since this extension is in Preview, you need to add the preview extension by adding or replacing the following code in your host.json file: -1. Open the `host.json` file from the root of the project and remove the `extensionBundle` property and values (if they exist). Save the file. -1. Run `func extensions install -p Microsoft.Azure.WebJobs.Extensions.Dapr -v 1.0.0`. Be sure to use the latest version as published on [NuGet](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Dapr). +``` +{ + "version": "2.0", + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle.Preview", + "version": "[4.*, 5.0.0)" + } +} +``` You can validate the extension installed successfully by running the function. Run `func start` and validate the app loads and the startup contains the logs diff --git a/samples/dapr-kafka/README.md b/samples/dapr-kafka/README.md new file mode 100644 index 00000000..e3d6a2e9 --- /dev/null +++ b/samples/dapr-kafka/README.md @@ -0,0 +1,5 @@ +## Run Kafka Docker Container locally with below command. + + ``` + docker-compose -f docker-compose-single-kafka.yml up -d + ``` \ No newline at end of file diff --git a/samples/dotnet-azurefunction/README.md b/samples/dotnet-azurefunction/README.md index aba8def8..71fee364 100644 --- a/samples/dotnet-azurefunction/README.md +++ b/samples/dotnet-azurefunction/README.md @@ -10,12 +10,7 @@ We'll be running a Darp'd function app locally: This sample requires you to have the following installed on your machine: - Setup Dapr: Follow instructions to [download and install the Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) and [initialize Dapr](https://docs.dapr.io/getting-started/install-dapr-selfhost/). - [Install Azure Functions Core Tool](https://github.com/Azure/azure-functions-core-tools/blob/master/README.md#windows) -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) # Step 1 - Understand the Settings @@ -605,3 +600,5 @@ Once you're done using the sample, you can spin down your Kubernetes resources b kubectl delete -f . ``` This will spin down each resource defined by the .yaml files in the deploy directory. + +[run-kafka]: ../../samples/dapr-kafka/README.md \ No newline at end of file diff --git a/samples/dotnet-isolated-azurefunction/README.md b/samples/dotnet-isolated-azurefunction/README.md index 04b23485..3b70bef0 100644 --- a/samples/dotnet-isolated-azurefunction/README.md +++ b/samples/dotnet-isolated-azurefunction/README.md @@ -10,12 +10,7 @@ We'll be running a Darp'd function app locally: This sample requires you to have the following installed on your machine: - Setup Dapr: Follow instructions to [download and install the Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) and [initialize Dapr](https://docs.dapr.io/getting-started/install-dapr-selfhost/). - [Install Azure Functions Core Tool](https://github.com/Azure/azure-functions-core-tools/blob/master/README.md#windows) -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) # Step 1 - Understand the Settings diff --git a/samples/java-azurefunction/README.md b/samples/java-azurefunction/README.md index 233fa752..c47668b9 100644 --- a/samples/java-azurefunction/README.md +++ b/samples/java-azurefunction/README.md @@ -10,12 +10,7 @@ We'll be running a Dapr-ized function app locally: This sample requires you to have the following installed on your machine: - Setup Dapr : Follow instructions to [download and install the Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) and [initialize Dapr](https://docs.dapr.io/getting-started/install-dapr-selfhost/). - [Install Azure Functions Core Tool](https://github.com/Azure/azure-functions-core-tools/blob/master/README.md#windows) -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) - Follow the [Configure your local environment](https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-java#configure-your-environment) instructions for Java. - Install maven - Install the [.NET SDK](https://aka.ms/dotnet-download) diff --git a/samples/javascript-azurefunction/README.md b/samples/javascript-azurefunction/README.md index cae37b1c..11eb2666 100644 --- a/samples/javascript-azurefunction/README.md +++ b/samples/javascript-azurefunction/README.md @@ -10,12 +10,7 @@ We'll be running a Darp'd function app locally: This sample requires you to have the following installed on your machine: - Setup Dapr : Follow instructions to [download and install the Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) and [initialize Dapr](https://docs.dapr.io/getting-started/install-dapr-selfhost/). - [Install Azure Functions Core Tool](https://github.com/Azure/azure-functions-core-tools/blob/master/README.md#windows) -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) # Step 1 - Understand the Settings diff --git a/samples/powershell-azurefunction/README.md b/samples/powershell-azurefunction/README.md index 44341441..3932a089 100644 --- a/samples/powershell-azurefunction/README.md +++ b/samples/powershell-azurefunction/README.md @@ -12,12 +12,7 @@ This sample requires you to have the following installed on your machine: - [Install Azure Functions Core Tool](https://github.com/Azure/azure-functions-core-tools/blob/master/README.md#windows) - [Install Powershell on your machine](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3) - [Install .NET Core SDK](https://dotnet.microsoft.com/download), used for install Dapr Extension for non .NET language -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) # Step 1 - Understand the Settings diff --git a/samples/python-azurefunction/README.md b/samples/python-azurefunction/README.md index 1e46efc7..68667ef0 100644 --- a/samples/python-azurefunction/README.md +++ b/samples/python-azurefunction/README.md @@ -15,12 +15,7 @@ This sample requires you to have the following installed on your machine: - This sample uses Python 3.8. Some nuance or issue is expected if using other version - [Set up Python Environment in Visual Studio Code](https://code.visualstudio.com/docs/python/python-tutorial) - [Install .NET Core SDK](https://dotnet.microsoft.com/download), used for install Dapr Extension for non .NET language -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) # Step 1 - Understand the Settings diff --git a/samples/python-v2-azurefunction/README.md b/samples/python-v2-azurefunction/README.md index 19c2779e..5f4af536 100644 --- a/samples/python-v2-azurefunction/README.md +++ b/samples/python-v2-azurefunction/README.md @@ -14,12 +14,7 @@ This sample requires you to have the following installed on your machine: - This sample uses Python 3.8. Some nuance or issue is expected if using other version - [Set up Python Environment in Visual Studio Code](https://code.visualstudio.com/docs/python/python-tutorial) - [Install .NET Core SDK](https://dotnet.microsoft.com/download), used for install Dapr Extension for non .NET language -- Run Kafka Docker Container locally with below command. - - ``` - cd samples\dapr-kafka - docker-compose -f docker-compose-single-kafka.yml up -d - ``` +- [Run Kafka Docker Container locally](../../samples/dapr-kafka/README.md) # Step 1 - Understand the Settings diff --git a/samples/quickstart/README.md b/samples/quickstart/README.md new file mode 100644 index 00000000..2bb744d8 --- /dev/null +++ b/samples/quickstart/README.md @@ -0,0 +1 @@ +[Follow the instructions here for Quickstart.](../../docs/quickstart.md) \ No newline at end of file