Store Azure WebJobs connection string on to Azure Portal App Settings - webjob

I'm trying to store the Web Job connection strings on to Azure Portal. I've moved the connection strings there but Web Job keeps failing with error below:
[03/05/2021 01:59:23 > 2aff49: INFO]
stem.ArgumentException: ConnectionString should not be null, and empty string or consists only of white-space characters..
This is how I've setup:
And app config:
<connectionStrings configBuilders="connectionStringsBuilder">
<add name="xdb.marketingautomation" connectionString="" />
<add name="xdb.referencedata" connectionString="" />
<add name="messaging" connectionString="" />
</connectionStrings>

Related

Azure Pipelines NuGet.config packages failed to restore

I am trying to build an Xamarin app with a custom Nuget Config but the build fails when I get to the restore command.
I get the following error:
The nuget command failed with exit code(1) and error(Failed to retrieve information about 'BCrypt.Net-PCL' from remote source 'http://nuget.uxdivers.com/grial/FindPackagesById()?id='BCrypt.Net-PCL'&semVerLevel=2.0.0'. The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
The package "BCrypt.Net-PCL" is a NuGet package but the restore command is looking for it in the "uxdrivers" source.
If I run without a custom NuGet.config the restore can find all NuGet packages but obviously it fails to find the none NuGet sources thus the build fails as well.
I've tried shifting the order of the package sources, the credentials and tried a different vmImage but I always end up with this error.
See below my YAML:
- task: NuGetCommand#2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
See below my NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<clear />
<packageSources>
<add key="Grial" value="http://nuget.uxdivers.com/grial"/>
<add key="Syncfusion_Xamarin" value="https://nuget.syncfusion.com/nuget_xamarin/nuget/getsyncfusionpackages/xamarin"/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<Syncfusion_Xamarin>
<add key="Username" value="*MyUsername*" />
<add key="Password" value="*MyPassword*" />
</Syncfusion_Xamarin>
<Grial>
<add key="Username" value="*MyUsername*" />
<add key="Password" value="*MyPassword*" />
</Grial>
</packageSourceCredentials>
Azure Pipelines NuGet.config packages failed to restore
It seems the way you configured in the Nuget.Config file have a syntax error.
If there is encrypted password it won't work on a different machine as it's encoded with a key from stored on you dev machine. You could replace it with clear text password, like:
<add key="Username" value="%USER_VARIABLE%" />
<add key="Password" value="%PASSWORD_VARIABLE%" />
Or use the cleartextpassword:
<add key="Username" value="user" />
<add key="ClearTextPassword" value="xxxxxx" />
Check the document nuget.config reference for some more details.
Hope this helps.

NuGet Push Error 500 (without Proxy), Error 503 (with Proxy)

I try to Push a nupkg to a Artifacts in a Azure DevOps Server.
The network is behind a proxy so my C:\Users\user\AppData\Roaming\NuGet\NuGet.Config looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="FrameworkA" value="http://xfc-l-s6fc5086:8070/Samples/_packaging/FrameworkA/nuget/v3/index.json" />
</packageSources>
<config>
<add key="http_proxy" value="http://my-proxy:8000" />
<add key="http_proxy.user" value="domain\user" />
<add key="http_proxy.password" value="*** windows security key ***" />
</config>
</configuration>
From my feed (Azure DevOps) page I get the following information:
so if I execute:
nuget.exe push -Source "FrameworkA" -ApiKey AzureDevOps .\FrameworkA.1.0.0.nupkg
I get:
The response status code does not indicate success: 503 (Service Unavailable).
I remove the proxy information from my nuget.config and I get:
The response status code is unsuccessful: 500 (Internal Server Error - Error retrieving data from the upstream packet source https://api.nuget.org/v3/index.json): Error sending the request. (DevOps activity ID: 69FB4414-ED0B-4367-B121-B0DC9B366367)).
And I also get this meaasge when I remove the entry:
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
Whats going wrong here? Has anybody experience with Azure DevOps Server behind a proxy? (everything else with azure devops server works fine, REST API, Custom Extension, Build- and release tasks and so on)
Version: 17.143.28912.1 (AzureDevOps2019.0.1)
I got the same and solved it because of a typo. If I add the DevOps as Proxy it works.
<add key="http_proxy" value="http://devops.yourdomain:8080" />
That worked im my case. IDK why!

Exception while deploying ASP.NET Website after Using EF

I have two projects, one containing WS which access to the DB and the other one is front-end.
The two projects are deployed on seperate servers.
Before Using EF and linq for accessing the DB in the WS project, everything was working fine, but after that I got and exception saying "the underlying provider failed on open".
Please ca you help me with that. Thank you in advance.
Here is my ConnectionString (WS Project):
<connectionStrings>
-->
<add name="ConString1" connectionString="Data Source=#address,1433;Initial Catalog = MpCarteCoBrandee;MultipleActiveResultSets=True;Trusted_Connection=True;" providerName="System.Data.SqlClient" />
<!--<add name="ConString" connectionString="Data Source=AOUS-PC;Initial Catalog=TestMobilePayment;Integrated Security=SSPI" providerName="System.Data.SqlClient" />-->
<add name="MobilePaymentEntities" connectionString="metadata=res://*/MobilePayment.csdl|res://*/MobilePayment.ssdl|res://*/MobilePayment.msl;provider=System.Data.SqlClient;provider connection string="data source=#address,1433;initial catalog=MobilePayment;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />

MVC Connection Strings/LocalDb

Fairly new to MVC so this probably seems like a fairly newbie question.
I've been developing my application using a SQLExpress instance/LocalDb, I'm now ready to deploy my site to production, so my question is how do I configure my web.config file for this environment?
My database has been created in production, I'm just struggling with establishing the connection strings.
I'm using a host that I think does not support LocalDB (GearHost), but sources seem to suggest this is possible (even though I've not found any decent examples).
My current development connection strings are below.
Thanks
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MyApp-20160204160648;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MyApp-20160204160648.mdf" />
<add name="MyEntities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=MyPC\SQLEXPRESS;initial catalog=MyDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
I have a MVC project.I use two conectionString as following
<add name="matematikEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=MYSERVERNAMEONHOST;user id=MYUSERID;password=MYPASSWORD;persistsecurityinfo=True;database=MYDBNAME"" providerName="System.Data.EntityClient" />
<add name="matematikEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;user id=root;password=MYPASSWORD;persistsecurityinfo=True;database=MYDBNAME"" providerName="System.Data.EntityClient" />
When i publish the project,i comment first one and second is active,when i work on my PC i comment second and first one is active.This works.

Web Deploy removing quotes in connection string

The last quote escape is being removed in the webserver web.config when using webdeploy.
Any ideas why?
I've currently having to log on to the server and readd it everytime I publish the site!
<add name="Entities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="server=server;database=db;user id=1;password=password;MultipleActiveResultSets=True;App=EntityFramework;"" providerName="System.Data.EntityClient" />
becomes:
<add name="Entities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="server=server;database=db;user id=1;password=password;MultipleActiveResultSets=True;App=EntityFramework;" providerName="System.Data.EntityClient" />
Try to remove ";" (semicolon) before
&quot
try this,
<add name="Entities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="server=server;database=db;user id=1;password=password;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />