"The remote server returned an error: (407) Proxy Authentication Required." Error when registering deployment group in Azure Devops - powershell

I'm getting the following error when I try to run the powershell script generated by Azure Devops to config my deployment group. How do I fix this.
"The remote server returned an error: (407) Proxy Authentication Required."

It looks like you're behind an authenticating proxy. Powershell isn't great at handling them - some PS commands use the system proxy, some don't. There's several ways of working around it though if you search for that specific issue.
You could try this added to your script (just insert at the start of the script), which takes your current credential/proxy and passes it to the any web requests:
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy()
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

These types of messages are not unique to anything with Azure. It's purely an environmental network issue, that you must implement in your code.
Similar posts have been asked here...
The remote server returned an error: (407) Proxy Authentication Required
... but they actually showed what their code looks like when making a request ...
myProxy.Credentials = NetworkCredential("user", "password", "domain");
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<bypasslist>
<clear />
</bypasslist>
<proxy proxyaddress="myproxy:9000"
usesystemdefault="false"
bypassonlocal="true"
autoDetect="False" />
</defaultProxy>
</system.net>
... whereas you are not. I point you back to the SO rules in my comment.
So, see that SO, to determine if anything in that thread helps you.

Checking the powershell script, you can find it calls .\config.cmd --deploymentgroup ....
So, you can edit it to specify proxy information:
./config.cmd --proxyurl xxx --proxyusername "myuser" --proxypassword "mypass" --deploymentgroup ...
More information: Run a self-hosted agent behind a web proxy

Related

ADMU0509I: The Application Server "server1" cannot be reached. It appears to be stopped

I have setup a WebSphere Application Server on my RHEL 7 virtual machine. When I start the server, it starts fine and I can access the admin console but when I try to stop or get the status of the server using the script
sh stopServer.sh -server1 / sh serverStatus.sh server1
It gives the following message,
ADMU0509I: The Application Server "server1" cannot be reached. It appears to be stopped.
My wsadmin scripts are not working, when I run the script
sh wsadmin.sh -user wasadmin -password Password
I get the following error
WASX7023E: Error creating "SOAP" connection to host "localhost"; exception information: com.ibm.websphere.management.exception.ConnectorNotA
vailableException: [SOAPException: faultCode=SOAP-ENV:Protocol; msg=; targetException=java.net.MalformedURLException]
WASX7213I: This scripting client is not connected to a server process; please refer to the log file /opt/IBM\WebSphere/AppServer
/profiles/AppSrv01/logs/wsadmin.traceout for additional information.
I can access the console on the browser without any issue.
To expand on this more specifically. The file ssl.client.props looks like this typically around the com.ibm.ssl.protocol property:
$ grep -i tls -C 2 /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/properties/ssl.client.props
#-------------------------------------------------------------------------
com.ibm.ssl.alias=DefaultSSLSettings
com.ibm.ssl.protocol=SSL_TLS
com.ibm.ssl.securityLevel=HIGH
com.ibm.ssl.trustManager=IbmPKIX
--
#-------------------------------------------------------------------------
#com.ibm.ssl.alias=AnotherSSLSettings
#com.ibm.ssl.protocol=SSL_TLS
#com.ibm.ssl.securityLevel=HIGH
#com.ibm.ssl.trustManager=IbmX509
This property can take a number of values:
This property is the SSL handshake protocol that is used for this SSL
configuration. This property attempts Transport Layer Security (TLS)
first, but accepts any remote handshake protocol, including SSLv3 and
TLSv1. Valid values for this property include SSL_TLS, SSL, SSLv2
(client side only), SSLv3, TLS, TLSv1, SSL_TLSv2, TLSv1.1, and
TLSv1.2.
These values are described in this table:
References
ssl.client.props client configuration file
Appendix A: Protocols and Cipher Suites
For me this problem came when the security level of the WAS was not consistent.
In the IBM console, it was set to TLSv1.2 and in ssl.client.props file it was set to SSL_TLS. Once they were changed to the same value my console could connect to WAS.

Not able to access Coldfusion Rest Service through website url - Coldfusion

My coldfusion version is 10 and configured with iis. I have configured Rest service using the following code
<cfset restInitApplication(getDirectoryFromPath(getCurrentTemplatePath()), "myservicename") />
My cfc which is in same directory looks something like that
component restpath="test" rest="true" produces="application/json"
{
remote array function getResult(
required string tmpID restargsource="path",
string startDate restargsource="query",
string endDate restargsource="query"
)
httpmethod="GET"
restpath="{tmpID}"
{
return arguments.tmpID;
}
}
I am trying to access the rest service by url but it is giving me 404 not found error. Here is url which i have tried.
http://localhost:8500/rest/myservicename/test/10221
http://example.com/rest/myservicename/test/10221
http://127.0.0.1/rest/myservicename/test/10221
But all three is not working for me. When i try to refresh the service from coldfusion administrator, it is giving me following error.
Unable to refresh REST service.
Application myservicename could not be initialized.
Reason: The application does not contain any rest enabled CFCs.
The application does not contain any rest enabled CFCs.
I have save my cfc to webroot of iis and update the root path of rest service through coldfusion administrator. Then above error is gone and got the green message 'Server has been updated successfully'. But still not accessible through any url. Still getting 404 error. Can any one point me where i am doing wrong? Or help me to resolve this issue.

coldfusion REST service, 404 not found

I cannot seem to get my REST service to work... I get a 404 when I call the URL.
Im running Win 7, CF 10 developer, Apache webserver. I've developed on this for years, so the setup works - but this is my first go at REST services thru CF... I mention that because CF is working, the dir and webserver are working etc.
Directory looks like this
C:\wwwroot\restTest
CODE - saved as "obj1.cfc" - ( Note: I've tried restpath with and without the / )
<cfcomponent restpath="/restTest" rest="true" >
<cffunction name="getMethod" access="remote" returntype="String" httpmethod="GET" >
<cfreturn "this is a string returned" />
</cffunction>
</cfcomponent>
The coldfusion ADMIN setup looks like this
Root path: 'C:\wwwroot\restTest'
Service Mapping: 'test'
I'm using the service mapping because I don't have an associated application name - no Application.cfc - I was trying to keep this super simple.
I get a green 'success' message when I set that path
Browse to -
127.0.0.1/rest/test/restTest/
result - 404
What am I doing wrong? It is my understanding that "/rest/" is a default mapped path in CF for routing the service - I may be wrong, but I know I read it somewhere - and the examples all use it. I also believe I can change that either in the admin or in some XML file...
Turns out - Apache needed this line added to the host (or globally in the config)
JkMountFile "C:/ColdFusion10/config/wsconfig/1/uriworkermap.properties"
Once I added that... all was good.

Request for ConfigurationPermission failed while attempting to access configuration section 'paypal'

Hoping you will be doing good i am having some problem on my hosting server when i implement PayPal using Rest API Sample of Paypal and using Log4net
<section name="paypal" type="PayPal.Manager.SDKConfigHandler, PayPalCoreSDK" requirePermission="false"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false"/>
All working fine on Local System but when i deploy it to my GoDaddy Server its not working. Currently i am using SandBox Credentials.
It is showing Error
"Request for ConfigurationPermission failed while attempting to access configuration section 'paypal'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared."
And sometime is is showing this error: "Request Failed"
Please help in this context.
Thanks,
Adeel

Unable to connect to ADAM with Windows domain\username

I'm having some difficulty connecting to an ADAM instance from my Commerce Server 2007 ASP .NET solution, and I believe it relates to my config file somehow. The short version is that I can connect to ADAM through ADAM-ADSIEdit with my current username/password, but when I put this in my web.config i get "Parser Error Message: Logon failure: unknown user name or bad password."
<connectionStrings>
<add name="LDAPConnection" connectionString="LDAP://<domain/>:389/<Partition DN>" />
</connectionStrings>
<membership defaultProvider="MembershipADAMProvider">
<providers>
<add name="MembershipADAMProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LDAPConnection"
connectionProtection="None"
connectionUsername="<domain>\<username>"
connectionPassword="<password>"/>
</providers>
</membership>
I've tried a bunch of things to fix this and haven't come up with any kind of reasonable solution. I started with just the connection String and no username or password. I got an error saying that I could not make a secure connection. that's when I added the connectionProtection="None" line. Then it said I could not use default credentials without a secure connection, so I added the Username and Password fields. When I created the ADAM instance, I used the current Windows login credentials. I've tried to use my windows login credentials here in web.config, and I've tried with various domain names, pretty much anything I could think of. I'm totally lost why I cant bind with ldp and I can connect in ASIEdit with these domain\username and password but can't from my CommerceServer ASP .NET application...Is there some other step I'm missing?
Thanks,
John
You should follow the information here, there is a lot of good stuff about secure connections and how to disable them within your ADAM instance for development purposes.