Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Provide System Key for Durable Functions API Calls in Azure Container App #89

Closed
MarkOwen-CoditMT opened this issue Nov 13, 2024 · 1 comment

Comments

@MarkOwen-CoditMT
Copy link

Description:

I have a container app running an Azure Function with authentication enabled via an Azure App Registration to authorize incoming requests. While the primary HTTP-triggered function requests work as expected, I'm encountering an issue when trying to make API calls to the Durable Functions runtime API. These calls require a system key for authentication, but since the Azure Container App does not have an "App Keys" section (like the Functions resources do), I'm unable to provide the required system key.

How are scenarios like this handled where a system key is required, and the container app doesn’t have an equivalent section for generating and using the system key?

Here is an example of the response I get from the Durable Functions API, which references the specific runtime durable tasks I'm referring to:

{
    "id": "fcf50b2123b44abb9375a9a90fd56d3e",
    "statusQueryGetUri": "https://your-function-app.azurewebsites.net/runtime/webhooks/durabletask/instances/fcf50b2123b44abb9375a9a90fd56d3e?taskHub=SampleHub&connection=Storage&code=someCode",
    "sendEventPostUri": "https://your-function-app.azurewebsites.net/runtime/webhooks/durabletask/instances/fcf50b2123b44abb9375a9a90fd56d3e/raiseEvent/{eventName}?taskHub=SampleHub&connection=Storage&code=someCode",
    "terminatePostUri": "https://your-function-app.azurewebsites.net/runtime/webhooks/durabletask/instances/fcf50b2123b44abb9375a9a90fd56d3e/terminate?reason={text}&taskHub=SampleHub&connection=Storage&code=someCode",
    "rewindPostUri": "https://your-function-app.azurewebsites.net/runtime/webhooks/durabletask/instances/fcf50b2123b44abb9375a9a90fd56d3e/rewind?reason={text}&taskHub=SampleHub&connection=Storage&code=someCode",
    "purgeHistoryDeleteUri": "https://your-function-app.azurewebsites.net/runtime/webhooks/durabletask/instances/fcf50b2123b44abb9375a9a90fd56d3e?taskHub=SampleHub&connection=Storage&code=someCode"
}

I have also opened an issue on the Durable Functions GitHub repository regarding this problem.

Additional Context:

  • The container app is using authentication via App Registration.
  • The issue arises specifically with Durable Functions runtime API calls that require a system key for authorization.
  • Azure Functions resources typically have a section for app keys, but Container Apps do not.
@MarkOwen-CoditMT
Copy link
Author

The above issue has been fixed by the new azure functions durable tasks release 1.2.0 the CreateHttpManagementPayload method returns the code (system key value). all that remains since the url will be in localhost is to update it to base url of your container app url. If you have auth settings enabled like in my case, you need to also pass the access token in the header for both auth and the local authentication to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant