How to deploy my app to Web App?

Keith Viking 20 Reputation points
2024-02-23T12:58:35.4233333+00:00

I have created a test .Net 6 app (open Visual Studio and create a standard web app and ran it). Next in Azure DevOps i set up my repository and alll looks the way i would expect it to. I would now like to deploy this app to a Azure Web App which should provide me with a public test Url (or i can create one if thats the process) but the end goal is to display this test app in a browser. A new pipeline has been created to ensure the application builds first before deploying. I can see this listed under Pipelines. I read i need to setup a Environment (Environments, create new) but when i do this it asks for me to select a resource (Kubernetes or Virtual Machine). I dont want to use these. From what i have read i need some YAML file to process this but the instructions on this are very vague. How could i set up an Environment so i can deploy this app to a Windows Server running as/on a Web App which would be part of the entire pipeline so when someone pushes in new changes it would build > successful build would then deploy the app which can then be viewed in a web browser (for now a temporary URL would be ok)?

Developer technologies ASP.NET ASP.NET Core
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2024-02-23T22:06:03.71+00:00

    Hey @Keith Viking

    I think you came across documentation that wasn't mean for your use case. Have a look Configure CI/CD with Azure Pipelines - Azure App Service | Microsoft Learn. It walks you step by step how to create your build and deployment pipelines. Really all you need is to configure a service connection, which DevOps will walk you through, and configure you pipeline:

    variables:
      buildConfiguration: 'Release'
    
    steps:
    - script: dotnet build --configuration $(buildConfiguration)
      displayName: 'dotnet build $(buildConfiguration)'
    - task: DotNetCoreCLI@2
      inputs:
        command: 'publish'
        publishWebProjects: true
    - task: AzureWebApp@1
      inputs:
        azureSubscription: '<service-connection-name>'
        appType: 'webAppLinux'
        appName: '<app-name>'
        package: '$(System.DefaultWorkingDirectory)/**/*.zip'
    

    For build configuration, you set this trigger of the pipeline or remove it for now so that you can get up and running.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.