Azure Domain binding Issue - asp.net

I bought a domain on Azure I hosted my application on the Azure portal. The problem I have it is not showing my app. but on sub-domain, my app is running correctly, but when I am trying to access main domain it is not working I know it is DNS issue. Can anyone help me out
http://www.coinunderpant.com/ --->Main Domain
http://agha.coinunderpant.com/ --- Subdomain
http://root.coinunderpant.com/

Please note that www.coinunderpant.com is also a subdomain, you should bind it to your app just like what you have done with agha.coinunderpant.com.
If you need coinunderpant.com point to your app, you should enable the A record mapping in the app.
You can refer to https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain for more details.

Related

ASP.Net redirecting to local host after authentication

I just created a webform that is hosted in my Azure subscription. I set it up with authenication via my works Azure directory for authenticating users. In debug this works fine and I am able to login with my work credentials and then view the website via local host.
I have published this to my Azure and it says it is running and working fine. So when I try to connect to the website it continuously redirects me to the localhost resulting in an error.
I have checked the web config.
Here is the google network chain of events when it occurs.
I am really lost as to what is wrong and what I need to do to fix this so any help would be greatly appreciated. I'm sorry I can't offer more but I don't even know what is wrong to begin with or where to look. Is there some setting in Azure that I need to add the website too?
I have solved this issue. Since it was such a pain I will keep this up as I couldn't find any answers on this. It was actually quite simple.
You have two options. The one I did and which worked was changing the publish profile as below:
Add the domain where the authentication is occurring. So if you have your web app hosted by a different azure account that which is authenticating the users, use the one that is authenticating.
This will create two versions of your app on the site one for local host and one for the actual site.
The second option(I have not tried this but it should work) is to go to the Azure account where you are authenticating the users and go to applications and then configure. Change the APP URL from local host to the url you are trying to get to.
Here is an excellent link that explains how to do this clearly.
Click this link for detailed explanation
I also had this issue and took these steps to resolve
navigate to the app registration in AAD
Open the manifest
Change the ReplyUrl to the url of the app (e.g. http://appname.azurewebsites.net)
Then I got the error
Bad Request - Request Too Long HTTP Error 400. The size of the request headers is too long.
Next I cleared all cookies from the browser, and this changed the error to just
Bad Request
So I went back to that ReplyUrl and changed it to https://appname.azurewebsites.net/.auth/login/aad/callback and now it appears to work.
Note I also had to make sure I didn't have the site open in any other tabs before it started working
I had this issue when I switched an app from our company Azure over to a customer's Azure. In my case I'd forgotten to update the ida:ClientId, ida:AADInstance and ida:TenantId, which then meant that the value I'd set for ida:PostLogoutRedirectUri was ignored (I think) and instead my app redirected to localhost.
Once I changed those ida values to the values from the app settings and subscriptions settings on our customer's Azure it all worked as expected.
It took a while to track down all the values in Azure portal as they are all called something different, or aren't named at all:
ClientId can be found at Azure Active Directory > App Registrations > YourAppName. It's called 'Application ID' in Azure
Domain can be found on Azure Active Directory > Overview. It's currently in the top left in the format somename.onmicrosoft.com
TenantId this is the Azure AD instance ID, get that from Azure Active Directory > Properties and then it's called 'Directory ID'
I spent a lot of time trying to work out where the localhost port that was being redirected to was in the code, but it simply isn't there as far as I can see, so I have no idea how Azure was choosing what localhost address to redirect to!
You need to set another parameter in configuration that is replyUrl and assign to your web app, other wise it takes the url from which it was originated.
I was able to fix this by changing my Startup.Auth.cs file redirectUri from "https://localhost:44316/" to https://myapp.com/

Host Azure website application to another domain

Currently my application url is xyz.azurewebsites.net. I have to host that application to another domain like www.xyz.com. I have company's domain and I have to host from xyz.azurewebsite.net to company's domain.
I don't know how to host from azurewebsite.net to another domain.
Please suggest me proper steps.
Thanks!
I'd suggest you configure a custom domain name for your web site. Since you already have company's domain as the custom domian. You just need to do below two basic steps:
1.Create DNS records that map the domain to your Azure web app.
2.Add the domain name inside the Azure Portal.
Note: Setting a custom domain name is only available for the Shared, Basic and Standard modes for Web Apps. Before switching a web app from the Free mode to the Shared, Basic or Standard mode, you must first remove spending caps in place for your Web Apps subscription.
For detailed information, please refer to this MS article.

Setting up asp.net test server

I am creating a website in asp.net MVC 4 and am wondering the best way to set up a test server?
I am doing this from home and would like a way for my friend to test my code from a different location (his home). What would the best way to go about this? Build a local server that he only has access to? VMWare? Online web hosting?
One solution would be to use a VM and set up a server.
NOTE! that this would require your friend to redirect your IP Adress to the host name you will set for your website on the IIS of your VM.
He can easily do that by changing his Hosts at C:\Windows\System32\drivers\etc
Another option would be actually to purchase a domain (that you will need anyway eventually)
The purchase a hosting package (that you will also need anyway eventually).
Then setup your website on a sub domain in that hosting server e.g. dev.myDomain.com

Test Flex/Facebook Application localy

I´m new in Flex.
I'm trying to develop a Web Application integrated with Facebook.
I´m using Flash Builder 4.5 and the Adobe Facebook SDK.
The problem is that to test the application I need to upload the files to my webserver to avoid the facebook error.
I guess this is because Facebook only allows to run the application inside the domain that informed at my app page on Facebook.
Someone knows how can I test the application locally?
Best, Flávio
One way to test your application is to create a copy of your app on Facebook (i.e. register a new application), but set it up to point to localhost (i.e. your local development server). This will let Facebook send all the login redirects back to your local webserver rather than your current 'live' website.
It would help if you install a localhost webserver on your machine so you can run code locally. This will allow you to test your files on your own machine rather than having to upload them every time.
Set up a local web server (I like Apache, but IIS will work). with a virtual server and give it the same domain name as your production server. Use a hosts file to point the domain back to your own server.
You can also use Charles to record the web traffic, then build mock services that will provide that information.

Best way to create a sandbox area on my asp .net host

I would like to create a sandbox area on my hosting provider that only the client can see. For example the production website would be at www.domain.com. However, would it be possible to create a sandbox version of the website at www.domain.com/sandbox and only provide access to the client?
If so, what is the best method? Do I manually have to create a login page etc in the sandbox folder? Or, can I publish the test website in the sandbox area and restrict access through my hosting provider?
Generally a sandbox/staging/test version of your production site would be a complete duplicate of your production deployment, not just the login page.
You'd have a separate copy of the application and the database, and then serve it via another hostname/IP address or on an entirely different machine.
For instance, you could have www.domain.com and test.domain.com, each with the own isolated version of the software. This way your client can play as much as they want in the sandbox without fear of damaging the production environment.
To restrict access you could use access control lists in IIS to restrict the sandbox to a specific ip address (or range), or enable basic support on it with a username/password required security.

Resources