Skip to content

Commit

Permalink
Update functions to 3.0 (Azure#4910) (Azure#5060)
Browse files Browse the repository at this point in the history
* Update functions to 3.0 (Azure#4910)

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)

* fix build

* remove dotnet2 for windows build
  • Loading branch information
ancaantochi committed Jun 25, 2021
1 parent acc3e1f commit 0d18c66
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions CodeCoverage.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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
2 changes: 0 additions & 2 deletions builds/checkin/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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 Expand Up @@ -64,7 +63,6 @@ jobs:
pool:
vmImage: "vs2017-win2016"
steps:
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- task: PowerShell@2
displayName: Build
Expand Down
2 changes: 0 additions & 2 deletions 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 Expand Up @@ -107,7 +106,6 @@ jobs:
IotDevice3ConnStr2,
IotHubConnStr2,
IotHubMqttHeadCert
- template: ../templates/install-dotnet2.yaml
- template: ../templates/install-dotnet3.yaml
- powershell: scripts/windows/build/Publish-Branch.ps1 -Configuration $(Build.Configuration) -UpdateVersion
displayName: Build
Expand Down
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 @@ -247,8 +247,8 @@ publish_app "NumberLogger"
publish_app "CloudToDeviceMessageTester"
publish_app "IotedgeDiagnosticsDotnet"
publish_app "Microsoft.Azure.Devices.Edge.Azure.Monitor"
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
2 changes: 1 addition & 1 deletion scripts/windows/build/Publish-Branch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ $appProjectList.Add("NumberLogger.csproj")
$appProjectList.Add("CloudToDeviceMessageTester.csproj")
$appProjectList.Add("IotedgeDiagnosticsDotnet.csproj")
$appProjectList.Add("Microsoft.Azure.Devices.Edge.Azure.Monitor.csproj")
$appProjectList.Add("EdgeHubTriggerCSharp.csproj")

# Download latest rocksdb ARM32 library
$rocksdbARMUri = "https://edgebuild.blob.core.windows.net/rocksdb/rocksdb-arm.dll"
Expand Down Expand Up @@ -194,7 +195,6 @@ Write-Host "`nPublishing .NET Core libs`n"

$libProjectList = New-Object 'System.Collections.Generic.List[String]'
$libProjectList.Add("Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj")
$libProjectList.Add("EdgeHubTriggerCSharp.csproj")

foreach ($libProjectFileName in $libProjectList) {
$libProjectFilePath = Get-ChildItem -Include *.csproj -File -Recurse |Where-Object {$_.Name -eq "$libProjectFileName"}|Select-Object -first 1|Select -ExpandProperty "FullName"
Expand Down

0 comments on commit 0d18c66

Please sign in to comment.