Skip to content

codez-one/CZ.Azure.FileExchange

Repository files navigation

CZ.Azure.FileExchange

This project provides a website to share fast files with the help of azure. You get an upload website that looks like this:

Upload

The important thing there is the guid that is displayed after uploading a file. This can be used on the download page:

Download

Deployment

In every release of this repository you will find a azuredeploy.json. Just take this json and deploy it here. After this you have in your resource group an storage account and a static web app. Find out the URL of your static website add the CORS rule for it:

Configure Cors

After this download the two ZIPs of the release (API.zip & Frontend.zip) and extract them.

After this you can run the script deploy.ps1 with the following parameters from any powershell:

$token = Read-Host -MaskInput;
./deploy.ps1 -Token $token -appBuildOutput path-to-the-extrated-frontend-zip -apiBuildOutput path-to-the-extracted-api-zip

Information: The token you get in the azure portal from the overview page of the static webapp. It's called deployment token.

Build App

dotnet build
dotnet publish .\src\CZ.Azure.FileExchange\ -o temp/fe
dotnet publish .\src\CZ.Azure.FileExchange.Api\ -o temp/api

Publish the App

$token = Read-Host -MaskInput;
./build/deploy.ps1 -Token $token -appBuildOutput ./temp/fe/wwwroot/ -apiBuildOutput ./temp/api/

Important: You must configure your storage account with the cors ruls, so it accepts request from your static websites hostname....

  • enjoy

Publish a stage

To publish a stage the deploy script needs some more parameters:

$token = Read-Host -MaskInput;
$branchName = git branch --show-current;
$PrId = "Replace this string with the Id of your PR here";
$PrTitle = "Replace this string with the title of your PR";
./build/deploy.ps1 -Token $token -appBuildOutput ./temp/fe/wwwroot/ -apiBuildOutput ./temp/api/ -envrionmentName $PrId -pullrequestTitle $PrTitle -branchName $branchName

Delete a stage

To delete a stage just add the delete parameter:

$token = Read-Host -MaskInput;
$branchName = git branch --show-current;
$PrId = "Replace this string with the Id of your PR here";
$PrTitle = "Replace this string with the title of your PR";
./build/deploy.ps1 -Token $token -appBuildOutput ./temp/fe/wwwroot/ -apiBuildOutput ./temp/api/ -envrionmentName $PrId -pullrequestTitle $PrTitle -branchName $branchName -Delete

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •