Skip to content

Commit

Permalink
Make it easy to run StartTranscription function locally for developme…
Browse files Browse the repository at this point in the history
…nt. (#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 <[email protected]>
  • Loading branch information
superhindupur and HenryvanderVegte authored Jun 12, 2024
1 parent a1ceb33 commit 9604d61
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
12 changes: 12 additions & 0 deletions samples/ingestion/ingestion-client/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions samples/ingestion/ingestion-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode
local.settings.json
Original file line number Diff line number Diff line change
@@ -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 <function app name>
```

Note: Replace `<function app name>` 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
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

0 comments on commit 9604d61

Please sign in to comment.