From 9604d61b0201aa8ed22de2277ad0a85b497ced0a Mon Sep 17 00:00:00 2001 From: Bhavana Hindupur Date: Wed, 12 Jun 2024 12:43:08 +0100 Subject: [PATCH] Make it easy to run StartTranscription function locally for development. (#2412) * Make it easy to run StartTranscription function locally for development. * use spaces instead of tabs in text file --------- Co-authored-by: Henry van der Vegte --- .../.devcontainer/devcontainer.json | 9 +++++++ .../ingestion-client/.github/dependabot.yml | 12 +++++++++ samples/ingestion/ingestion-client/.gitignore | 2 ++ .../StartTranscriptionByTimer/README.md | 25 +++++++++++++++++++ .../StartTranscriptionByTimer.csproj | 5 ++++ 5 files changed, 53 insertions(+) create mode 100644 samples/ingestion/ingestion-client/.devcontainer/devcontainer.json create mode 100644 samples/ingestion/ingestion-client/.github/dependabot.yml create mode 100644 samples/ingestion/ingestion-client/.gitignore create mode 100644 samples/ingestion/ingestion-client/StartTranscriptionByTimer/README.md diff --git a/samples/ingestion/ingestion-client/.devcontainer/devcontainer.json b/samples/ingestion/ingestion-client/.devcontainer/devcontainer.json new file mode 100644 index 000000000..b4b26ff8a --- /dev/null +++ b/samples/ingestion/ingestion-client/.devcontainer/devcontainer.json @@ -0,0 +1,9 @@ +{ + "name": "C# (.NET)", + "image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm", + "features": { + "ghcr.io/devcontainers/features/azure-cli:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/jlaundry/devcontainer-features/azure-functions-core-tools:1": {} + } +} diff --git a/samples/ingestion/ingestion-client/.github/dependabot.yml b/samples/ingestion/ingestion-client/.github/dependabot.yml new file mode 100644 index 000000000..f33a02cd1 --- /dev/null +++ b/samples/ingestion/ingestion-client/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/samples/ingestion/ingestion-client/.gitignore b/samples/ingestion/ingestion-client/.gitignore new file mode 100644 index 000000000..52082f19a --- /dev/null +++ b/samples/ingestion/ingestion-client/.gitignore @@ -0,0 +1,2 @@ +.vscode +local.settings.json \ No newline at end of file diff --git a/samples/ingestion/ingestion-client/StartTranscriptionByTimer/README.md b/samples/ingestion/ingestion-client/StartTranscriptionByTimer/README.md new file mode 100644 index 000000000..2b6c7e69c --- /dev/null +++ b/samples/ingestion/ingestion-client/StartTranscriptionByTimer/README.md @@ -0,0 +1,25 @@ +# Local development instructions + +Pre-requisites: +1. Please follow the instructions on [the main guide](./../Setup/guide.md#ingestion-client-setup-instructions) to deploy the Ingestion Client and associated ecosystem to Azure. +2. Reopen the project within a [devcontainer](https://containers.dev/overview). (The devcontainer settings at the root of the project have the tools needed to develop and run this function locally) + +To run the StartTranscriptionByTimer function locally, do the following: + +1. Run the following command to fetch your Azure Function app settings and save them to local.settings.json: + +``` +func azure functionapp fetch-app-settings +``` + +Note: Replace `` with the actual name of your function app that you can get from the Azure Portal. It will look like `StartTranscriptionFunction-20240531T092901Z`. + +2. In the local.settings.json file, replace the value of the `AzureSpeechServicesKey` with the actual key for your Azure Speech Service instance. You can get this from the Azure portal. + +3. Navigate to the StartTranscription function running on your Azure via the portal, and click on Stop. You need to do this so that you don't have two instances of the StartTranscription function running and listening to the same events when you start the function from your local machine in the next step. + +4. Run the following command to start the local function (this will apply your local code changes): + +``` +func start +``` \ No newline at end of file diff --git a/samples/ingestion/ingestion-client/StartTranscriptionByTimer/StartTranscriptionByTimer.csproj b/samples/ingestion/ingestion-client/StartTranscriptionByTimer/StartTranscriptionByTimer.csproj index 1c56e75de..1c617356e 100644 --- a/samples/ingestion/ingestion-client/StartTranscriptionByTimer/StartTranscriptionByTimer.csproj +++ b/samples/ingestion/ingestion-client/StartTranscriptionByTimer/StartTranscriptionByTimer.csproj @@ -15,4 +15,9 @@ PreserveNewest + + + PreserveNewest + + \ No newline at end of file