You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running an Azure Function locally will result in the kubernetes client successfully communicating with the agents a given k8s cluster on azure.
When running the function on the azure functions environment I receive a client certificate credentials were not recognized error, despite the creds being identical on azure and local.
Azure function executes identically to local development when published and started on azure.
Actual behavior
Provide a description of the actual behavior observed.
Running an Azure Function locally will result in the kubernetes client successfully communicating with the agents a given k8s cluster on azure.
When running the function on the azure functions environment I receiving the follow stacktrace
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: NodeDestroyer ---> System.Net.Http.HttpRequestException : An error occurred while sending the request.---> System.Net.Http.WinHttpException : The client certificate credentials were not recognized
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestStatestate)
End of inner exception
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async k8s.WatcherDelegatingHandler.SendAsync(HttpRequestMessagerequest,CancellationTokencancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Rest.RetryDelegatingHandler.<>c__DisplayClass11_0.<SendAsync>b__1(??)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Rest.RetryDelegatingHandler.SendAsync(HttpRequestMessagerequest,CancellationTokencancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask,HttpRequestMessage request,CancellationTokenSource cts,Boolean disposeCts)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async k8s.Kubernetes.ListNamespacedServiceWithHttpMessagesAsync(StringnamespaceParameter,StringcontinueParameter,StringfieldSelector,Nullable`1includeUninitialized,StringlabelSelector,Nullable`1limit,StringresourceVersion,Nullable`1timeoutSeconds,Nullable`1watch,Stringpretty,Dictionary`2customHeaders,CancellationTokencancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async k8s.KubernetesExtensions.ListNamespacedServiceAsync(IKubernetesoperations,StringnamespaceParameter,StringcontinueParameter,StringfieldSelector,Nullable`1includeUninitialized,StringlabelSelector,Nullable`1limit,StringresourceVersion,Nullable`1timeoutSeconds,Nullable`1watch,Stringpretty,CancellationTokencancellationToken)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at k8s.KubernetesExtensions.ListNamespacedService(IKubernetesoperations,StringnamespaceParameter,StringcontinueParameter,StringfieldSelector,Nullable`1includeUninitialized,StringlabelSelector,Nullable`1limit,StringresourceVersion,Nullable`1timeoutSeconds,Nullable`1watch,Stringpretty)
at InfrastructureManager.NodeDestroyer.TakeAvailableService(Stringid,TraceWriterlog,ExecutionContextcontext) at C:\GitHub\WebContent\InfrastructureManager\InfrastructureManager\InfrastructureManager.cs :129
at InfrastructureManager.NodeDestroyer.CreateAvailableNodes(TraceWriterlog,ExecutionContextcontext) at C:\GitHub\WebContent\InfrastructureManager\InfrastructureManager\InfrastructureManager.cs :57
at InfrastructureManager.NodeDestroyer.Run(TimerInfomyTimer,TraceWriterlog,ExecutionContextcontext) at C:\GitHub\WebContent\InfrastructureManager\InfrastructureManager\InfrastructureManager.cs :38
at lambda_method(Closure,NodeDestroyer,Object[])
at Microsoft.Azure.WebJobs.Host.Executors.VoidMethodInvoker`2.InvokeAsync(TReflected instance,Object[]arguments) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\VoidMethodInvoker.cs :20
at async Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.InvokeAsync[TReflected,TReturnValue](Object instance,Object[] arguments) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionInvoker.cs :63
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()atasync Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker invoker,ParameterHelper parameterHelper,CancellationTokenSource timeoutTokenSource,CancellationTokenSource functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan timerInterval,IFunctionInstance instance) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs :583
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstanceinstance,ParameterHelperparameterHelper,TraceWritertraceWriter,CancellationTokenSourcefunctionCancellationTokenSource) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs :534
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()atasync Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs :477
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs :264
End of inner exception
The only difference from azure function local dev to production is how the environment variables container the certs are ingested.
I have hardcoded the Client credentials to what would be available in azure, and the error+stacktrace persists when ran on azure, but successful when ran locally.
Known workarounds
Provide a description of any known workarounds.
Related information
Provide any related information
Programming language used
C# Class Library Azure function
This was root caused as an azure related issue;
Must use the X509 Store to consume an ssl cert and use it against an Kubernetes cluster.
using System;
using System.Security.Cryptography.X509Certificates;namespace UseCertificateInAzureWebsiteApp
{
class Program
{
static void Main(string[] args)
{
X509Store certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
certStore.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certCollection = certStore.Certificates.Find(
X509FindType.FindByThumbprint,
// Replace below with your cert's thumbprint
“E661583E8FABEF4C0BEF694CBC41C28FB81CD870”,
false);
// Get the first cert with the thumbprint
if (certCollection.Count > 0)
{
X509Certificate2 cert = certCollection[0];
// Use certificate
Console.WriteLine(cert.FriendlyName);
}
certStore.Close();
}
}
}
Running an Azure Function locally will result in the kubernetes client successfully communicating with the agents a given k8s cluster on azure.
When running the function on the azure functions environment I receive a
client certificate credentials were not recognized
error, despite the creds being identical on azure and local.Investigative information
Please provide the following:
a2129799-8b25-4e1b-9731-56e4a13b6b10
Repro steps
Provide the steps required to reproduce the problem:
Linking to Kubernetes CSharp client repo issue : kubernetes-client/csharp#79
Expected behavior
Provide a description of the expected behavior.
Azure function executes identically to local development when published and started on azure.
Actual behavior
Provide a description of the actual behavior observed.
Running an Azure Function locally will result in the kubernetes client successfully communicating with the agents a given k8s cluster on azure.
When running the function on the azure functions environment I receiving the follow stacktrace
The only difference from azure function local dev to production is how the environment variables container the certs are ingested.
I have hardcoded the Client credentials to what would be available in azure, and the error+stacktrace persists when ran on azure, but successful when ran locally.
Known workarounds
Provide a description of any known workarounds.
Related information
Provide any related information
C# Class Library Azure function
Source
The text was updated successfully, but these errors were encountered: