Skip to content

Commit

Permalink
Update functions to 3.0 (#4910)
Browse files Browse the repository at this point in the history
This reverts commit 3ab67a3.
Filters out bin folder when running tests to fix the tests failure issue. It's not clear why only in some runs the bin folder has the test dlls and not the runtimeconfig.json files which is causing the tests run to fail. Other times it was passing because the bin folder didn't contain the test dlls when running on different pipeline agent (but using same dotnet sdk and everything else looked the same)
  • Loading branch information
ancaantochi authored May 7, 2021
1 parent 5421f9e commit 124a20c
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 21 deletions.
1 change: 1 addition & 0 deletions CodeCoverage.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Included items must then not match any entries in the exclude list to remain inc
<ModulePath>.*testanalyzer\..*</ModulePath>
<ModulePath>.*testresultcoordinator\..*</ModulePath>
<ModulePath>.*twintester\..*</ModulePath>
<ModulePath>.*microsoft.azure.webjobs.*</ModulePath>
</Exclude>
</ModulePaths>

Expand Down
1 change: 0 additions & 1 deletion builds/checkin/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
pool:
vmImage: "ubuntu-18.04"
steps:
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- task: Bash@3
displayName: Install Prerequisites
Expand Down
1 change: 0 additions & 1 deletion builds/ci/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
IotDevice3ConnStr2,
IotHubConnStr2,
IotHubMqttHeadCert
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- task: Bash@3
displayName: Install Prerequisites
Expand Down
1 change: 0 additions & 1 deletion builds/misc/images-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
docker login '$(build.registry.address)' --username '$(build.registry.user)' --password '$(build.registry.password)'
docker login '$(registry.address)' --username '$(registry.user)' --password '$(registry.password)'
displayName: 'Docker Login'
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- template: ../templates/dotnet3-globaljson.yaml # use dotnet 3 as primary install for build
# Build
Expand Down
1 change: 0 additions & 1 deletion builds/misc/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
pool:
vmImage: 'ubuntu-18.04'
steps:
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml

- bash: 'docker login $(registry.address) --username $(registry.user) --password $(registry.password)'
Expand Down
6 changes: 0 additions & 6 deletions builds/templates/install-dotnet2.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="..\..\..\..\netcoreappVersion.props" />

<PropertyGroup>
<AzureFunctionsVersion></AzureFunctionsVersion>
Expand All @@ -21,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.26" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions edge-modules/functions/samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Azure functions module for IoT Edge
This is a sample on how to use EdgeHub binding for Azure functions in an IoT Edge module.
It contains a C# function that gets triggered when a message is received from EdgeHub and also contains docker files needed to build the module image.

Current version is based on Azure functions runtime 3.0 which has a larger docker image size compared to previous version. If image size is a concern older version of EdgeHub binding (<=1.0.7) has to be used which is based on Azure functions 2.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/azure-functions/dotnet:2.0-iot-edge
FROM mcr.microsoft.com/azure-functions/dotnet:3.0

ENV AzureWebJobsScriptRoot=/app

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/azure-functions/dotnet:2.0-arm32v7
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-arm32v7

ENV AzureWebJobsScriptRoot=/app

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# escape=`

FROM mcr.microsoft.com/azure-functions/dotnet:2.0-nanoserver-1809
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-nanoserver-1809

COPY . /approot
2 changes: 1 addition & 1 deletion scripts/linux/buildBranch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ publish_app "MetricsValidator"
publish_app "NumberLogger"
publish_app "CloudToDeviceMessageTester"
publish_app "IotedgeDiagnosticsDotnet"
publish_app "EdgeHubTriggerCSharp"

publish_lib "EdgeHubTriggerCSharp"
publish_lib "Microsoft.Azure.WebJobs.Extensions.EdgeHub"

publish_files $SRC_SCRIPTS_DIR $PUBLISH_FOLDER
Expand Down
2 changes: 1 addition & 1 deletion scripts/linux/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ while read testDll; do
else
testProjectDlls="$testProjectDlls $testDll"
fi
done < <(find $OUTPUT_FOLDER -type f -iname $SUFFIX)
done < <(find $OUTPUT_FOLDER -type f -iname $SUFFIX -not -path "$OUTPUT_FOLDER/bin/*")

testCommandPrefix="$DOTNET_ROOT_PATH/dotnet vstest /Logger:trx;LogFileName=result.trx /TestAdapterPath:\"$OUTPUT_FOLDER\" /Parallel /InIsolation"
if [ ! -z "$testFilterValue" ]
Expand Down
3 changes: 1 addition & 2 deletions test/Microsoft.Azure.Devices.Edge.Test/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public async Task TempFilter()
TempFilterToCloud = $"FROM /messages/modules/{filterName}/outputs/alertOutput INTO $upstream",
TempSensorToTempFilter = $"FROM /messages/modules/{SensorName}/outputs/temperatureOutput INTO BrokeredEndpoint('/modules/{filterName}/inputs/input1')"
}
} );
});
},
token,
Context.Current.NestedEdge);
Expand All @@ -116,7 +116,6 @@ public async Task TempFilter()
}

[Test]
[Category("Unstable")]
// Test Temperature Filter Function: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-function
public async Task TempFilterFunc()
{
Expand Down

0 comments on commit 124a20c

Please sign in to comment.