https://github.com/compositionalit/storage-identity
https://github.com/compositionalit/storage-identity
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/compositionalit/storage-identity
- Owner: CompositionalIT
- License: mit
- Created: 2020-11-24T20:51:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-13T15:32:42.000Z (9 months ago)
- Last Synced: 2025-06-29T00:49:26.640Z (9 months ago)
- Language: F#
- Size: 19.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Azure .NET Identity Demo
This repository shows how to construct a storage account with an associated web application with
a trust granted to the web application using Azure's managed identity capabilities. It also
demonstrates how to use Compositional IT's [Farmer](https://compositionalit.github.io/farmer/) technology
to rapidly construct application topologies via Azure Resource Manager (ARM) templates.
## Prerequisites
* .NET 3.1 SDK or higher
* Visual Studio 2019, Rider or Visual Studio Code with the Ionide F# extension
* Azure CLI
## Components
* Web Application: An ASP .NET Core web application running in F# using the Saturn and Giraffe libraries.
* Farmer Template: An F# console application that creates and configures all Azure resources and deploys the application into them in a ready-to-run state.
## Instructions
#### 1. Publish the web application to a local folder
```cmd
dotnet publish webapp -c Release -o publish
```
#### 2. Configure the Farmer template
Open the `infrastructure/Program.fs` file and update the `baseName` value to something that is unique to you. The resource group, storage account, and web app names will be generated from this value.
#### 3. Run the Farmer application
```cmd
dotnet run -p infrastructure
```
The Infrastructure application uses Farmer to do the following:
* Provisions Storage and Web Application resources
* Turns on the System Identity of the Web Application
* Grants Reader permissions of the identity to the storage account
* Deploys them to Azure
* Uploads a set of files into the created storage account
You will be prompted to log into Azure the first time you execute the script. After a short delay,
Farmer will generate and deploy both the ARM template and the deployed web application into the
provisioned App Service.
Finally, the application opens a browser to show the data served back by ASP .NET.