Skip to content

Commit 13ca2f3

Browse files
committed
Downgrade .NET project
1 parent c88a86c commit 13ca2f3

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

.github/workflows/main.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v3
2121
with:
22-
dotnet-version: '8.0.x'
22+
dotnet-version: '7.0.x'
2323

2424
- name: .NET Restore
2525
run: dotnet restore SampleApp/WebApp.csproj
@@ -181,8 +181,7 @@ jobs:
181181
async function createSP() {
182182
const { CosmosClient } = require("@azure/cosmos");
183183
const cosmosClient = new CosmosClient({
184-
endpoint: '${{ steps.arm_deployment.outputs.cosmosDBendpoint }}',
185-
key: '${{ steps.arm_deployment.outputs.cosmosDBkey }}'
184+
'${{ steps.arm_deployment.outputs.cosmosDBConnectionString }}'
186185
});
187186
const { database } = await cosmosClient.databases.createIfNotExists({ id: 'SampleDatabase' });
188187
const { container } = await database.containers.createIfNotExists({ id: 'SampleContainer' });
@@ -213,8 +212,7 @@ jobs:
213212
async function createTrigger() {
214213
const { CosmosClient } = require("@azure/cosmos");
215214
const cosmosClient = new CosmosClient({
216-
endpoint: '${{ steps.arm_deployment.outputs.cosmosDBendpoint }}',
217-
key: '${{ steps.arm_deployment.outputs.cosmosDBkey }}'
215+
'${{ steps.arm_deployment.outputs.cosmosDBConnectionString }}'
218216
});
219217
const { database } = await cosmosClient.databases.createIfNotExists({ id: 'SampleDatabase' });
220218
const { container } = await database.containers.createIfNotExists({ id: 'SampleContainer' });
@@ -296,8 +294,7 @@ jobs:
296294
async function createSP() {
297295
const { CosmosClient } = require("@azure/cosmos");
298296
const cosmosClient = new CosmosClient({
299-
endpoint: '${{ steps.arm_deployment.outputs.cosmosDBendpoint }}',
300-
key: '${{ steps.arm_deployment.outputs.cosmosDBkey }}'
297+
'${{ steps.arm_deployment.outputs.cosmosDBConnectionString }}'
301298
});
302299
const { database } = await cosmosClient.databases.createIfNotExists({ id: 'SampleDatabase' });
303300
const { container } = await database.containers.createIfNotExists({ id: 'SampleContainer' });
@@ -324,9 +321,8 @@ jobs:
324321
async function createTrigger() {
325322
const { CosmosClient } = require("@azure/cosmos");
326323
const cosmosClient = new CosmosClient({
327-
endpoint: '${{ steps.arm_deployment.outputs.cosmosDBendpoint }}',
328-
key: '${{ steps.arm_deployment.outputs.cosmosDBkey }}'
329-
});
324+
'${{ steps.arm_deployment.outputs.cosmosDBConnectionString }}'
325+
});
330326
const { database } = await cosmosClient.databases.createIfNotExists({ id: 'SampleDatabase' });
331327
const { container } = await database.containers.createIfNotExists({ id: 'SampleContainer' });
332328
const { sampleTrigger } = require('./Triggers/SampleTrigger.js')

IaC/cosmosdb.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,9 @@
8282
],
8383
"outputs":
8484
{
85-
"cosmosDBendpoint": {
86-
"type": "string",
87-
"value": "[concat('https://', variables('cosmosAccountName'),'.documents.azure.com:443')]"
88-
},
89-
"cosmosDBkey": {
85+
"cosmosDBConnectionString": {
9086
"type": "securestring",
91-
"value": "[listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosAccountName')), '2022-05-15').primaryMasterKey]"
87+
"value": "[concat('AccountEndpoint=', reference(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosAccountName'))).documentEndpoint, ';AccountKey=', listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosAccountName')), '2022-05-15').primaryMasterKey, ';')]"
9288
},
9389
"webAppName": {
9490
"type": "string",

SampleApp/WebApp.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<UserSecretsId>a0bb1cc8-34a4-4371-a3ab-133ee73819c5</UserSecretsId>
@@ -10,13 +10,13 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="8.0.0-preview.7.23375.4" />
14-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0-preview.7.23375.4">
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="7.0.10" />
14+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.10">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>
1818
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
19-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0-preview.7.23408.2" />
19+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.9" />
2020
</ItemGroup>
2121

2222
</Project>

0 commit comments

Comments
 (0)