Publicly expose local [ASP Web-] API - windows

I'm trying to expose an ASP WebApi to the internet for testing purposes. I thought that this can't be too difficult, but here I am, asking for help. I'm a novice when it comes to networking so please, be as explicit with instructions.
When I run my API application locally, hitting https://localhost:44316/{api-method} (or http://localhost:49511/{api-method}) executes the API method. How can I configure IIS/my machine/firewall/whatever-I-need-to in order to be able to hit the API at https://<my public IP>:44316/{api-method} (or http://<my public IP>:49511/{api-method})? The ports 44316 and 49511 are defaults, I didn't select them (I'm guess that's obvious and probably irrelevant).
I'm also working on an Azure VM (this may or may not be relevant) and have added endpoints on ports 44316 and 49511 (both public and private, and not behind load balancing) already.
Additionally, I'm not overly concerned by security (though more knowledge won't go amiss) as I'll teardown anything that I've set up to get this working once I've done with testing.

You're on the right track. Adding the endpoints in the Azure portal is one step. You'll also need to open them on your Firewall if you have one up. The way to do this depends on what kind of server you're running. Assuming it's a Windows 2012 server, go to the Server menu, check Tools -> Firewall, and add Rules for inbound and outbound on the ports that you want.
One thing to note is that Azure doesn't respond to 'ping' commands in the expected way, so it may not look like your rules are working if you're just using Ping to test. However it will work with your API.
I have a blog post that breaks down steps to run a multiplayer game using Azure which shows the Firewall setup. Steps 6, and 10 are the important ones but you've already done 10. http://secondtruth.com/2014/12/how-to-simulate-a-tiny-universe-in-azure/
Here's the Windows 2012 Firewall setup in particular http://www.rackspace.com/knowledge_center/article/managing-the-windows-server-2012-firewall

Related

How to make my chat-bot accessible from a web page?

I've got my Node.JS bot builder chatbot all working in the emulator, but I'm not sure how I can get started in allowing my bot to be chatted to by others through the internet, on a web page.
I've seen this article, but this seems to be if we want to host the both through Azure. Additionally, I'm not sure how I'd link the code I made for the bot with this.
This is for a school project for a local company, so I'm fairly sure (and will ask) that they want this to be free to run on their own servers, instead of paying Microsoft.
Can anyone help me understand how this all works?
If you're using MS Botframework & LUIS, you will have to host your webhook somewhere to make it accessible to public. Now, if you do not want to spend a penny for hosting services, I'd like to suggest you one more bot platform dialogflow.com (api.ai) where they have built-in inline editor (Powered by Cloud Functions for Firebase). You will just have to write your code there & say deploy. You won't be charged unless you're using a standard edition.
Now, second thing, if you do not want to do any of these & still want to make it public, you will have to have your own servers & all & expose your IP. Put that computer in the DMZ of your router. That is what it is for. Or, simply forward the needed ports. But here you will have to manage everything on your own like if a server goes down etc. Hope this helps.

Windows Azure Caching (Preview) ErrorCode<ERRCA0017>:SubStatus<ES0006>:

I'm using the role-based caching feature for a windows azure web role.
Configured as co-located. I've followed the steps given by windows azure docs for caching (preview). I get the following error:
ErrorCode <ERRCA0017>:SubStatus<ES0006>:There is a temporary failure.
Please retry later. (One or more specified cache servers are
unavailable, which could be caused by busy network or servers. For
on-premises cache clusters, also verify the following conditions.
Ensure that security permission has been granted for this client
account, and check that the AppFabric Caching Service is allowed
through the firewall on all cache hosts. Also the MaxBufferSize on the
server must be greater than or equal to the serialized object size
sent from the client.). Additional Information : The client was trying
to communicate with the server: net.tcp://127.255.0.4:20010/.
I'm running everything as localhost, using the local development storage, my cache client is in the same role as the server. Changed many configuration attributes, but I always get that excpection or similar like "cannot connect to tcp....".
I'd appreciate some help. Thanks.
There are couple of things which could go wrong with your application.
Very first thing to make sure that you have SDK 1.7 in your machine even with Windows Azure Caching Services and then verify that you have reference set from Windows Azure Cache (not from Windows Server App Fabric SDK). I have seen such misconfiguration in past which lead to such errors.
Now have you changed your dataCacheClient, identifier to your ROLE Name as described in the documentation link here. If you follow the documentation as described to you should not hit any error so for the sake of checking what could be wrong, you can create exact same application as described in this link and see if that works or not.
To get more details error, please be sure to increase the DataCacheFactoryConfiguration.ChannelOpenTimeout value to longer i.e. 2 minutes then default 20 seconds as described here. This step will help you to get details about inner exception which may lead to actual root cause to your problem.
We use Azure co-located caching (not in preview anymore) as our session backer and have fairly regular outages. About once a month.
We tried using the Enterprise library Transient Fault Handling but our instances still hang when caching experiences problems. I think that the transient fault code would work for data caching, but for session backing there is some activity closer to the metal that we can't seem to code against.
The error codes have become more informative over the last year and go something like...
ErrorCode:SubStatus:The request timed out..
Additional Information : The client was trying to communicate with the
server: net.tcp://10.xx.xxx.xx:xxxxx/.
Our best guess so far from experimenting and MS support is that each, or at least one co-located cache role/instance needs to know about all the other instance's IPs, since Azure can destroy and re-up instances whenever they want, this sometimes fails to update the dependent instances. This is secret sauce for Azure, but it is not a secret when our site goes down. I'm looking for any more information on this and to see how others are working around this issue.
One possible work-around. One of our talented platform administrators found that resetting IIS on the instances and scaling up two more instances seem to help the problem. This makes sense to me because it gives caching another chance to gather all the required info about the other instances. This is NOT CONFIRMED to solve the problem but if we repeat this during the next outage it could be a valid work around.

How to use Windows Azure in Indonesia?

I plan to implement my website (asp.net & sql2008) using windows azure, but I have difficulty to do it because windows azure has not released yet in my location (Indonesia).
Should someone like to share the solution the same with my problem would be appreciated.
The question was asked on MSDN and the answer is that it is not possible. The only solution is to wait for Windows Azure available in your country.
MSDN Forum
Just run your apps on HK or Singapore Windows Azure Public Data Centers, these are the APAC Data Centers for your region.
for testing reasons, I wanted to create an Azure account, and faced the same here in Egypt.
I've made it by remotely logging into one of our U.S-based servers, and registered from there :) If you can't do so, and need this account badly, and don't have such server, try using TOR.
Update: TOR is a proxy-like solution for your internet connection, it will redirect all requests/responses to a node on the TOR network, which consists of volunteers like you and me.
so my solution is simple, we gonna use tor to simulate that you are inside one of the permitted countries, and register your account with ease.
what you gonna need is to install TOR and configure your browser to use it, but my personal recommendation is to install TOR browser bundle, it's TOR+a Browser that is pre-configured to use it.
you gonna find a nice video on the TOR browser bundle page that will give you an overview about it.
give it a try, and tell me what happened.

How do I know if I need Full IIS in my Azure web role?

I need to migrate an ASP.NET application to Azure. The application needs database access and access to temporary files and also using out-proc COM objects. Turns out there's "Full IIS" mode that offers some rather vaguely phrased advantages (from here):
However there are a number of useful capabilities that only exist in IIS, including support for multiple sites or virtual applications and activation of WCF services over non-HTTP transports through Windows Activation Services.
Now obviously using Full IIS forces me to deal with the ASP.NET part and role part working in different processes and that's a big deal so I need to know whether I need Full IIS mode in the first place.
How do I decide if I need Full IIS mode? Is there a full checklist?
I think your default answer should be use Full IIS in Windows Azure capabilities. The hosted web core offering is really there for backwards compatibility as it was the original model prior to 1.3 SDK. Full IIS is the default and you must explicitly opt to go back to HWC.
The reasons that most people wanted full IIS were around a few, but important limitations:
Better support for IIS extensions (e.g. Smooth Streaming, Web Farm, ARR, etc.). HWC did not always support the modules and combined with a missing admin permission, made it really hard if not impossible to use all the modules that folks wanted to use.
Support for multiple web sites, vdirs, and application pools. HWC is a single app pool (the hosting process) and no way to support multiple web sites. There was a serious concern about needing to dedicate 1 entire role to a single web site. With Full IIS, you can have multiple sites and use host headers to get more bang for buck out of web role (especially with small web sites)
Support for standard tooling - Web Deploy, AppCmd, etc. don't work really well (if at all) with HWC. Anything that modified the applicationHost.config usually had issues with HWC.
WAS support. This allows you to use WCF with IIS as a host in non-HTTP transports.
In general, with Full IIS you have parity with what you do on-premises so it makes it much easier to configure and setup.
Regarding the RoleEntryPoint/HWC process model versus the RoleEntryPoint and separate Full IIS process, I am not sure that is really an issue. There were a few quirks perhaps initially, but what concerns you the most about this?

Browser Sync across many machines

Everyone remembers google browser sync right? I thought it was great. Unfortunately Google decided not to upgrade the service to Firefox 3.0. Mozilla is developing a replacement for google browser sync which will be a part of the Weave project. I have tried using Weave and found it to be very very slow or totally inoperable. Granted they are in a early development phase right now so I can not really complain.
This specific problem of browser sync got me to thinking though. What do all of you think of Mozilla or someone making a server/client package that we, the users, could run on your 'main' machine? Now you just have to know your own IP or have some way to announce it to your client browsers at work or wherever.
There are several problems I can think of with this: non static IPs, Opening up ports on your local comp etc. It just seems that Mozilla does not want to handle this traffic created by many people syncing their browsers. There is not a way for them to monetize this traffic since all the data uploaded must be encrypted.
Mozilla Weave is capable of running on personal servers. It uses WebDAV to communicate with HTTP servers and can be configured to connect to private servers. I've tried setting it up on my own servers but with no success (Mainly because I'm not very good at working with Apache to configure WebDAV)
I'm hoping Mozilla Weave eventually allows FTP access so I can easily use my server to host my firefox profile.
If you're interested in trying Mozilla Weave on a personal server, there's a tutorial here:
http://marios.tziortzis.com/page/blog/article/setting-up-mozilla-weave-on-your-server/
Browser Sync is up on Google Code now. Doesn't look like anything has been done with it yet though, as far as making it hosted on personal servers/computers.
I've been using the Firefox Scrapbook extension, sync'd via FolderShare. It takes a little setup, but the nice thing is that Scrapbook grabs a local copy of each page so it works offline or if the site goes away.
Not a complete solution to this problem, but I've found FoxMarks to be a really nice bookmark syncing extension.

Resources