https://github.com/martinothamar/easyazurewebapp
A sample easy to deploy full stack C# Azure web app using Pulumi
https://github.com/martinothamar/easyazurewebapp
azure csharp dotnet dotnetcore pulumi
Last synced: 3 months ago
JSON representation
A sample easy to deploy full stack C# Azure web app using Pulumi
- Host: GitHub
- URL: https://github.com/martinothamar/easyazurewebapp
- Owner: martinothamar
- Created: 2020-09-04T11:51:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-07T09:22:34.000Z (almost 6 years ago)
- Last Synced: 2025-06-01T11:14:02.117Z (about 1 year ago)
- Topics: azure, csharp, dotnet, dotnetcore, pulumi
- Language: C#
- Homepage:
- Size: 219 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# An easy to deploy Azure webapp
Fullstack C#/.NET (frontend + backend + Infrastructure), Azure-first design.
* Create storage account with a pulumi-state blob container
* Create Azure Key Vault, make sure your Azure user have all permissions (or add individually until pulumi new works)
* Create `.env.sh` in the root folder with the following content:
```sh
#!/bin/bash
export SOLUTION_ROOT_DIRECTORY=$(pwd)
export AZURE_KEYVAULT_AUTH_VIA_CLI=true
export AZURE_STORAGE_ACCOUNT="moistorage" # State storage
export AZURE_STORAGE_KEY="xxxx"
```
Then in the commandline:
```sh
source .env.sh # Set environment variables
dotnet publish # Build and publish the ASP.NET Core Blazor app
cd src/Infrastructure
pulumi stack init dev # First time init
az login # Make sure you're logged in to Azure
pulumi up # Applies updates to Azure
```
Now you can open the `WebAppUrl` output url.
If you make any changes to the ASP.NET Core app, just rerun `pulumi up` and it will update the zip file.
## From scratch
```sh
pulumi login --cloud-url azblob://pulumi-state
pulumi new azure-csharp --secrets-provider="azurekeyvault://moi-key-vault.vault.azure.net/keys/pulumi-secret"
```