1. Packages
  2. Azure Classic
  3. How-to Guides
  4. Todo App Using Azure App Service with SQL Database and Integrated with Azure DevOps

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Todo App Using Azure App Service with SQL Database and Integrated with Azure DevOps

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

View Code Deploy this example with Pulumi

A Todo List application from Azure Samples GitHub: .NET Core MVC sample for Azure App Service, a web app built with ASP.NET Core, Entity Framework Core and a SQL database.

Provisions Azure SQL Database and Azure Application Insights to be used in combination with App Service. Defines an Azure DevOps pipeline to deploy in CI/CD environment.

Running the App manually with Pulumi CLI

  1. Build and publish the ASP.NET Core project:

    dotnet publish src
    
    Copy
  2. Navigate to infra:

    cd infra
    
    Copy
  3. Create a new stack:

    pulumi stack init dev
    
    Copy
  4. Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):

    az login
    
    Copy
  5. Restore NPM dependencies:

    npm install
    
    Copy
  6. Configure target Azure environment:

    pulumi config set azure:location <location>
    pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
    
    Copy
  7. Define SQL Server username:

    pulumi config set sqlUsername <value>
    
    Copy
  8. Define SQL Server password (make it complex enough to satisfy Azure policy):

    pulumi config set --secret sqlPassword <value>
    
    Copy
  9. Run pulumi up to preview and deploy changes:

    $ pulumi up
    Previewing changes:
    ...
    
    Performing changes:
    ...
    info: 10 changes performed:
        + 10 resources created
    Update duration: 1m14.59910109s
    
    Copy
  10. Check the deployed website endpoint:

    $ pulumi stack output endpoint
    https://dev-as10d706a2.azurewebsites.net
    $ curl "$(pulumi stack output endpoint)"
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Index - My ToDoList App</title>
    ...
    
    Copy

Integrating with Azure DevOps

azure-pipeline.yml in the root folder of this example shows a configuration for Azure DevOps using Pulumi task.

Pulumi task expects a Pulumi access token to be configured as a build variable. Copy your token from Access Tokens page and put it into pulumi.access.token build variable.

alternative-pipeline folder contains custom scripts and a pipeline to run Pulumi program in environments that have to access to the marketplace.

Follow Azure DevOps guide for more details.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi