question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InternalServerError with AddCertificate

See original GitHub issue

Hello,

I try to add a certificate, but I get a InternalServerError in the response when it tries to add the certificate to the app service. Any idea what the problem can be? Thank you?

Orchestrator function ‘AddCertificate’ failed: The activity function ‘UpdateCertificate’ failed: “Failed to deserialize exception from TaskActivity: {”$type":“Microsoft.Azure.Management.WebSites.Models.DefaultErrorResponseException, Microsoft.Azure.Management.Websites”,“Request”:{“$type”:“Microsoft.Rest.HttpRequestMessageWrapper, Microsoft.Rest.ClientRuntime”,“Method”:{“$type”:“System.Net.Http.HttpMethod, System.Net.Http”,“Method”:“PUT”},“RequestUri”:“https://management.azure.com/subscriptions/1683198f-4c7d-4609-aaef-6ae9084e4682/resourceGroups/MSCLOUD-RG01/providers/Microsoft.Web/certificates/mijn.ubnuitzendbureau.com-1D3F7F2917DF29E03F286FC45EFEFCABF77A1FCD?api-version=2018-11-01",“Properties”:{“$type”:"System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.Object, System.Private.CoreLib]], System.Private.CoreLib”},“Content”:“{\r\n "properties": {\r\n "pfxBlob": "Mrj5S",\r\n "password": "Pd",\r\n "serverFarmId": "/subscriptions/1683198f-4c7d-4609-aaef-6ae9084e4682/resourceGroups/MSCLOUD-RG01/providers/Microsoft.Web/serverfarms/PORTALS"\r\n },\r\n "location": "West Europe"\r\n}”,“Headers”:{“$type”:“System.Collections.Generic.Dictionary2[[System.String, System.Private.CoreLib],[System.Collections.Generic.IEnumerable1[[System.String, System.Private.CoreLib]], System.Private.CoreLib]], System.Private.CoreLib”,“x-ms-client-request-id”:[“2401a0c9-9e1e-4570-9a0e-38f3c7277352”],“Accept-Language”:[“en-US”],“Authorization”:[“Bearer eyJ0e4Q”],“User-Agent”:[“FxVersion/4.6.28207.03”,“OSName/Windows”,“OSVersion/Microsoft.Windows.10.0.14393.”,“Microsoft.Azure.Management.WebSites.WebSiteManagementClient/2.2.0”],“Request-Context”:[“appId=cid-v1:3945ab3b-2765-48b1-bfb1-4c7c7d56c12f”],“traceparent”:[“00-1f89ba052cc11540a960983455b96bfb-aef7c8ac223e8d4e-00”],“Request-Id”:[“|1f89ba052cc11540a960983455b96bfb.aef7c8ac223e8d4e.”],“Content-Type”:[“application/json; charset=utf-8”],“Content-Length”:[“4206”]}},“Response”:{“$type”:“Microsoft.Rest.HttpResponseMessageWrapper, Microsoft.Rest.ClientRuntime”,“StatusCode”:500,“ReasonPhrase”:“Internal Server Error”,“Content”:“{"Message":"An error has occurred."}”,“Headers”:{“$type”:“System.Collections.Generic.Dictionary2[[System.String, System.Private.CoreLib],[System.Collections.Generic.IEnumerable1[[System.String, System.Private.CoreLib]], System.Private.CoreLib]], System.Private.CoreLib”,“Cache-Control”:[“no-cache”],“Pragma”:[“no-cache”],“Strict-Transport-Security”:[“max-age=31536000; includeSubDomains”],“Server”:[“Microsoft-IIS/10.0”],“X-AspNet-Version”:[“4.0.30319”],“X-Powered-By”:[“ASP.NET”],“x-ms-failure-cause”:[“service”],“x-ms-ratelimit-remaining-subscription-writes”:[“1199”],“x-ms-request-id”:[“7573bfd1-b9bd-466b-bf76-6771e8f23038”],“x-ms-correlation-request-id”:[“7573bfd1-b9bd-466b-bf76-6771e8f23038”],“x-ms-routing-request-id”:[“WESTEUROPE:20191223T153459Z:7573bfd1-b9bd-466b-bf76-6771e8f23038”],“X-Content-Type-Options”:[“nosniff”],“Date”:[“Mon, 23 Dec 2019 15:34:59 GMT”],“Connection”:[“close”],“Content-Length”:[“36”],“Content-Type”:[“application/json; charset=utf-8”],“Expires”:[“-1”]}},“Body”:{“$type”:“Microsoft.Azure.Management.WebSites.Models.DefaultErrorResponse, Microsoft.Azure.Management.Websites”,“error”:null},“Message”:“Operation returned an invalid status code ‘InternalServerError’”,“Data”:{“$type”:“System.Collections.ListDictionaryInternal, System.Private.CoreLib”},“InnerException”:null,“StackTrace”:" at Microsoft.Azure.Management.WebSites.CertificatesOperations.CreateOrUpdateWithHttpMessagesAsync(String resourceGroupName, String name, Certificate certificateEnvelope, Dictionary2 customHeaders, CancellationToken cancellationToken)\r\n at Microsoft.Azure.Management.WebSites.CertificatesOperationsExtensions.CreateOrUpdateAsync(ICertificatesOperations operations, String resourceGroupName, String name, Certificate certificateEnvelope, CancellationToken cancellationToken)\r\n at Microsoft.Azure.WebJobs.Host.Executors.VoidTaskMethodInvoker2.InvokeAsync(TReflected instance, Object[] arguments) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\VoidTaskMethodInvoker.cs:line 20\r\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.InvokeAsync(Object instance, Object[] arguments) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionInvoker.cs:line 52\r\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker invoker, ParameterHelper parameterHelper, CancellationTokenSource timeoutTokenSource, CancellationTokenSource functionCancellationTokenSource, Boolean throwOnTimeout, TimeSpan timerInterval, IFunctionInstance instance) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs:line 585\r\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstanceEx instance, ParameterHelper parameterHelper, ILogger logger, CancellationTokenSource functionCancellationTokenSource) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs:line 532\r\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(IFunctionInstanceEx instance, ParameterHelper parameterHelper, IFunctionOutputDefinition outputDefinition, ILogger logger, CancellationTokenSource functionCancellationTokenSource) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs:line 468\r\n at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(IFunctionInstanceEx instance, FunctionStartedMessage message, FunctionInstanceLogEntry instanceLogEntry, ParameterHelper parameterHelper, ILogger logger, CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs:line 278",“HelpLink”:null,“Source”:“Microsoft.Azure.Management.Websites”,“HResult”:-2146233088}". See the function execution logs for additional details.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shibayancommented, Dec 23, 2019

Thank you for reporting.

The problem has been reproduced and will be fixed soon.

0reactions
gmansiliacommented, Dec 26, 2019

Tested now, worked perfect when I added the certificates!

Thank you @shibayan for this great tool, it’s the best way we have to work with Let’s Encrypt in Azure Apps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NSX Edge fails to upload a server certificate (86474)
When adding a new server certificate on the Edge UI - NSX Edges -> Manage -> Settings -> Certificates -> Certificate -> Paste...
Read more >
Certificate Authentication in ASP.NET Core 3.1
This article shows how Certificate Authentication can be implemented in ASP.NET Core 3.1. In this example, a shared self signed certificate ...
Read more >
Getting 500 Internal Server Error After Creating a Certificate
I'm receiving "500 Internal Server Error " after creating a certificate. I've rechecked many things to ensure I have https allowed, etc.
Read more >
Add Certificate to TrustStore REST Service
Use the Add Certificate to TrustStore REST Service to add a certificate from a certificate file that is in DER or base64 format...
Read more >
Using client certificates in .NET part 5
In this post we'll go through how to attach a client certificate to a web request and how to extract it in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found