3

I'm getting a 404 trying to access my azurewebsite.net

My Resource group contains an AppServicePlan, an AppService, SQL Server & SQL Database, a KeyVault & SignalR.

Locally everything works, the AppService is running, AppServicePlan is Ready (1App/0Slots), Connected Services for SignalR & SQL are configured (in the menu you get when right-clicking WebProject > Publish). KeyVault is configured & accessible. Not sure if these are problem free though, as I keep getting NuGet Errors, stating unable to update NuGet Package.

When I right-click my WebProject & Publish, I get Message Publish has been succeeded. But when I click on the link, I get a 404.

I'm working with two pipelines in AzureDevops

Seeing as official documentation is always lagging behind and showing older interfaces, it has not been much of a help. I followed https://learn.microsoft.com/en-us/learn/modules/create-release-pipeline/5-deploy-to-appservice this tutorial, did everything stated, but the last step, I didn't get the desired result (an accessible website through azurewebsites.net).

I have a Export template with all connected services configured (I guess generated by azure?) but don't really know what to do with it.

Can anybody pinpoint what I am missing or doing wrong? Or tell me what else I would be needing, apart from the services I mentioned (like Certificates, Active Directory?) Do I need a gitHub repo next to AzureDevOps Repo & Azure Resources? Does publishing via VS interfere with my automated pipelinebuilds?

Thanks!

dfbenny
  • 140
  • 1
  • 12

1 Answers1

3

You can try to deploy to Azure App Service in Azure DevOps directly. I used the sample you shared and worked well on my side. Here are my steps:

1.Create the App Service instance in Azure and make sure the default home page is correct.

2.Clone the sample from GitHub to Azure DevOps Repo.

3.Change the deploy stage in the azure-pipelines.yml file on release branch and run pipeline. I removed variable groups and changed the configuration of AzureWebApp task: enter image description here

4.Browse the page in Azure. I can get the same page as in the tutorial.

enter image description here

Walter
  • 2,640
  • 1
  • 5
  • 11
  • 2
    Quan-MSFT thank you for answer! I updated my release yaml like your screenshot but it still does not work. I think its strange that the pipeline in Azure DevOps pipelines doesn't show the yaml-inputted displayname. Also, could you please explain to me why I would need GitHub? I'm using DevOps as source control already, do I need the GitHub repo as well? Also: my ZipFile is in a folder called 'drop' but it has another name. If I want to 'download: current; artifact: drop' will he expect a drop.zip or will he look in folder called 'drop' and take the package name from inputs? Thx again! – dfbenny Feb 12 '21 at 13:00
  • 1
    1.Can you share the screenshot about pipelines doesn't show the yaml-inputted displayname? 2.You do not need github. I just used the sample on github. 3.It will look in folder called 'drop' and take the package name from inputs. – Walter Feb 15 '21 at 09:37
  • 2
    Maybe you can clone my [sample](https://dev.azure.com/v-waqia/Sample/_git/mslearn-tailspin-spacegame-web-deploy.git) and just change the subscription name and app name in the yaml file. – Walter Feb 15 '21 at 10:00
  • 1
    screenshots: https://i.imgur.com/Uow2txK.png & https://i.imgur.com/lBez8Cr.png I've changed the name of the artifact now to make it more clear. It seems release pipeline finds the artifact produced by Build Pipeline. But have found I may have a problem in angular. I can ng build --prod, but when I ng run projectName:deploy I get 'Project target does not exist.' screenshot of my angular.json: https://i.imgur.com/UTohphg.png browserTarget always points to projectName. I tried adding server, serve-ssr & prerender to architect (like other question suggested) by no difference... – dfbenny Feb 15 '21 at 13:52
  • 1
    @dfbenny I did not find angular.json in the sample of the tutorial. Did you add the files yourself? It seems that it is a different question, you can create a new ticket for this. – Walter Feb 16 '21 at 09:47
  • 1
    @Qian I believe the angular.json was generated. It seems indeed. I have made a new, more elaborate question here: https://stackoverflow.com/questions/66213224/ng-run-projectdeploy-project-target-does-not-exist?noredirect=1#comment117077794_66213224 – dfbenny Feb 16 '21 at 13:32
  • How about the original issue? Do you still have 404 error when trying to access azurewebsite.net? – Walter Feb 18 '21 at 08:43