diff --git a/src/FeedGenerator/FeedGenerator.csproj b/src/FeedGenerator/FeedGenerator.csproj index 64764e94..4057bee8 100644 --- a/src/FeedGenerator/FeedGenerator.csproj +++ b/src/FeedGenerator/FeedGenerator.csproj @@ -13,6 +13,6 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Octokit" Version="4.0.3" /> + <PackageReference Include="Octokit" Version="13.0.1" /> </ItemGroup> </Project> diff --git a/src/Web/Models/ErrorEntity.cs b/src/Web/Models/ErrorEntity.cs index f305a4ac..450bbbf0 100644 --- a/src/Web/Models/ErrorEntity.cs +++ b/src/Web/Models/ErrorEntity.cs @@ -1,11 +1,12 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace WixToolset.Web.Models { using System; - using Microsoft.WindowsAzure.Storage.Table; + using Azure; + using Azure.Data.Tables; - public class ErrorEntity : TableEntity + public class ErrorEntity : ITableEntity { public ErrorEntity() { @@ -17,6 +18,14 @@ public ErrorEntity(string site, string key = null) this.RowKey = key ?? DateTime.UtcNow.ToString("yyyy-MM-ddTHH-mm-ss-ffff") + "-" + Guid.NewGuid().ToString("N"); } + public string PartitionKey { get; set; } + + public string RowKey { get; set; } + + public ETag ETag { get; set; } = ETag.All; + + public DateTimeOffset? Timestamp { get; set; } + public int StatusCode { get; set; } public string IP { get; set; } @@ -31,4 +40,4 @@ public ErrorEntity(string site, string key = null) public string Text { get; set; } } -} \ No newline at end of file +} diff --git a/src/Web/Models/VisitEntity.cs b/src/Web/Models/VisitEntity.cs index e8ce2336..366fccd0 100644 --- a/src/Web/Models/VisitEntity.cs +++ b/src/Web/Models/VisitEntity.cs @@ -1,11 +1,12 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace WixToolset.Web.Models { using System; - using Microsoft.WindowsAzure.Storage.Table; + using Azure; + using Azure.Data.Tables; - public class VisitEntity : TableEntity + public class VisitEntity : ITableEntity { public VisitEntity() { @@ -19,6 +20,14 @@ public VisitEntity(string site, string purpose, string key = null) this.Purpose = purpose; } + public string PartitionKey { get; set; } + + public string RowKey { get; set; } + + public ETag ETag { get; set; } = ETag.All; + + public DateTimeOffset? Timestamp { get; set; } + public string Method { get; set; } public string IP { get; set; } diff --git a/src/Web/Services/StorageService.cs b/src/Web/Services/StorageService.cs index 283c474f..7b426f7c 100644 --- a/src/Web/Services/StorageService.cs +++ b/src/Web/Services/StorageService.cs @@ -1,12 +1,11 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace WixToolset.Web.Services { using System; using System.Diagnostics; using System.Threading.Tasks; - using Microsoft.WindowsAzure.Storage; - using Microsoft.WindowsAzure.Storage.Table; + using Azure.Data.Tables; using WixToolset.Web.Models; public class StorageService : IStorageService @@ -18,10 +17,10 @@ public StorageService(string connectionString) throw new ArgumentNullException(nameof(connectionString)); } - this.Storage = CloudStorageAccount.Parse(connectionString); + this.Storage = new TableServiceClient(connectionString); } - private CloudStorageAccount Storage { get; } + private TableServiceClient Storage { get; } public async Task LogErrorAsync(int code, string ip, string page, string referrer, Exception exception) { @@ -47,15 +46,11 @@ public async Task WriteToTableStorage(string tableName, ITableEntity entity) { try { - var op = TableOperation.Insert(entity); - - var client = this.Storage.CreateCloudTableClient(); - - var table = client.GetTableReference(tableName); + var table = this.Storage.GetTableClient(tableName); await table.CreateIfNotExistsAsync(); - await table.ExecuteAsync(op); + await table.AddEntityAsync(entity); } catch (Exception e) { diff --git a/src/Web/Web.csproj b/src/Web/Web.csproj index ce513dc6..17db233d 100644 --- a/src/Web/Web.csproj +++ b/src/Web/Web.csproj @@ -1,14 +1,15 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net6.0</TargetFramework> </PropertyGroup> <ItemGroup> - <PackageReference Include="WindowsAzure.Storage" Version="8.1.4" /> + <PackageReference Include="Azure.Data.Tables" Version="12.9.1" /> + <PackageReference Include="System.Text.Json" Version="6.0.11" /> </ItemGroup> <ItemGroup> - <PackageReference Include="Nerdbank.GitVersioning" Version="3.4.194" PrivateAssets="all" /> + <PackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" PrivateAssets="all" /> </ItemGroup> </Project> diff --git a/src/test/XsdToMarkDownTests/XsdToMarkdownTests.csproj b/src/test/XsdToMarkDownTests/XsdToMarkdownTests.csproj index d1e2f9fa..7cbfdd15 100644 --- a/src/test/XsdToMarkDownTests/XsdToMarkdownTests.csproj +++ b/src/test/XsdToMarkDownTests/XsdToMarkdownTests.csproj @@ -14,13 +14,13 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Markdig" Version="0.20.0" /> + <PackageReference Include="Markdig" Version="0.38.0" /> </ItemGroup> <ItemGroup> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" PrivateAssets="All" /> - <PackageReference Include="xunit" Version="2.4.1" PrivateAssets="All" /> - <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="All" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" PrivateAssets="All" /> + <PackageReference Include="xunit" Version="2.9.2" PrivateAssets="All" /> + <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="All" /> </ItemGroup> </Project>