Writing the code is half the job, getting it in front of users is the other half, and it’s the half a lot of tutorials skip. This guide walks through taking a plain ASP.NET Core app from your machine to a live, publicly reachable URL on Azure App Service, using the fastest path available: the Azure CLI.
Contents
- What you’ll need
- The deployment flow, end to end
- Redeploying after changes
- Choosing a deployment method
- A few things worth knowing before you go to production
- Cleaning up
- Wrapping up
- Frequently asked questions
- Sources
What You’ll Need
An Azure subscription (the free tier is enough to follow along), the .NET 10 SDK, and the Azure CLI installed locally. If you don’t have the CLI yet, install it and sign in first:
az login
This opens a browser window to authenticate, then links your terminal session to your Azure subscription.
The Deployment Flow, End to End
Five steps take a project from your local machine to a live URL.

1. Create (or use) an ASP.NET Core project
If you’re starting from scratch:
dotnet new webapi -n MyFirstAzureApp --framework net10.0
cd MyFirstAzureApp
dotnet run
Confirm it runs locally before you worry about the cloud at all, Azure will only ever run what already works on your machine.
2. Publish a release build
dotnet publish --configuration Release
This produces the optimized output Azure will actually execute, never deploy a Debug build to production.
3. Create the App Service and deploy in one command
The Azure CLI’s az webapp up command is the fastest path from zero to a live app: it provisions a resource group, an App Service plan, and the App Service itself, then deploys your code, all in one call.
az webapp up --sku F1 --name my-first-azure-app --os-type linux --resource-group my-first-azure-app-rg
A few notes on the flags: --sku F1 uses the free pricing tier, which is fine for learning and small demos (drop it for anything you’d point real traffic at). --name has to be globally unique across all of Azure, since it becomes part of your app’s default URL. --os-type linux is the cheaper, generally recommended choice for ASP.NET Core unless you specifically need Windows (for example, running .NET Framework alongside .NET). Add --location if you want to pin a specific Azure region.
Pass --resource-group explicitly, as shown above. If you leave it out, the CLI creates one for you with its own generated name (based on your OS and region, not your app name), and you’d have to look it up before you could use it in step 4. Naming it yourself keeps every later command predictable.
When the command finishes, it prints a URL something like https://my-first-azure-app.azurewebsites.net and your app is already live there.
4. Configure app settings and secrets
Connection strings, API keys, and anything else that shouldn’t be hardcoded belong in App Service’s configuration, not in appsettings.json:
az webapp config appsettings set \
--name my-first-azure-app \
--resource-group my-first-azure-app-rg \
--settings ConnectionStrings__DefaultConnection="<your-connection-string>"
These app settings are surfaced to your app as environment variables, and ASP.NET Core’s configuration system picks them up automatically, the double underscore (__) maps to the : you’d use in appsettings.json for nested configuration sections.
5. Verify it’s live
Open the URL from step 3 in a browser, or:
curl https://my-first-azure-app.azurewebsites.net
That’s the whole path from local code to a public endpoint.
Redeploying After Changes
Once the app exists, pushing an update is just:
az webapp up --os-type linux
The CLI remembers your app’s configuration from the first run (cached in a local .azure folder), so you don’t need to repeat every flag.
Choosing a Deployment Method
The CLI is the fastest way to learn the platform, but it’s not the only option and it’s not always the right one for an ongoing project.

For a real project with a team behind it, GitHub Actions is worth the extra ten minutes of setup: connect a repository in the Azure Portal under your App Service’s Deployment Center, and every push to main redeploys automatically, no one has to remember to run a deploy command.
A Few Things Worth Knowing Before You Go to Production
Deployment slots let you deploy to a staging environment first, verify it, then swap it into production with zero downtime available on Standard tier and above, and one of the best reasons to move off the free tier for a real app.
Custom domains and TLS are configured under your App Service’s “Custom domains” blade; Azure provides free managed certificates for custom domains, so there’s no separate certificate-buying step.
Scaling is a slider, not a redeploy, App Service lets you scale up (a bigger instance) or out (more instances) from the Scale Up/Scale Out blades without touching your code.
Monitoring is worth wiring up before you need it, not after. Application Insights integrates directly with App Service and is a good enough topic to deserve its own article later in this series.
Cleaning Up
Azure resources cost money while they exist, even idle ones. If you were just following along, remove everything in one command.
az group delete --name my-first-azure-app-rg
Wrapping Up
Deploying to Azure App Service isn’t the hard part of shipping an ASP.NET Core app, it’s five commands and a few minutes once you’ve done it once. The parts worth spending real time on are the ones just past the initial deploy: configuration, deployment slots, and monitoring, since those are what separate “it’s live” from “it’s production-ready.”
Frequently Asked Questions
Do I need an Azure subscription with a credit card to follow this guide?
Azure’s free tier covers the F1 App Service plan used in this guide. You’ll generally still need to create an Azure account, but you won’t be charged for the resources this walkthrough creates as long as you stay on F1 and delete them afterward.
What’s the difference between scaling up and scaling out?
Scaling up moves your app to a more powerful instance size. Scaling out adds more instances running the same app behind the load balancer. Both are configured from App Service’s Scale blades, with no code changes or redeploy required.
Can I use deployment slots on the free tier?
No. Deployment slots require the Standard tier or above. If staged, zero-downtime deployments matter for your app, factor that into which pricing tier you choose.
Should connection strings go in appsettings.json or App Service configuration?
App Service configuration. Anything sensitive – connection strings, API keys, secrets should be set there rather than committed into appsettings.json, since App Service settings are surfaced to the app as environment variables at runtime.
How do I stop Azure from charging me after I’m done testing?
Delete the resource group with az group delete. That removes every resource inside it, including the App Service plan and the app itself, in one step.





You must be logged in to post a comment.