Skip to content

Commit baf83ec

Browse files
seantleonardneeraj-sharma2592abhishekkumams
authored
[CherryPick] Upgrade dependencies, pipeline tasks, pipeline variables #1970 #1955 #1928 #1954 (#1992)
#1970 #1955 #1928 #1954 Updates dependencies: - Microsoft.AspNetCore.Authentication.JwtBearer - Microsoft.Data.SqlClient - Microsoft.IdentityModel.JsonWebTokens - System.IdentityModel.Tokens.Jwt Update pipeline task: - `NuGetAuthenticate@0` to `NuGetAuthenticate@1` - LocalDB connection string default set instead of depending on private env_var. - Auto generate db passwords and append to connection strings during each pipeline run Other changes to support the changes above: - Suppress NU1603 warning as error for all projects - Update ConfigurationTests jwt token creation to handle breaking changes in newer versions of Jwt* dependencies. All related to pipeline updates that are required for 0.10 stable. --------- Co-authored-by: neeraj-sharma2592 <[email protected]> Co-authored-by: Abhishek Kumar <[email protected]>
1 parent 40dab94 commit baf83ec

17 files changed

+53
-19
lines changed

.pipelines/cosmos-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ steps:
3838
Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
3939
Start-CosmosDbEmulator
4040
41-
- task: NuGetAuthenticate@0
41+
- task: NuGetAuthenticate@1
4242
displayName: 'NuGet Authenticate'
4343

4444
- task: UseDotNet@2

.pipelines/dwsql-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
data-source.connection-string: ''
2929

3030
steps:
31-
- task: NuGetAuthenticate@0
31+
- task: NuGetAuthenticate@1
3232
displayName: 'NuGet Authenticate'
3333

3434
- task: UseDotNet@2
@@ -147,7 +147,7 @@ jobs:
147147
# since windows needs a different string.
148148
# The variable setting on the pipeline UI sets the connection string
149149
# for the linux job above.
150-
data-source.connection-string: $(ConnectionStringLocalDBVariable)
150+
data-source.connection-string: Server=(localdb)\MSSQLLocalDB;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;
151151
InstallerUrl: https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SqlLocalDB.msi
152152
SqlVersionCode: '15.0'
153153

@@ -158,7 +158,7 @@ jobs:
158158
inputs:
159159
script: 'echo ##vso[task.setvariable variable=publishverify]Yes'
160160

161-
- task: NuGetAuthenticate@0
161+
- task: NuGetAuthenticate@1
162162
displayName: 'NuGet Authenticate'
163163

164164
- task: UseDotNet@2

.pipelines/mssql-pipelines.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# MsSql Integration Testing Pipeline config is split into two jobs:
55
# 1) LinuxTests -> Run SQL Server 2019 in Linux Docker Image
6-
# 2) WindowsTests -> Run LocalDB preinstalled on
6+
# 2) WindowsTests -> Run LocalDB preinstalled on machine
77

88
trigger:
99
batch: true
@@ -24,9 +24,11 @@ jobs:
2424
solution: '**/*.sln'
2525
buildPlatform: 'Any CPU'
2626
buildConfiguration: 'Release'
27+
dbPassword: ''
28+
data-source.connection-string: ''
2729

2830
steps:
29-
- task: NuGetAuthenticate@0
31+
- task: NuGetAuthenticate@1
3032
displayName: 'NuGet Authenticate'
3133

3234
- task: UseDotNet@2
@@ -50,12 +52,31 @@ jobs:
5052
dockerVersion: 17.09.0-ce
5153
releaseType: stable
5254

55+
- task: Bash@3
56+
displayName: 'Generate password'
57+
inputs:
58+
targetType: 'inline'
59+
script: |
60+
password=$(cat /dev/urandom | tr -dc 'A-Za-z0-9' | head -c24)
61+
echo "##vso[task.setvariable variable=dbPassword;]$password"
62+
63+
- task: PowerShell@2
64+
displayName: 'Set Connection String'
65+
inputs:
66+
targetType: 'inline'
67+
script: |
68+
$connectionString="Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=SA;Password=$(dbPassword);MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;Encrypt=False;"
69+
Write-Host "##vso[task.setvariable variable=data-source.connection-string]$connectionString"
70+
5371
- task: Bash@3
5472
condition: eq( variables['Agent.OS'], 'Linux' )
5573
displayName: Get and Start Ubuntu SQL Server Image Docker with SSL enabled
5674
inputs:
57-
filePath: scripts/start-mssql-server.bash
58-
arguments: $(DockerSQLPass)
75+
targetType: 'inline'
76+
script: |
77+
echo "Executing script with arguments."
78+
chmod +x ./scripts/start-mssql-server.bash
79+
./scripts/start-mssql-server.bash $(dbPassword)
5980
6081
- task: DotNetCoreCLI@2
6182
displayName: Build
@@ -129,7 +150,7 @@ jobs:
129150
# since windows needs a different string.
130151
# The variable setting on the pipeline UI sets the connection string
131152
# for the linux job above.
132-
data-source.connection-string: $(ConnectionStringLocalDBVariable)
153+
data-source.connection-string: Server=(localdb)\MSSQLLocalDB;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;
133154
InstallerUrl: https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SqlLocalDB.msi
134155
SqlVersionCode: '15.0'
135156

@@ -140,7 +161,7 @@ jobs:
140161
inputs:
141162
script: 'echo ##vso[task.setvariable variable=publishverify]Yes'
142163

143-
- task: NuGetAuthenticate@0
164+
- task: NuGetAuthenticate@1
144165
displayName: 'NuGet Authenticate'
145166

146167
- task: UseDotNet@2
@@ -233,4 +254,4 @@ jobs:
233254
inputs:
234255
PathtoPublish: '$(Build.ArtifactStagingDirectory)\Verify'
235256
ArtifactName: 'Verify'
236-
publishLocation: 'Container'
257+
publishLocation: 'Container'

.pipelines/mysql-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
buildConfiguration: 'Release'
2525

2626
steps:
27-
- task: NuGetAuthenticate@0
27+
- task: NuGetAuthenticate@1
2828
displayName: 'NuGet Authenticate'
2929

3030
- task: UseDotNet@2

.pipelines/pg-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
buildConfiguration: 'Release'
2020

2121
steps:
22-
- task: NuGetAuthenticate@0
22+
- task: NuGetAuthenticate@1
2323
displayName: 'NuGet Authenticate'
2424

2525
- task: UseDotNet@2

.pipelines/templates/static-tools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
vmImage: '${{ parameters.VmImage }}'
1515

1616
steps:
17-
- task: NuGetAuthenticate@0
17+
- task: NuGetAuthenticate@1
1818
displayName: 'NuGet Authenticate'
1919

2020
- checkout: self # self represents the repo where the initial Pipelines YAML file was found

src/Auth/Azure.DataApiBuilder.Auth.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<OutputPath>$(BaseOutputPath)\engine</OutputPath>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

src/Cli.Tests/Cli.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
<OutputPath>$(BaseOutputPath)\tests</OutputPath>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<ItemGroup>

src/Cli/Cli.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
</Dependencies>
2929
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3030
<PublishRepositoryUrl>true</PublishRepositoryUrl>
31+
<NoWarn>NU1603</NoWarn>
3132
</PropertyGroup>
3233

3334
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">

src/Config/Azure.DataApiBuilder.Config.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<OutputPath>$(BaseOutputPath)\engine</OutputPath>
88
<EmbedUntrackedSources>true</EmbedUntrackedSources>
9+
<NoWarn>NU1603</NoWarn>
910
</PropertyGroup>
1011

1112
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
@@ -18,6 +19,8 @@
1819
<PackageReference Include="System.IO.Abstractions" />
1920
<PackageReference Include="System.Drawing.Common" />
2021
<PackageReference Include="Microsoft.Data.SqlClient" />
22+
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" />
23+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
2124
<PackageReference Include="StyleCop.Analyzers">
2225
<PrivateAssets>all</PrivateAssets>
2326
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)