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.

Orchestrator function 'AddCertificate_Orchestrator' failed: The orchestrator function 'IssueCertificate' failed

See original GitHub issue

Describe the bug

After following the instructions in the README.md file, adding a certificate to an App Service fails with an error message (which was horribly compacted into a browser alert box which cannot be copied to the clipboard).

The error details are embedded in a JSON object stored in a JSON string inside another JSON object - fun. I can’t post the full response verbatim as it appears to contain Base64-encoded PFX files.

Here’s what I can show, however ($foo, $bar, $domain, $resgroup are placeholders)::

The outer JSON object starts with this:

{"type":"https://tools.ietf.org/html/rfc7231#section-6.6.1","title":"An error occured while processing your request.","status":500,"detail":"Orchestrator function 'AddCertificate_Orchestrator' failed: The orchestrator function 'IssueCertificate' failed: \"The activity function 'UploadCertificate' 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/$sub/resourceGroups/Resgroup-rss1/providers/Microsoft.Web/certificates/$domain.com-$bar?api-version=2020-06-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\\\": 
etc

The inner response object has a content property with this (message is repeated in full below):

{
	"error": {
		"code": "LinkedAuthorizationFailed",
		"message": "The client 'foo' with object id 'foo' has permission to ..."
	}
}

The message is

The client ‘$foo’ with object id ‘$foo’ has permission to perform action ‘Microsoft.Web/certificates/write’ on scope ‘/subscriptions/$sub/resourceGroups/Resgroup-example1/providers/Microsoft.Web/certificates/domain.com-$bar’; however, it does not have permission to perform action ‘write’ on the linked scope(s) ‘/subscriptions/$sub/resourceGroups/Resgroup-example/providers/Microsoft.Web/serverfarms/exampleWebPlan’ or the linked scope(s) are invalid.

To Reproduce Steps to reproduce the behavior:

  • I followed the instructions in the README file.
  • I verified the Azure Function running the ACMEBot has permission to access the parent Resource Group of the App Service, as per the README file’s instructions.

With these options:

  • “Use IP based SSL?” - No
  • “Force DNS-01 Challenge?” - No

Environment (please complete the following information):

  • App Service OS: Windows
  • App Service Type: Unsure - just a “normal” website Azure App Service
  • Runtime Stack: .NET Core
  • Certificate Type: I don’t know, I wasn’t given an option

Additional context

So there’s at least 2 bugs:

  • The ACMEBot needs to handle errors better, ideally by displaying them within the page’s HTML content instead of in an alert(), because Chrome does not currently let you copy text in an alert().
  • The README needs updated instructions for the necessary permissions.

And a feature suggestion:

  • Add a permissions test feature.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
shibayancommented, Jan 13, 2021

I don’t feel good when people report anything as a bug, so please stop. You should use the discussion first.

0reactions
Beddiecommented, Aug 20, 2022

@daamsie Thanks a lot Daamsie that did it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Orchestrator function failed: The activity ...
I have a working azure functions app where I added a sub-orchestrator with activity functions inside. The rest of the app is working...
Read more >
Handling errors in Durable Functions (Azure Functions)
If the first CreditAccount function call fails, the orchestrator function compensates by crediting the funds back to the source account.
Read more >
Error handling in Azure Durable Functions
This article is about applying the error handling in your Azure Durable Functions to enhance the reliability and robustness.
Read more >
Getting started with Durable Functions | by Stephanie Lee
An Orchestration Client binding allows you to write functions that can ... failed or terminated before a new instance can be started.
Read more >
Track activity and sub-orchestrator progress in Azure ...
WhenAll() , the function throws an exception at the end if one or more tasks failed. Then we can use it in the...
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