azure devops : winrm sql server db deployment task : Connecting to remote server failed - sql

Getting below error on winrm SQL server DB deployment task in azure devops ,
Microsoft.PowerShell.Commands.WriteErrorException: Deployment on one or more machines failed.
System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server 1xx.xx.xx.xxx failed with the following error message : The
client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult
the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service,
run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the
about_Remote_Troubleshooting Help topic.

The hosted agent doesn't have a route to your on-premise network. You'll need to install and configure a self-hosted agent that resides within the network you're trying to connect to.

Related

unable to connect to azure sql server from vsts

I am trying to deploy test.dacpac file using vsts to azure sql server, Given connection details properly and it is getting connected if I try to connect it from visual studio.
But when it tries to deploy file using vsts, gets error message -
A network-related or instance-specific error occurred while
establishing a connection to SQL Server azure
Not sure why this is happening.
Note: There is no firewall rule applied, it has default settings, though the virtual machine on which VSTS agent is installed is in another Azure AD subscription.
Do I have to look into VPN for this?
Please use the FQDN for database name instead of the IP address. e.g. myAzureSQLDB.windows.database.net.
You need to configure Azure SQL Database firewall. Make sure "Allow access to Azure Services" is turned on. If that does not work, then try adding firewall rule 0.0.0.0 to 255.255.255.255.

TFS Configuration Error

I am facing a problem that when i try to configure my TFS it show me the following Error Message
Error
TF255049: A connection cannot be made to the server that is running SQL Server. Verify that you have entered the correct name for the server, including the instance name, that the server you are attempting to connect to is online, and that you have the required permissions to connect. If you are attempting to connect to the remote SQL Server instance, then verify that it is configured to allow remote connections, that TCP/IP protocol is both enabled and configured to use port 1433 (default), and that Windows Firewall does not block this port.
Check whether the SQL version is supported by the TFS version: https://www.visualstudio.com/en-us/docs/setup-admin/requirements#sql-server
Check the permission of the account that you use, and make sure it belongs to SysAdmin Server Role.
As #Daniel mentioned in comment, follow the troubleshooting steps provided in the error message, and check this blog to see whether it is helpful: https://elhajj.wordpress.com/2013/02/25/workaround-error-tf255049-punching-a-hole-through-windows-firewall/
I was running an upgrade from TFS 2018 to Azure DevOps 2020.
After the server restart, the Azure DevOps Server Configuration wizard opened.
I was logged in as the local machine administrator and got this error (TF255049: A connection cannot be made to the server that is running SQL Server...) when trying to connect to my SQL Server machine (to chose the configuration database).
I logged in as Network Administrator, started the wizard again and the SQL connection worked.
To restart the Azure DevOps Configuration Wizard again...
Open the Azure DevOps Administration Console and choose Configure Installed Features to open the Server Configuration Wizard...

How to add a SQL Azure database and Service Bus to a Virtual Network?

I'm having trouble with Virtual Networks on Azure and I'm very new to all this, so apologies in advance if my question is rather naive.
Problem:
I have a "azure cloud service" (a web application) that has now been added to a azure virtual network. But now it is not able to connect to the SQL Azure database with the following error message:
SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.)]
A Virtual network has been created via the Azure portal following these steps:
http://www.windowsazure.com/en-us/manage/services/networking/create-a-virtual-network/
Then I added the following config to ServiceConfiguration.cscf
<NetworkConfiguration>
<VirtualNetworkSite name="SomeNetwork" />
<AddressAssignments>
<InstanceAddress roleName="Some.Web.App">
<Subnets>
<Subnet name="AName" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
Question
How do I add SQL server to the Virtual network somehow? I have read a few articles and all are directing towards creating a VM in azure and then adding the VM to the virtual network? Is this the only way?
The web application also uses Azure Service Bus and it too now has connectivity issues due to the virtual network. I'm clearly missing something.
You can avoid manual whitelisting of IP addresses on database level by simply making your Azure SQL database a 'linked resource' in your Cloud settings (Cloud -> pick yours -> "Linked Resources").
That way you can connect to Azure SQL Database from cloud app with no extra configuration, except using existing database connection params.

WebDeploy gets Unauthorized error while deploying via remote Web Deployment Agent

I have a remote server (Win2008R2) with WebDeploy 3.0 installed on it. Web Management Service isn't installed on it (actually I tried to install it but it cannot be contacted due to closed ports on my side).
I'm trying to deploy a package (zip) to the server via local WebDeploy 3.0 tool.
Server.deploy.cmd /T /M:myserver.no-ip.org "/U:myserver\Administrator" "/P:pwd" /A:Basic
I tried both Basic and NTLM auth methods.
I'm getting error:
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'myserver.no-ip.org' using the Web Deployment Agent Service, but could not authorize. Make sure you are an administrator on 'myserver.no-ip.org'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
Please note that I'm actually connectin to WebDeploy Agent Service not Web Management Service. That's important as there are tons of info how to setup WMSrc with WebDeploy.
I know that WebDeploy Agent only supports connecting as Administrator. That is my case - I'm specifying the remote server Administrator credentials.
I tried to open WDAgentSrc url in the browser. I was promted for creditials and they were accepted.
I checked "Microsoft Web Deploy" log in the Event viewer - it's empty.
How to get it working?

Unable to connect to SQL Azure remotely from SSMS 2012

I am unable to connect to my SQL Azure database instance remotely using SQL Management Studio 2012. Firewall exception is in there for my local IP. I can connect successfully and admin the database using the browser based management link in my Azure account.
I just can't seem to connect to the database via SSMS or anything else like VS2012.
Here is the format I'm for my connection in SSMS:
Server Name: myservername.database.windows.net
Authentication: SQL Server Authentication
Login: myusername#myservername
Password: my-password
Connect to: (i've tried) "master", mydatabasename, <default>
Encryption: TRUE
Once again, I DO have the firewall rule active for my local IP address on the server instance of my Azure account.
When I attempt to connect, I receive this error:
A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. (provider: SSL
Provider, error: 0 - the wait operation timed out.) (Microsoft SQL
Server, Error: 258)
When searching for that 258 error, I do not get many results related to SQL Azure. I appreciate any help.
Error 258 is generated due to some of the configuration within your machine if a secure network could be established between two endpoints and if one machine initiate secure channel. This problem could be very much machine specific and not SQL specific that why you did not find any resources on this regard.
Can you try using SQLCMD as described in the following troubleshooting guide and see if that works to isolate SSMS specific issues on the same machine:
http://social.technet.microsoft.com/wiki/contents/articles/1719.windows-azure-sql-database-connectivity-troubleshooting-guide.aspx
IF you capture and analyze network packets traffic you might be able to determine the root cause of connectivity error.