How can I use the Azure portal to position my App Service at a url which is not at the root of the domain? - azure

I have an Azure WebSite ... MyApp
This naturally places my application at http://MyApp.AzureWebSites.net
I also have a domain ... http://MyWebSite.com
I understand that I can upgrade my App Service Plan to one which includes Custom domain name support which will allow me to position my app at http://MyWebSite.Com/MyApp
What I would like to do is to position MyApp in a different location.
I'd like to be able to access it via http://MyWebSite.com/SomeOtherFolder/MyApp
For bonus points, I'd like to be able to access it via http://MyWebSite.com/SomeOtherFolder/SomeOtherAppName
So how can I use the Azure portal to specify the endpoint for my application?

If you upload your site on a custom domain the default url is MyWebSite.com
For put other site in a diferent folder into the domain origin (MyWebSite.Com/MyApp), use FileZilla for update the files after create MyApp folder into /site/wwwroot:
https://blogs.msdn.microsoft.com/kaushal/2014/08/01/microsoft-azure-web-site-connect-to-your-site-via-ftp-and-uploaddownload-files/
And if create another folder into MyApp (http://MyWebSite.com/SomeOtherFolder/SomeOtherAppName) looks like (/site/wwwroot/SomeOtherFolder/SomeOtherFolder )

Related

Change the URL of a Azure Static Web App from the randomly generated name

I created a Azure Static Web App in Azure. The process saved a workflow file in the Github repository and created a URL https://nice-beach-0253b8b10.azurestaticapps.net. How can I change this URL?
You currently can't change the azurestaticapps.net itself. However, you can configure a custom domain (using your own domain provider) or setup a CNAME record.
See more info: https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain?tabs=azure-dns
Unfortunately, you cannot pick and choose your app URLs. But if you hate only the nice-beach part, you can always create another Static Web App resource and hope for the best as Azure picks a random two-word phrase every time.
Static web apps are just another Azure app service and you should be able to set up custom domains as you normally do for any other app service.

How to have multiple host names for azure website

I created an web app for a demo website in Azure. The domain name for this website was created when I created the app service "myapp1.azurewebsites.net". I'd like to use additional domain names using the same azurewebsites.net such as myapp2.azurewebsites.net. When I try to add this custom domain it tells me
Failed to add hostname myapp2.azurewebsites.net. Too many (2)
hostnames in the default DNS zone. Limit is 1
Is there no way around this or must I use my own custom DNS name?
For this you need to add custom domain in Azure web app.
For example : when I created the app service "myapp1.azurewebsites.net" and want to have additional domain names , you can go for custom domains like abc.com.
You can not have .azurewebsites.net as the custom domain of already existing web app as it is already owned by Microsoft Azure web app.

domain settings in azure

i have a live web app on azure with settings
with several host-names assigned to the site as below
As a change of requirements , i want the domain.net to be the parent domain where the root directory of my app points to, and not domian.co.uk
basically as shown below
As this is a live website, i want to achieve this with minimum downtime.
As you have added more than one custom domains to your web app, all the domains can be used to access your website, even only one is shown in the overview page.
If you want to use only one custom domain, you can remove the others. Or you can set a redirect rule for other domains at the DNS.

How do I host a public static site as a web app?

I want the url www.example.com to display default.html
From this question I understand that the easiest way is still to create a web app.
[How not to do it]
I tried creating a solution in VS2017
File->New ->Project -> .Net Core -> Asp.Net Core Web Application-> Empty
Then I moved my static files into wwwroot and deployed
What do I need to change so that default.html will load when someone goes to the site?
At the moment if I remove the Program class I get a message
Severity Code Description Project File Line Suppression State
Error CS5001 Program does not contain a static 'Main' method suitable for an entry point
which is understandable since it is a web application , how do I change it to be a static web site?
[A better way, create the app in Azure.]
Instead of the above method I created a new web app and followed the advise at this question to paste in index.html.
I can now go to the Azure url for the site and the correct content displays.
Next I need to get example.com to work.
I added the CName record for www in my DNS with the url for the site, and I also went to Custom Domains in Azure to add my domain name.
However I get the following error when I go to my site.
Error 404 - Web app not found.
The web app you have attempted to reach is not available in this Microsoft Azure App Service region. This could be due to one of several reasons:
1. The web app owner has registered a custom domain to point to the Microsoft Azure App Service, but has not yet configured Azure to recognize it. Click here to read more.
When an app owner wants to use a custom domain with a Microsoft Azure Web Apps web app, Azure needs to be configured to recognize the custom domain name, so that it can route the request to the appropriate server in the region. After registering the domain with a domain provider and configuring a DNS CNAME record to point to the app's Azurewebsites.net address (for example, contoso.azurewebsites.net), the web app owner also needs to go to the Azure Portal and configure the app for the new domain. Click here to learn more about configuring the custom domains for a web app.
I got it working in the end. I must have missed a step in the documentation

How do I set up an azure app service with the url of mysite.com/app1 and mysite.com/app2

I would like to set up an Azure AppServices in azure. I have multiple apps that I want to run under the same domain and the url to be applied as such. mysite.com/app1, mysite.com/app2, etc. I know I can do this under IIS but I am wanting to use Azure AppServices instead of using a virtual server that I will have to manage.
I have multiple apps that I want to run under the same domain and the url to be applied as such.
Per my understanding, you could configure multiple virtual directories and applications within a single Azure website. You could follow the steps below:
Set up the Virtual Directory or Application
Log into Azure Portal, choose your web app, click "SETTINGS > Application settings" and add the following configuration:
Deploy your application to Azure
You could use KUDU or other tools (e.g. FTP, etc.) for deploying your application.
Test:
Additionally, here is a tutorial about deploying multiple virtual directories to a single Azure Website, you could refer to it.
UPDATE:
I checked the Environment variables about APP_POOL_ID via kudu:
https://{your-appname}.scm.azurewebsites.net/Env.cshtml and remote to my azure web app using IIS Manager, and found the following settings:
For adding your custom domain for your azure web app, you could refer to this tutorial.
Add them in separate directories instead of root directories. When you add them in the root directories the app starts from mysite.com. But if you add them into different directories then it starts as mysite.com/dir1 and mysite.com/dir2

Resources