Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions docs/workshop.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,15 @@ azd provision

Refresh your azd environment using the following commands:

<div class="important" data-title="Important">

> - The value of the `AZURE_LOCATION` option should be set depending on where your resources are deployed.
> - If the resources are deployed in East US you should use `eastus`, if they are deployed in East US 2 you should use `eastus2`

</div>

```sh
azd env set AZURE_LOCATION eastus2 -e ignite --no-prompt
azd env set AZURE_LOCATION <YOUR-RESOURCE-LOCATION> -e ignite --no-prompt
azd env refresh -e ignite
```

Expand All @@ -171,7 +178,7 @@ AZURE_PROCESSOR_FUNCTION_APP_NAME="func-drbl-<suffix>"
AUDIOS_EVENTGRID_SYSTEM_TOPIC_NAME="evgt-<suffix>"
AUDIOS_STORAGE_ACCOUNT_CONTAINER_NAME="audios"
AZURE_ENV_NAME="ignite"
AZURE_LOCATION="eastus2"
AZURE_LOCATION="<YOUR-RESOURCE-LOCATION>"
```

Now you can deploy all your Function Apps using the following command:
Expand Down Expand Up @@ -216,6 +223,14 @@ To test the environment setup, we will upload an audio file using the uploader f

</details>

You have 2 options to test the upload of a `.wav` file:
- Using VS Code
- Using Postman

Choose the most convenient one for you.

### Option 1: Upload with VS Code

Inside VS Code, open the `audioupload.http` file located on the root directory, then click on the `Send Request` button.
This will send a request to the uploader function to upload an audio file to the audio's storage account:

Expand All @@ -229,6 +244,26 @@ The following sample audio files are provided in the workshop, so feel free to r
- [Azure Functions](assets/audios/AzureFunctions.wav)
- [Microsoft AI](assets/audios/MicrosoftAI.wav)

Go back to the Storage Account and check the `audios` container. You should see the files that you uploaded with your `AudioUpload` Azure Function!

## Option 2: Upload with Postman

Using [Postman][postman], first go to the Azure Function and inside the function starting with `func-std-`, select `Functions` then `AudioUpload` and select the `Get Function Url` with the `default (function key)`.

![Azure Function url credentials](assets/func-url-credentials.png)

Use this url with Postman to upload the audio file.

You can use the provided sample audio files to test the function:

- [Azure Functions](assets/audios/AzureFunctions.wav)
- [Microsoft AI](assets/audios/MicrosoftAI.wav)

Create a POST request and in the row where you set the key to `audio` for instance then, make sure to select the `file` option in the hidden dropdown menu to be able to select a file in the value field:

![Postman](assets/func-postman.png)

Go back to the Storage Account and check the `audios` container. You should see the files that you uploaded with your `AudioUpload` Azure Function!

## Managed identities and RBAC

Expand Down
14 changes: 7 additions & 7 deletions solutions/processor/Processor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.9.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.11.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.7" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenAI" Version="0.17.0-alpha" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
9 changes: 8 additions & 1 deletion solutions/processor/host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"version": "2.0",
"logging": {
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Information",
"Host.Aggregator": "Information",
"Host.Results": "Information",
"Function": "Information"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
Expand All @@ -9,4 +16,4 @@
"enableLiveMetricsFilters": true
}
}
}
}
12 changes: 6 additions & 6 deletions solutions/uploader/Uploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.9.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.11.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
7 changes: 7 additions & 0 deletions solutions/uploader/host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"version": "2.0",
"logging": {
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Information",
"Host.Aggregator": "Information",
"Host.Results": "Information",
"Function": "Information"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
Expand Down
3 changes: 1 addition & 2 deletions src/processor/AudioTranscriptionOrchestration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ public static async Task<string> CheckTranscriptionStatus([ActivityTrigger] Audi

[Function(nameof(EnrichTranscription))]
public static AudioTranscription EnrichTranscription(
[ActivityTrigger] AudioTranscription audioTranscription, FunctionContext executionContext,
[TextCompletionInput("Summarize {Result}", Model = "%CHAT_MODEL_DEPLOYMENT_NAME%")] TextCompletionResponse response
[ActivityTrigger] AudioTranscription audioTranscription, FunctionContext executionContext
)
{
// TO UPDATE
Expand Down
14 changes: 7 additions & 7 deletions src/processor/Processor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.9.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.11.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.7" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenAI" Version="0.17.0-alpha" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
26 changes: 25 additions & 1 deletion src/processor/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration;

var host = new HostBuilder()
.ConfigureFunctionsWebApplication()
.ConfigureServices(services => {
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
services.Configure<LoggerFilterOptions>(options =>
{
LoggerFilterRule toRemove = options.Rules.FirstOrDefault(rule => rule.ProviderName
== "Microsoft.Extensions.Logging.ApplicationInsights.ApplicationInsightsLoggerProvider");

if (toRemove is not null)
{
options.Rules.Remove(toRemove);
}
});
})
.ConfigureAppConfiguration((hostContext, config) =>
{
config.AddJsonFile("host.json", optional: true);
})
.ConfigureLogging((hostingContext, logging) =>
{
logging.AddApplicationInsights(console =>
{
console.IncludeScopes = true;
});
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
})
.Build();

host.Run();
host.Run();
9 changes: 8 additions & 1 deletion src/processor/host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"version": "2.0",
"logging": {
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Information",
"Host.Aggregator": "Information",
"Host.Results": "Information",
"Function": "Information"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
Expand All @@ -9,4 +16,4 @@
"enableLiveMetricsFilters": true
}
}
}
}
26 changes: 25 additions & 1 deletion src/uploader/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration;

var host = new HostBuilder()
.ConfigureFunctionsWebApplication()
.ConfigureServices(services => {
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
services.Configure<LoggerFilterOptions>(options =>
{
LoggerFilterRule toRemove = options.Rules.FirstOrDefault(rule => rule.ProviderName
== "Microsoft.Extensions.Logging.ApplicationInsights.ApplicationInsightsLoggerProvider");

if (toRemove is not null)
{
options.Rules.Remove(toRemove);
}
});
})
.ConfigureAppConfiguration((hostContext, config) =>
{
config.AddJsonFile("host.json", optional: true);
})
.ConfigureLogging((hostingContext, logging) =>
{
logging.AddApplicationInsights(console =>
{
console.IncludeScopes = true;
});
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
})
.Build();

host.Run();
host.Run();
12 changes: 6 additions & 6 deletions src/uploader/Uploader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.9.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.1" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.CosmosDB" Version="4.11.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs" Version="6.6.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.18.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
Expand Down
7 changes: 7 additions & 0 deletions src/uploader/host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"version": "2.0",
"logging": {
"fileLoggingMode": "debugOnly",
"logLevel": {
"default": "Information",
"Host.Aggregator": "Information",
"Host.Results": "Information",
"Function": "Information"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
Expand Down