Get Connection String Out of Publish settings and URL - publish

I have a publish settings file to deploy my asp core 5 code first application.
I am stuck at part how to publish my database.
i have publish url but i can't get connection string to be valid
let's say we have publish url like this:
https://Server:Port/msdeploy.axd?site=NameOfSite
what should i put in my Data Source part of connection string. now i am putting server:port but update-database not done successfully

Related

##[error]Error: NO JSON file matched with specific pattern: **/appsettings.json

I'm trying to deploy an Azure App Service using Azure Devops.
I'm using the Task Azure App Service deploy version 4.*
I started noticing the following error in the log recently with the deployment failing (saw it first on 24th September)
Applying JSON variable substitution for **/appsettings.json
##[error]Error: NO JSON file matched with specific pattern: **/appsettings.json.
In the pipeline I use the task Extract files to extract *.zip, then use the result to search for **/appsettings.json.
The same task was running fine till a few days ago.
I tried redeploying an old release which was successful earlier, but it failed now with the same above error.
I double checked, there was no changes done in the pipeline recently for this to break.
How can I fix this.
Turns out my issue was not with the task Azure App Service deploy, but with the task Extract Files.
A rough look on my pipeline is as below:
Before the fix
Extract files
Deploy Azure App Service
The JSON variable substitution failed because the Extract files task was not able to find *.zip files in the root folder and hence extracted nothing. So, there was no appsettings.json file in the folder structure at all.
The Fix
Update the Extract files task search pattern as **/*.zip
Now my pipeline looks like below.
Extract files
Deploy Azure App Service
It now works fine for me.

How to run local program (exe) via Chrome via HTML/javascript

I am trying to build a (single page) local portal in Chrome that opens several things.
The problem is we want to run a local executable via a button on a (local) webpage. Is this possible?
The second thing is that i want to do is to run a .pps file directly in the powerpoint viewer.
I can control to the startup of chrome, so i can access local files.
All things i tried so far only made the file(s) to download, not to run.
Can somebody help me how i get this done?
You can set a protocol like myapp://launch/activity or the like to automatically launch your app by setting up a registry key in HKEY_CLASSES_ROOT with the name of your protocol and the action it should take.
There is a MSDN article showing the following example of a registry for an alert protocol:
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"
Which would then be called by requesting a url with alert:YOURPARAMS, which would then call alert.exe YOURPARAMS.

AWS beanstalk deployment error

I have little problems with deploying an application.
I have an PHP environment. I have uploaded an .zip file in it containing 3 files - one.php, two.html and three.html. The problem is when I click on the environment URL also on my pure domain example.com I get the following error: 
Forbidden
You don't have permission to access / on this server.
However when I type the address with its extension, for example environmentURL/one.php or example.com/one.php it works great.
Can someone help me with this please. Why I'm unable to access my app via its first primary page?
You can't access your app via primary page because your app is missing an index. Add an index file (index.php or index.html) to your zip bundle and it should work.

HTML code to open PuTTY client from browser

I am trying to make a webpage which will have the entire inventory of servers that our team manages in the form of a table. I am using a simple LAMP stack and the inventory input as a CSV file.
The table has three columns: Hostname, IP address and device serial number.
While this works perfectly fine, I want to take this a step further and make every IP address in the table a hyperlink, clicking which will open an SSH client, which will connect to that IP address. Any cues to how this can be done? I was hoping there would be something like the the mailto: tag which opens an email client (Outlook window).
I've done it following the info of this blog post.
For future reference in case the original page becomes missing, here is the process:
you cannot directly map the ssh:// scheme to PuTTY, but you can map it to an intermediary script which will in turn launch PuTTY with the right arguments. Mine is called putty_ssh.bat and has the following content:
#echo off
set var=%1
set extract=%var:~6,-1%
start "C:\Program Files (x86)\PuTTY\putty.exe" %extract%
the script has to be registered in the registry. You can just create a ssh.reg file with the following content and open it (customizing last line as needed):
REGEDIT4
[HKEY_CLASSES_ROOT\ssh]
#="URL:ssh Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
#="\"C:\\path\\to\\putty_ssh.bat\" %1"
When I click on ssh:// links in web pages, it now opens PuTTY.
PuTTY unfortunately does not associate itself with the ssh:// or any other URLs.
You can associate an application with a protocol manually. But it's not trivial. For instructions, see below.
Easier way is to install WinSCP SFTP client. WinSCP 5.9 and newer registers itself to handle the ssh:// URL and opens the session specified by the URL in PuTTY.
So basically, if you just install WinSCP, it will make PuTTY handle the ssh:// URLs, without the below manual tweaks.
(I'm the author of WinSCP)
To register an application manually, see the MSDN article Registering an Application to a URI Scheme.
Basically you add a registry key like:
[HKEY_CLASSES_ROOT\ssh]
#="URL: SSH Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
#="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\",0"
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
#="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\""
Though the above passes a whole URL to the PuTTY command-line. And PuTTY does not understand the ssh:// prefix. So you would have to add a wrapper script that strips the ssh:// and passes only a user and a host to PuTTY.
For that see:
https://johnsofteng.wordpress.com/2009/05/12/launch-putty-from-browser/

Can not load webpage in Rest webservice using apache wink

I have successfully implemented rest webservice using apache wink. I am using ant to build war and to deploy it to tomcat server. Now I want include html or jsp file in the project to display some results. But I dont know how to include it via ant build file. I tried copy and pasting the html file in the root folder as well as web-inf folder in tomcat's webapp folder and than restarted it. But so far I am not able to access it. Whenever I try to access html page it gives me error
org.apache.wink.server.internal.RequestProcessor - The following error occurred during the invocation of the handlers chain: WebApplicationException (404 - Not Found) with message 'null' while processing GET request sent to http://localhost:8080/outliers/index.html
Please help me how can I include html file in my server.
Basically you should just put the html file in the war's root directory. \
Don't put it in WEB-INF, it's is not accessible from the web!
If the html file in root directory, and you still cannot access it, check that tomcat started without errors. Sometimes errors are not displayed in console, so check the logs.