This project provides a website to share fast files with the help of azure. You get an upload website that looks like this:
The important thing there is the guid that is displayed after uploading a file. This can be used on the download page:
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:
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
.
dotnet build
dotnet publish .\src\CZ.Azure.FileExchange\ -o temp/fe
dotnet publish .\src\CZ.Azure.FileExchange.Api\ -o temp/api
$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
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
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