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

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.

Related

Azure Resources WebApp deployed but not accessible from url

I'm trying to access my app, hosted on azure.
I've a finished c# solution. When I commit changes to Azure DevOps it triggers a (working & successful) build-pipeline.
It runs tests, publishes an artifact & testresults.
In my ServicePlan status is Ready and I see Data Exchanges on DataIn & DataOut graphs.
The Deployment Center:
Bu when I click the https://mywebsite.azurewebsites.net, No webpage was found for the web address.
I have Some basic Azure DevOps expierence, but this Azure Portal is something else :)
My basic questions would be:
Why is it not working?
Do I need a second pipeline, only for release? Or can I recycle the build pipeline?
Do I need some kind of deployment slots? Before I select a not-free slot, I want to know if this is necessary
What else could I be missing?
(My Azure resources include a sql-server, a sql-db, the actual appservice & a app service plan)
Thanks!
If you deploy web app to Azure and login https://<app-name>.azurewebsites.net, then the page still shows Microsoft page instead you owner page. You need check the default document, please ensure that the default page is listed in here.
Steps: login azure portal->App Service->configuration->Default documents
In Azure Web Apps, the default document is the web page that is displayed at the root URL for a website. The first matching file in the list is used. Refer File structure on azure to know more about the files and directories on Azure Web App.
Update1
When I go to the azurewebsites.net url I get a 404: No webpage was found for the web address.
Check this doc:
If you receive an HTTP 404 (Not Found) error when you browse to the URL of your custom domain, verify that your domain resolves to your app's IP address by using WhatsmyDNS.net. If not, it might be because of one of the following reasons:
The custom domain configured is missing an A record or a CNAME
record.
The browser client has cached the old IP address of your domain.
Clear the cache, and test DNS resolution again. On a Windows machine,
you clear the cache with ipconfig /flushdns.
Update2
the URL in my appservice is Azure-generated right?
Yes, then app service url is generated by Azure.
With making a new app service and going to the URL I do get a message app service is up and running.Time to take the next step and deploy your code.
And now, we should get this page, we need create new service connection and re-configure build and release pipeline and deploy your app.
Note: We need use the same user account and AAD domain to do this.

How do I map a URL to a uksouth.cloudapp.azure.com website

I have a website running on Azure: -
e.g. mysite.uksouth.cloudapp.azure.com
I have purchased a domain e.g. www.mysite.co.uk
When I go to https://www.mysite.co.uk I want to display the website mysite.uksouth.cloudapp.azure.com.
I've tried adding an app service in azure, but it gives me the URL https://mysite.azurewebsites.net.
So https://www.mysite.co.uk now brings up a Azure welcome screen asking me to deploy my code.
How do I get https://mysite.co.uk to display https://mysite.uksouth.cloudapp.azure.com?
Thanks.
Ian.
I found this https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-custom-domain-name-portal#add-a-cname-record-for-your-custom-domain
So I deleted my App Service in Azure, as that's not what I needed and followed the above instructions to configure the DNS for cloudapp.
You have to map your custom domain name to the web app. Below is the Microsoft doc with the steps.
Custom Domain

How to test Azure Web App that requires custom domain without using public DNS

I have an Azure Webapp on a Standard 1 Small App Service Plan, I deployed my application successfully to the webapp, but now I need to test it using a specific domain name that on client side could be configured using hosts file.
The problem is that the Azure webapp will only "recognize" the custom/specific domain (ex: myapp.mydomain.com) if I configure a Custom Domain that uses public DNS and I can't (at this moment) configure the existing domain name to be a CNAME to the Azure webapp because it is production environment, I can and will make the CNAME after the application is tested not before.
My application requires to be called by the specific domain name.
So how can I test my application on Azure webapp using a custom domain but without using public DNS using only my hosts file client side?
note: this problem doesn't even exist in AWS Beanstalk so why is this so complicated with Azure webapp. Its pretty basic
You can preemptively associate your custom domain name with your web app and test it via a client using the host file. To verify domain ownership, Add a TXT record. The TXT record maps from awverify.<subdomain> to <appname>.azurewebsites.net. Steps to do this are outlined here:
https://learn.microsoft.com/en-us/azure/app-service/manage-custom-dns-migrate-domain
Using App Service, I don't think you can do this.
It configures the underlying app to only listen for domains configured in the Web App.
So if you don't add the domain as a custom domain, requests won't be routed to the app.
The reason is that IP addresses are shared, so Azure relies on the Host header to route your request correctly.
You can add the custom domain without CNAME / A record by using the awverify record mentioned by Ken.

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

Multiple domains on 1 cloud service

I have a app which is a website builder. Lets say the app is on a azure webrole and its domain is called www.myapp.com.
I want to offer a service where users can use their custom domain with my app. So User 1 has a domain called ww.user1.com, user2 has www.user2.com etc. Whenever someone types www.user1.com, I want them to be able to see come to my my app ie www.myapp.com, with the browser still showing www.user1.com. You can assume I have complete access to the DNS and nameservers of these custom domains. I just need to understand how to configure this in azure.
Not really, as it was on SSL binding of multiple custom domains on a single cloud. I was trying to figure out how to have one app on a cloud service where content changes as per custom domain end user has used to navigate to the website. Turns out its easy, all that is required is cname config and listening to host_header on server side aspx page_init –

Resources