question

MartinAlley-3053 avatar image
0 Votes"
MartinAlley-3053 asked JasonPan-MSFT commented

broken .net framework aspnet webapi hosted on azure

Hello,

I have a .net framework licensing server webapi app hosted on azure which has stopped working.

It hasn't been used for a while, but when i came to update the keys, and use it again, i found it was broken. I wasn't able to get detailed logs of the problem however. But i think the digest algorithm (RSA256) was no longer supported on azure.

The architecture/technology is basically as follows:
.net framework
mvc web api
odata 4
entity framework 6
secured with AuthorizationFilterAttribute
custom EnableQueryAttribute (ValidateQuery method)

Licences are signed with a private key (signed digest of json info)

There were a number of nuget packages that were deprecated, namely
Microsoft.Azure.KeyVault
Microsoft.Azure.KeyVault.WebKey
Microsoft.IdentityModel.Clients.ActiveDirectory

I've been slowly sucked down the road of moving to .net core, and suddenly find myself with a lot of unplanned work.

I'm wondering what the minimum work route is to get back to a working licensing server.

The problems I encountered are not being able to deploy a version of the project. (fixed by using some .net core elements i think)

Not being able to attach to a running web app. (i tried using the deployment credentials, and my subscription credentials)

I would appreciate some guidance.

Thanks very much
Martin


dotnet-aspnet-core-generalazure-key-vaultdotnet-entity-framework-core
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MartinAlley-3053

But i think the digest algorithm (RSA256) was no longer supported on azure.

If you have seen official doc mentioned it, please share with us. As far as I know, if your webapp worked well before, it shouldn't be a problem now.
I think there may be some settings that have been changed, such as the values in azure -key-vault. We need more logs or dump files to locate the issue.
Please follow below steps to collect details. If you need further help, you can raise a support ticket in azure portal.

243262-image.png

243146-image.png

Best Regards
Jason


0 Votes 0 ·
image.png (21.5 KiB)
image.png (66.3 KiB)
MartinAlley-3053 avatar image
0 Votes"
MartinAlley-3053 answered JasonPan-MSFT commented

Hi Jason,

Thanks for your response.
It’s reassuring to know there is support for .Net Framework for Azure Web Apps.
However I have adopted the new buget packages for Azure Key Vault, which are .Net Core based,

My current problem is regarding assembly redirects I think. As described in this old post System.Data.Common, System.Net.Http Framework vs Nuget assembly in ASP.NET Web API project - Visual Studio Feedback https://developercommunity.visualstudio.com/t/systemdatacommon-systemnethttp-framework-vs-nuget/343293

The post suggests they’ll be a better explanation regarding advise in the future. Do you know where the best advice for this is now?

Kind regards
Martin

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MartinAlley-3053

This issue is related to the compatibility of asp.net core's package with the .net framework.
There is no good way to migrate the old .net framework project to .net core and will generate a lot of work.

Best Regards
Jason

0 Votes 0 ·
MartinAlley-3053 avatar image
0 Votes"
MartinAlley-3053 answered JasonPan-MSFT commented

Hi Jason,

Thanks for confirming this.
Are there any plans to put guard rails on adding certain packages to a .net framework project.
For example what is the best way to adopt newer azure apis when using .net framework project? Or is this advice not to?

I feel like this issue is bigger than a question thread on learn.microsoft.com.

Is there a good guidance on microsoft.com somewhere? including a TLDR summary?

Many Thanks
Martin

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The best link I've found so far is
https://learn.microsoft.com/en-us/dotnet/standard/choosing-core-framework-server

There's no mention of Azure APIs though.

0 Votes 0 ·
JasonPan-MSFT avatar image JasonPan-MSFT MartinAlley-3053 ·

Hi @MartinAlley-3053

In order to better help you, I need the following pieces of information to scope the issue.

  1. Does the project can run well in your local ?

  2. What the method you used to deploy the application to azure ?

  3. Can we get any error message from local or azure ?

Best Regards
Jason



0 Votes 0 ·

Hi Jason,

The answers to your questions:

Does the project can run well in your local ?
Not at the moment, since I made code changes to address perceived issues in Azure live.
I could role those changes back, although I have different key handling code and signing code according to whether the service is running on azure or locally.

What the method you used to deploy the application to azure ?
I use web deploy

Can we get any error message from local or azure ?
On local I am getting an error about System.Net.Http being a bad image - because it's a reference assembly(?)

On azure I'm getting an error:
Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.


This stems from Global.asax.cs line
GlobalConfiguration.Configure(WebApiConfig.Register);

0 Votes 0 ·
Show more comments