should I use azure connect in this scenario - asp.net

My webapplication hosted on windows azure needs to communicate with TFS Server.
my webroles connect to TFS using a uri similar to (http://ed12-ektfsp-01:8080/tfs/eeol/ )
While on azure I found that my webrole failed to communicate with tfs server.
Do I need to enable "azure connect" for for my azure webrole to
communicate with tfs ?
Do I need to remote into my tfs server and
install azure connect into my TFS server for the azure connect to
get enabled ?
Why azure cannot communicate using
"http://ed12-ektfsp-01:8080/tfs/eeol/ " ?

Your web application does not know the server ed12-ektfsp-01 (I'm assuming this is a server in your datacenter/in your internal network). But there are a few options to allow your web application to connect to this server even if it isn't hosted in Windows Azure:
Configure your firewall to allow traffic from the internet to reach the server ed12-ektfsp-01. This is probably something you do not want to do, unless the server is already available (maybe for developers working at home). Then instead of using the machine name, use the public domain instead (like tfs.mycompany.com) if it's available.
Like you already mentioned, use Windows Azure Connect. This allows you to create a secure tunnel between your roles and your datacenter/internal network. You'll be able to connect to ed12-ektfsp-01 even if it's not exposed to the internet through your firewall. In order for this to work you'll need to install the agent on each server you want to connect to your role, this includes your TFS server.
You can connect your role to a Virtual Network. Then you can use a VPN device on-premises to create a site-to-site VPN connection to this Virtual Network. See the tutorial here: Create a Virtual Network for Cross-Premises Connectivity
You can use Service Bus Relay. This allows you to create a WCF service that calls TFS and host that service within your datacenter/network, but publish it to the cloud. Your web application will be able to consume the WCF service as if it were hosted in Windows Azure.

Please take a look at my answer to this question.
As for your specific questions:
Do I need to enable "azure connect" for for my azure webrole to
communicate with tfs ?
YES.
Do I need to remote into my tfs server and install azure connect into
my TFS server for the azure connect to get enabled ?
YES. And add both the WebRole and the TFS Server into single Connection Group.
Why azure cannot communicate using
"http://ed12-ektfsp-01:8080/tfs/eeol/ " ?
Because the address given is known only within your corporate network, and only resolved by the Company's DNS server. Noone outside can access this address.

Related

configuring a Windows Server 2012 VM using IIS to call Azure

I'm setting up an ASP.NET MVC5 application on a Windows Server 2012 VM running .Net 4.5 and IIS8. I've always leverages Azure for App and DB services (thank you Azure for your seamless 10 min server setup and publishing solution!) however I need to host this app using this alternative method. The VM is not an Azure VM. I've managed to configure the VM and publish the application (10 hrs of head banging experience... ) however when the application attempts to make a call to the Azure Db during the form registration process I receive a time out error; "The wait operation timed out".
My question is; I can access the application via the ip address from my local machine, I think port 80 is open by default. Do I need to specifically target this port in the applications web.config file for I/O calls?
If you want to connect a non-Azure Virtual machine which is behind a firewall to the resources in Azure, you will have to create a virtual network with either site to site or point to site VPN enabled. Please check this link which explains how to do it. https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-howto-site-to-site-resource-manager-portal/

Connecting to database in asp.net website by Wp8 app

I created localhost website in asp.net in Visual Studio and i added there a MSSQL connection.
My problem is that I created an app for windows phone 8 but i dont know how to connect this app with database which is on this website.
Can you help me with this?
First of all: your Windows Phone app can't connect to a SQL Server database, so you'll have to create an API.
Since you're using ASP.NET, I suggest to have a look at Web API. In short: you'll have several URL endpoints which return json/xml to your Windows Phone app. It's your job to query the database and return a single item/list of items in the controller of that URL endpoint (this sentence will make sense if you read into creating a Web API).
Next task is connecting to this API. Normally you would host it on a public url, so your phone device can connect to it (a phone doesn't know about your pc's localhost). If you want to use localhost with the emulator for testing, you'll have to execute the tasks mentioned in the quote below as this doesn't work out of the box.
When you create a WCF web service in Visual Studio, by default the
service is hosted in IIS Express and only accepts connections at
http://localhost/. Apps that target Windows Phone OS 7.1 can connect
to the development computer as localhost because the Windows Phone 7.1
emulator uses the network connection of the development computer. The
Windows Phone 8 Emulator, however, configures itself as a separate
device on the network. As a result, an app running on the Windows
Phone 8 Emulator can’t connect to the development computer as
localhost. Before you can connect successfully from the emulator to
the local web service, you have to make two changes:
You have to configure the local web service and web server to accept connections from other devices on the network.
You have to configure the service reference in the Windows Phone app to connect to the service by using the IP address of the development
computer on which the service is running.
Source: https://msdn.microsoft.com/en-us/library/windows/apps/jj684580(v=vs.105).aspx

Access TFS from Azure Service

In my application, I have to show the work items of logged in user. I have tried to pull work items of TFS from the application and It’s working fine on local server, but when it is deployed to the cloud server, it is not working and getting error message saying ‘TF400324 : The remote name could not be resolved’, as a cloud application is trying to ping internal TFS.
Is there any way to connect to internal TFS from the application hosted on cloud server ?
Many thanks in advance..
You can setup an Azure VPN tunnel between your cloud service and your internal network:
http://azure.microsoft.com/en-us/services/virtual-network/
Or you could expose your internal TFS to the internet:
http://msdn.microsoft.com/en-us/library/bb668967.aspx
Or you could use the Azure BizTalk Hybrid Connections to enable the communication:
http://azure.microsoft.com/en-us/documentation/articles/integration-hybrid-connection-overview/
After multiple tries, Service Bus Relay Binding is the one, to ping on-premise environment(internal tfs) from azure cloud server(web role).
The below link works like charm..
Service Bus Relay Binding
Hope It Helps to Somebody who has faced the same issue I've faced. Have Fun..

azure connect between azure myWebRole and nonazure server not working

My webapplication hosted on windows azure, needs to communicate with TFS Server. When any one login to my web app using live id, I want the logged in user to use my Team foundation server(TFS) credentials -username,password and domain to programatically authenticate and connect to our TFS server and create some work items.
I configured my azure connect for the communication to happen between azure WebRole and TFS server (our TFS is non-azure ).I added both the WebRole and the TFS Server into single Connection Group
In my azureportal ,I can see mywebrole and my TFSServer as connected the machine endpoint is active, and that it refreshes since the last connected updates
.But when I try to run my web application from azure and when it tries to communicate with our TFS server ,its throwing error message saying Error message : Team Foundation services are not available from server eg.,http://xyz-abcxyx-01:8080/tfs/eas/. Technical information (for administrator): The remote name could not be resolved: 'xyz-abcxyx-01'
Any suggestions to resolve this issue ?
You should enable remote desktop on your WebRole and connect to one of your instances. Then, try to ping the IP of your TFS server (not the hostname xyz-abcxyx-01). Maybe this is simply a DNS issue (even though using hostnames works with Windows Azure Connect).
If pinging the IP works, but pinging the hostname doesn't work you have a few options left:
Use the IP instead of the hostname. This won't work if you configured your TFS to use host headers.
Create an elevated startup task to modify the hosts file and map the IP to the hostname. In your code you can keep working with the hostname.
Try to modify the DNS server configured in your WebRole to use the default DNS server + your internal DNS server. But to me this doesn't look like a clean solution.
Anyways, in each solution you'll want to store the IP/hostname in the ServiceConfiguration and make sure your code supports changes to the ServiceConfiguration. This will allow you to change the IP/hostname without having to redeploy.
You should check if TFS server is listening on all network interfaces, include the one created by Azure Connect (start with 2a01). Next try to connect to TFS from a machine on the local LAN, just to make sure it is configured correctly. You don't need to use IP for referring to TFS, DNS name is definitely supported out of box.

Accessing remote web application using LogMeIn Hamachi2

I am trying to remotely access a web application hosted on the office LAN.
I have setup LogMeIN Hamachi and I can connect to an office machine and see shared resources (folders and printers) on that machine.
I selected a Hub-and-spoke network and made the machine with the web app the hub.
While in the office I type http://192.168.1.6:8080/mituz_oc in my browser to get access to the web app.
However, when I try to do the same remotely I get the message "Firefox can't establish a connection to the server at 192.168.1.6:8080."
So I see that the IP address to the computer I have VPN-ed to is 5.14.212.196 and so I try to gain access to the web app by replacing the office LAN's IP with the Hamachi IP (I can only post one hyperlink hence the verbose alternative )
I get the same error message as before, only this time with the HAMACHI IP address.
I can access all the shared resources but can not access the web app.
Is it possible to do what am attempting - remotely access a web application on office server?
If so what am I doing wrong / not doing ?
TIA.
Clemens
1) Check if your Windows Personal Firewall setting blocks connections from Hamachi's 5.x.x.x IP address ranges.
2) Check if your Web Server listens on 5.x.x.x. You can find it out by this command:
netstat -na
Look for local address of "0.0.0.0:8080" which is in the state of "LISTENING".
3) Replace Hamachi with different VPN provider, like www.remobo.com
(Disclosure: I work for the Remobo team)

Resources