How to upload code to Azure web apps?TypeScript
Sure, here is a step by step Pulumi program that accomplishes this goal in TypeScript:
To upload code to Azure Web Apps, we first need to create the Web App where your application will be hosted. Azure-native is the preferred package provider we use for Azure. Here we will create a ResourceGroup, an AppServicePlan (the hosting plan for the web app), and the WebApp itself.
After creating those, Pulumi provides
Assetclasses to upload our local files to the cloud. You'll find these classes in the
@pulumi/pulumipackage under the
FileAssetclasses can point to local files for Pulumi to upload. When we apply these as the
appService.WebAppPulumi uploads those files to Azure.
Here is the Pulumi program:
In the example above, replace
./wwwrootwith the path to your project's website root. The
./is relative to the Pulumi program, so depending on your setup, it might be
This program will take the files in your project's
"wwwroot"directory (or whichever directory you specify), create an Azure Web App in a new Resource Group, and then upload those files to the newly created Azure Web App.
Finally, the URL for your website will be
Let me know if there's anything else you'd like me to help you with when it comes to deploying on Azure with Pulumi!