Settings must be of the form "name=value". at Microsoft.Azure.Storage.CloudStorageAccount when running Azure webjob timer trigger - azure-webjobssdk

getting the below error when running in one particular Azure env. I tested in two other envs also its working fine there.
Checked the azure storage connection string for that env ,it seems to be in correct format.
Can Someone please help!
Unhandled exception.
Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener for function 'SchedulerFunctions.RunEpTask' was unable to start.
---> System.FormatException:
Settings must be of the form "name=value". at Microsoft.Azure.Storage.CloudStorageAccount.<>c.
<Parse>b__97_0(String err) at
Microsoft.Azure.Storage.CloudStorageAccount.ParseStringIntoSettings(String connectionString, Action`1 error) at
Microsoft.Azure.Storage.CloudStorageAccount.ParseImpl(String connectionString, CloudStorageAccount& accountInformation, Action`1 error) at Microsoft.Azure.Storage.CloudStorageAccount.Parse(String connectionString) at
Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.get_TimerStatusDirectory() in C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions\Extensions\Timers\Scheduling\StorageScheduleMonitor.cs:line 77 at
Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.GetStatusBlobReference(String timerName) in C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions\Extensions\Timers\Scheduling\StorageScheduleMonitor.cs:line 144 at
Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.GetStatusAsync(String timerName) in C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions\Extensions\Timers\Scheduling\StorageScheduleMonitor.cs:line 93 at
Microsoft.Azure.WebJobs.Extensions.Timers.Listeners.TimerListener.StartAsync(CancellationToken cancellationToken) in C:\azure-webjobs-sdk-extensions\src\WebJobs.Extensions\Extensions\Timers\Listener\TimerListener.cs:line 99 at
Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener.StartAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Singleton\SingletonListener.cs:line 70 at
Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.StartAsync(CancellationToken cancellationToken, Boolean allowRetry) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\FunctionListener.cs:line 68 --- End of inner exception stack trace --- at
Microsoft.Azure.WebJobs.Host.RecoverableException.TryRecover(ILogger logger) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Exceptions\RecoverableException.cs:line 81 at Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.StartAsync(CancellationToken cancellationToken, Boolean allowRetry) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\FunctionListener.cs:line 79 at
Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.StartAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\FunctionListener.cs:line 61 at Microsoft.Azure.WebJobs.Host.Listeners.CompositeListener.StartAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\CompositeListener.cs:line 39 at Microsoft.Azure.WebJobs.Host.Listeners.ListenerFactoryListener.StartAsyncCore(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ListenerFactoryListener.cs:line 47 at
Microsoft.Azure.WebJobs.Host.Listeners.ShutdownListener.StartAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\ShutdownListener.cs:line 29 at Microsoft.Azure.WebJobs.JobHost.StartAsyncCore(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\JobHost.cs:line 101 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at
Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Deloitte.Audit.Workflow.NotificationService.Program.Main() in F:\Vsts\agent-15\_work\48\s\WebApi\src\Deloitte.Audit.Workflow.NotificationService\Program.cs:line 21 at Deloitte.Audit.Workflow.NotificationService.Program.<Main>()
getting the below error when running in one particular Azure env. I tested in two other envs also its working fine there.
Checked the azure storage connection string for that env ,it seems to be in correct format.
Can Someone please help!

Settings must be of the form "name=value". at Microsoft.Azure.Storage.CloudStorageAccount when running Azure webjob timer trigger
You haven't added the Storage Account Connection String in appsettings.json file.
Create a Storage Account and copy the Connection String from Access Keys = >Connection string.
Add a new file appsettings.json and add the below line
AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=StorageAccName;AccountKey=****==;EndpointSuffix=core.windows.net"
Thanks #christiandersen and Coding Canvas for the explanation.
For the Web Job to run the timer-trigger we need to set it as a Scheduled Jobs.
Your settings.json must contain the below settings.
{
"schedule":"0 */15 * * * *",
"is_singleton":true
}
This setting is to specify the CRON expression/ time span which specifies the web job to trigger.

Related

Xamarin forms iOS App getting crash some times when first time for the day is open

I have built an iOS app using Xamarin Forms. it is integrated into firebase crashlatics. so i am getting a error from couple of ios users.
Non-fatal Exception: Unable to read data from the transport connection: The socket is not connected.
at System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.ThrowException (System.Net.Sockets.SocketError error) <0x105528640 + 0x0001c> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs.GetResult (System.Int16 token) <0x1055284b0 + 0x00073> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at System.Threading.Tasks.ValueTask`1+ValueTaskSourceAsTask+<>c[TResult].<.cctor>b__4_0 (System.Object state) <0x104d714f0 + 0x00173> in <d7378003255d47168c07c9b138461e80#d1ce4374a462223982a60b97d03a2ef1>:0 --- End of stack trace from previous location where exception was thrown ---
at Mono.Net.Security.MobileAuthenticatedStream.InnerRead (System.Boolean sync, System.Int32 requestedSize, System.Threading.CancellationToken cancellationToken) <0x10544c170 + 0x0039b> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at Mono.Net.Security.AsyncProtocolRequest.InnerRead (System.Threading.CancellationToken cancellationToken) <0x1054467a0 + 0x0024b> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (System.Threading.CancellationToken cancellationToken) <0x105446120 + 0x00227> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at Mono.Net.Security.AsyncProtocolRequest.StartOperation (System.Threading.CancellationToken cancellationToken) <0x105445cd0 + 0x00273> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at Mono.Net.Security.MobileAuthenticatedStream.CheckThrow (System.Boolean authSuccessCheck, System.Boolean shutdownCheck) <0x1054484a0 + 0x0002f> in <11ade8ccf21d4e088feeebdfa82d9e3b#d1ce4374a462223982a60b97d03a2ef1>:0
at Mono.Net.Security.MobileAuthenticatedStream.StartOperation (Mono.Net.Security.MobileAuthenticatedStream+OperationType type, Mono.Net.Security.AsyncProtocolRequest asyncRequest, System.Threading.CancellationToken cancellationToken) <0x1
But still, I have no idea from where and why the problem is happening. anyone having idea
This error usually means that the target machine is running, but the service that you're trying to connect to is not available. (Either it stopped, crashed, or is busy with another request.)
So, you may want to check your network or do something like that, you can check this question, it explained the problem well Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host

What are the urls required to unblock through firewall in corporate network for accessing for Google Translate API (Advanced Version)?

What are the urls required to unblock through firewall in corporate network for accessing for Google Translate API (Advanced Version)?
Right now unblocked are:
*.googleapis.com and accounts.google.com
But still I get below error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {​​​​​​​​"created":"#1612337108.132000000","description":"Failed to pick subchannel","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\client_channel.cc","file_line":4090,"referenced_errors":[{​​​​​​​​"created":"#1612337108.132000000","description":"failed to connect to all addresses","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc","file_line":394,"grpc_status":14}​​​​​​​​]}​​​​​​​​") at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Grpc.Core.Internal.AsyncCall2.UnaryCall(TRequest msg) at Grpc.Core.DefaultCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method2 method, String host, CallOptions options, TRequest request) at Grpc.Core.Interceptors.InterceptingCallInvoker.b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext2 ctx) at Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext2 context, BlockingUnaryCallContinuation2 continuation) at Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method2 method, String host, CallOptions options, TRequest request) at Google.Cloud.Translate.V3.TranslationService.TranslationServiceClient.TranslateText(TranslateTextRequest request, CallOptions options) at Google.Api.Gax.Grpc.ApiCall.GrpcCallAdapter2.CallSync(TRequest request, CallSettings callSettings) at Google.Api.Gax.Grpc.ApiCallRetryExtensions.<>c__DisplayClass1_02.b__0(TRequest request, CallSettings callSettings) at ABG.Foundation.LanguageTranslator.GoogleTranslator.TranslateData(String sourceLanguage, String targetLanguage, List1 content) in D:\a\1\s\src\Foundation\LanguageTranslator\code\GoogleTranslator\GoogleTranslator.cs:line 106 at ABG.Foundation.LanguageTranslator.GoogleTranslator.TranslateData(List1 items, String sourceLanguage, String targetLanguage) in ...
NOTE: Same code and setup works fine outside the corporate network.

Integration test is unable to connect to Postgres 9.6 Db in Jenkins

Description:
A .Net Core 3.1 Web API project contains an IHostedService-implementing service which reads cache data from PostgresDB in StartAsync method. This cache-retrieving service has been registered in Startup's ConfigureServices method
Problem:
While running integration tests in Jenkins I've found that exception is being thrown while trying to connect to the Db:
[19:49:34 ERR] An error occurred using the connection to database 'FooDb' on server 'tcp://localhost:5432'.
[19:49:34 INF] A transient exception has been encountered during execution and the operation will be retried after 0ms.
Npgsql.NpgsqlException (0x80004005): Exception while connecting
---> System.Net.Sockets.SocketException (99): Cannot assign requested address
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state, Boolean flowContext)
at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.ConnectAsync(EndPoint remoteEP)
at Npgsql.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.ConnectorPool.AllocateLong(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<>c__DisplayClass32_0.<<Open>g__OpenLong|0>d.MoveNext()
This issue is limited to integration tests run, e.g. the service works fine in other scenarios.
What have I tried so far?
As per MSDN suggestion I've moved the registration of my cache reading service to Program.cs CreateHostBuilder method;
Refactored cache retrieval to IStartupFilter implementation
none of these steps helped.
Also, I've removed the cache reading service's registration to confirm that its invocation is causing the issue. Indeed, everything works fine if I don't add the cache reading service.

Orchard CMS "Microsoft Azure Media Storage" module unable to connect to new storage account

I would like to connect my Orchard CMS v.1.10.1.0 app to an Azure blob storage account. I've followed the same process for years, following this documentation. This process has stopped working for me. My application won't connect to new Azure storage accounts -- be they StorageV1, StorageV2, or Blob Storage.
I can connect to storage accounts that I have used with Orchard in the past--I just can't connect to new storage accounts.
An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
The remote server returned an error: (400) Bad Request.
Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (400) Bad Request. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.Exists(Boolean primaryOnly, BlobRequestOptions requestOptions, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.CreateIfNotExists(BlobContainerPublicAccessType accessType, BlobRequestOptions requestOptions, OperationContext operationContext) at Orchard.Azure.Services.FileSystems.AzureFileSystem.EnsureInitialized() at Orchard.Azure.Services.FileSystems.AzureFileSystem.ListFolders(String path) at Orchard.MediaLibrary.Services.MediaLibraryService.GetMediaFolders(String relativePath) at Orchard.MediaLibrary.Controllers.AdminController.Index(String folderPath, Boolean dialog) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() Request Information RequestID:edaa1946-501e-0035-0d03-9c41ef000000 RequestDate:Tue, 06 Oct 2020 17:10:00 GMT StatusMessage:The TLS version of the connection is not permitted on this storage account.
I solved the issue by putting this line before the call to storage account.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
I was able to solve the issue by going into the Configuration settings for the new storage account and requiring a lower minimum TLS version.

Iothub module authentication error in Azure

I am running a fairly basic Azure IoT C# module. Initially, it all worked fine. However, when I set up X.509 certificates for the edge hub, I've been getting module authentication errors as follows. There seems to be some dependence on using Tcp_only or Websocket_only options of the AMQP/MQTT protocols (where the latter does not throw the exception), but this is not consistent across modules.
The offending lines of code are below
..
// Open a connection to the Edge runtime
ioTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);
await ioTHubModuleClient.OpenAsync();
The error message is below. Essentially the await times out because authentication is not complete. Far as I know, authentication is derived directly from the iot edge runtime, so not sure why it was specifically trying to authenticate or erroring out...
Unhandled Exception: System.AggregateException: One or more errors
occurred. (The remote certificate is invalid according to the
validation procedure.) --->
System.Security.Authentication.AuthenticationException: The remote
certificate is invalid according to the validation procedure. at
Microsoft.Azure.Devices.Client.InternalClient.<>c.b__62_2(Task
t) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&
currentTaskSlot) --- End of stack trace from previous location where
exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at SampleModule.Program.d__10.MoveNext() in
/app/Program.cs:line 69 --- End of inner exception stack trace --- at
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions) at
System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,
CancellationToken cancellationToken) at
SampleModule.Program.Main(String[] args) in /app/Program.cs:line 41

Resources