Skip to content

Commit f85582f

Browse files
committed
update fsharp template
1 parent 39be38e commit f85582f

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

content/dotnet-template-azure-iot-edge-module/FSharp/Dockerfile.amd64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
22
WORKDIR /app
33

44
COPY *.fsproj ./
@@ -7,7 +7,7 @@ RUN dotnet restore
77
COPY . ./
88
RUN dotnet publish -c Release -o out
99

10-
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim
10+
FROM mcr.microsoft.com/dotnet/runtime:6.0
1111
WORKDIR /app
1212
COPY --from=build-env /app/out ./
1313

content/dotnet-template-azure-iot-edge-module/FSharp/Dockerfile.amd64.debug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
1+
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends unzip procps && \
@@ -8,7 +8,7 @@ RUN useradd -ms /bin/bash moduleuser
88
USER moduleuser
99
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
1010

11-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
11+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
1212
WORKDIR /app
1313

1414
COPY *.fsproj ./

content/dotnet-template-azure-iot-edge-module/FSharp/Dockerfile.arm32v7

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm32v7 AS build-env
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim-arm32v7 AS build-env
22
WORKDIR /app
33

44
COPY *.fsproj ./
@@ -7,7 +7,7 @@ RUN dotnet restore
77
COPY . ./
88
RUN dotnet publish -c Release -o out
99

10-
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7
10+
FROM mcr.microsoft.com/dotnet/runtime:6.0-bullseye-slim-arm32v7
1111
WORKDIR /app
1212
COPY --from=build-env /app/out ./
1313

content/dotnet-template-azure-iot-edge-module/FSharp/Dockerfile.arm32v7.debug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7 AS base
1+
FROM mcr.microsoft.com/dotnet/runtime:6.0-bullseye-slim-arm32v7 AS base
22

33
RUN apt-get update && \
44
apt-get install -y --no-install-recommends unzip procps && \
@@ -8,7 +8,7 @@ RUN useradd -ms /bin/bash moduleuser
88
USER moduleuser
99
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
1010

11-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm32v7 AS build-env
11+
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim-arm32v7 AS build-env
1212
WORKDIR /app
1313

1414
COPY *.fsproj ./

content/dotnet-template-azure-iot-edge-module/FSharp/Dockerfile.arm64v8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster-arm64v8 AS build-env
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim-arm64v8 AS build-env
22
WORKDIR /app
33

44
COPY *.fsproj ./
@@ -7,7 +7,7 @@ RUN dotnet restore
77
COPY . ./
88
RUN dotnet publish -c Release -o out
99

10-
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm64v8
10+
FROM mcr.microsoft.com/dotnet/runtime:6.0-bullseye-slim-arm64v8
1111
WORKDIR /app
1212
COPY --from=build-env /app/out ./
1313

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1809 AS build-env
1+
FROM mcr.microsoft.com/dotnet/sdk:6.0-nanoserver-ltsc2022 AS build-env
22
WORKDIR /app
33

44
COPY *.fsproj ./
@@ -7,7 +7,7 @@ RUN dotnet restore
77
COPY . ./
88
RUN dotnet publish -c Release -o out
99

10-
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-1809
10+
FROM mcr.microsoft.com/dotnet/runtime:6.0-nanoserver-ltsc2022
1111
WORKDIR /app
1212
COPY --from=build-env /app/out ./
1313
ENTRYPOINT ["dotnet", "SampleModule.dll"]

content/dotnet-template-azure-iot-edge-module/FSharp/Program.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ module SampleModule =
2020
let PipeMessage (message:Message) (userContext:obj) =
2121
let counterValue = Interlocked.Increment(counter)
2222

23-
let deviceClient = userContext :?> DeviceClient
24-
if (isNull(deviceClient)) then
23+
let moduleClient = userContext :?> ModuleClient
24+
if (isNull(moduleClient)) then
2525
raise (InvalidOperationException("UserContext doesn't contain " + "expected values"))
2626

2727
let messageBytes = message.GetBytes()
@@ -34,7 +34,7 @@ module SampleModule =
3434
message.Properties
3535
|> Seq.iter (fun prop -> pipeMessage.Properties.Add(prop.Key, prop.Value))
3636

37-
deviceClient.SendEventAsync("output1", pipeMessage)
37+
moduleClient.SendEventAsync("output1", pipeMessage)
3838
|> Async.AwaitTask
3939
|> Async.Start
4040

@@ -55,7 +55,7 @@ module SampleModule =
5555

5656
// Open a connection to the Edge runtime
5757
let ioTHubModuleClient =
58-
DeviceClient.CreateFromConnectionString(connectionString, settings)
58+
ModuleClient.CreateFromConnectionString(connectionString, settings)
5959

6060
ioTHubModuleClient.OpenAsync()
6161
|> Async.AwaitTask
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66
<ItemGroup>
77
<Compile Include="Program.fs" />
88
</ItemGroup>
99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.6.0-preview-001" />
11-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0-preview2-final" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0-preview2-final" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.0.0-preview2-final" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0-preview2-final" />
15-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.0.0-preview2-final" />
16-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0-preview2-final" />
10+
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.*" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.*" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.*" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.*" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.*" />
15+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.*" />
16+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.*" />
1717
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
1818
</ItemGroup>
1919
</Project>

0 commit comments

Comments
 (0)