-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fix: [Functions][Kubernetes]SyncTrigger issue #208
Fix: [Functions][Kubernetes]SyncTrigger issue #208
Conversation
Not just Durable Functions - Logic Apps also requires host.json: https://github.com/Azure-App-Service/KuduLite/pull/196/files |
Thank you @cgillum I updated the description. |
//Auth header value is null or empty return false | ||
var funcAppAuthToken = siteTokenHeaderValue.FirstOrDefault(); | ||
if (string.IsNullOrEmpty(funcAppAuthToken)) | ||
{ | ||
return false; | ||
} | ||
|
||
Console.WriteLine("**** SyncTriggerAuthenticator funcAppAuthToken ***"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these Console.WriteLine needed? Can they use a logger of some sort?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ahmelsayed This line is just for temporary debugging, However, I'd like to use Logger.
I found ITracer
is injected, so that I tried to use it, However, it doesn't show anything on the console log. Do you know why it doesn't show the console log? Do we need to configure for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to ILogger
? If yes, you need to explicitly add console logging provider - https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-5.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed on the standup, I remove the Console logs.
I'll update the logs for production on this issue. #202
Host issue: Azure/azure-functions-host#7382 |
Hi @pragnagopa @ahmelsayed TODO: |
Hi @ahmelsayed |
Does it not need to change in Startup.cs? if this works, then it's fine, I'm not sure what order aspnet core loads these in. |
HI @ahmelsayed |
Hi @ahmelsayed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I open this PR for sharing / discussing the design of the fix.
@pragnagopa @divyagandhisethi @ahmelsayed @cgillum
On the Kudu Lite Side, We found these issues.
SSL Connection issue when we call SyncTrigger API from Azure Functions Host
That is caused when the API access to the Kubernetes API, however, the HTTP Client
doesn't refer to the /var/run/secrets/kubernetes.io/serviceaccount/ca.crt.
We have three ways to fix.
cp /var/run/secrets/kubernetes.io/serviceaccount/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates
.Since the ca.crt is mounted and it is possible that is updated, so that the second solution is the best, however, IMO, we can fix the first one for a while and create a new issue for 2 might be the best.
Wrong URL name
The correct secret name is
functionApp-secrets
. There are the following secrets are found. Probably,functionApp-encryption-secrets
is old one.functionApp-secrets
contains more information.token validation fails
The token validation fails, because of the Decryption using the different logic with Azure Functions Host. I change it to use the same logic as Azure Functions Host.
Sync Trigger Payload is not what is expected.
Current Code, It assume that the payload will be an array of the following.
However, the sync trigger payload that is coming from Azure Functions Host is
I create a transformation logic simply convert from the
triggers
.Durable Functions / Logic Apps Usage requires host.json information
Durable Functions / Logic Apps Transformation requires
host.json
information. It is ok for zip deploy, however, for sync trigger scenario with container app, there is nohost.json
information on the SyncTrigger payload.We need to update the Azure Functions Host for enabling it.
KuduLite/Kudu.Core/Functions/KedaFunctionTriggerProvider.cs
Line 252 in a17a854
Logging
Currently, I use Console.WriteLine for the debugging. However, we should use
ITracer
However, it doesn't show something. Do we need to configure it? I'll remove the Console.WriteLine before migrating to the PullRequest.