Skip to content

Commit d88af24

Browse files
#36 run local
1 parent 2c59d97 commit d88af24

File tree

9 files changed

+29
-13
lines changed

9 files changed

+29
-13
lines changed

documentation/setup.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ The following is a summary of all Azure resources required to deploy the solutio
103103

104104
## Provision
105105

106-
There are 3 ways to provision the required resources:
106+
There are 4 ways to provision the required resources:
107107

108108
- [Manual via the Portal](#manual-via-the-portal)
109109
- [ARM Template](#deploy-from-arm-template)
110110
- [Cake](#cake-provision)
111+
- [Bicep](#deploy-from-bicep) (recommended)
111112

112113
### Manual via the Portal
113114

dotnet/ServerlessMicroservices.FunctionApp.Drivers/ServerlessMicroservices.FunctionApp.Drivers.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
8-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />
9-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
7+
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />-->
8+
<!--<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />-->
9+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
1010
</ItemGroup>
1111
<ItemGroup>
1212
<ProjectReference Include="..\ServerlessMicroservices.Models\ServerlessMicroservices.Models.csproj" />
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
{
2+
"version": "2.0"
23
}

dotnet/ServerlessMicroservices.FunctionApp.Orchestrators/ServerlessMicroservices.FunctionApp.Orchestrators.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.6.0" />
8-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />
98
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.0" />
10-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
9+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
1110
</ItemGroup>
1211
<ItemGroup>
1312
<None Update="host.json">

dotnet/ServerlessMicroservices.FunctionApp.Passengers/ServerlessMicroservices.FunctionApp.Passengers.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
8-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />
9-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
108
</ItemGroup>
119
<ItemGroup>
1210
<ProjectReference Include="..\ServerlessMicroservices.Models\ServerlessMicroservices.Models.csproj" />

dotnet/ServerlessMicroservices.FunctionApp.Trips/ServerlessMicroservices.FunctionApp.Trips.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="3.0.0" />
88
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.SignalRService" Version="1.6.0" />
99
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.0" />
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
11-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.12" />
12-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
10+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
1311
</ItemGroup>
1412
<ItemGroup>
1513
<ProjectReference Include="..\ServerlessMicroservices.Models\ServerlessMicroservices.Models.csproj" />

dotnet/ServerlessMicroservices.Shared/Services/LoggerService.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ private TelemetryClient GetAppInsightsClient()
4242
if (_appInsightsClient == null)
4343
{
4444
_appInsightsClient = new TelemetryClient();
45-
_appInsightsClient.InstrumentationKey = _settingService.GetInsightsInstrumentationKey();
45+
string key = _settingService.GetInsightsInstrumentationKey();
46+
47+
// It is possible to create a Telemetry client without an iKey. But trying to set this property to null will throw a null argument exception
48+
if (!string.IsNullOrEmpty(key)) _appInsightsClient.InstrumentationKey = key;
4649
}
4750

4851
return _appInsightsClient;

scripts/run-local.ps1

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
try {
4+
# cd /dotnet
5+
Push-Location ( Join-Path $PSScriptRoot ../dotnet ) -StackName scripts
6+
7+
# Start each Function in a new console
8+
Push-Location ServerlessMicroservices.FunctionApp.Drivers
9+
Start-Process pwsh { -c func start --csharp }
10+
11+
}
12+
finally {
13+
Pop-Location -StackName scripts
14+
}

test/local.http

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Uses REST Client extension https://marketplace.visualstudio.com/items?itemName=humao.rest-client
2+
GET http://localhost:7071/api/activedrivers

0 commit comments

Comments
 (0)