{"id":26666472,"url":"https://github.com/codez-one/cz.azure.fileexchange","last_synced_at":"2025-04-11T22:41:36.782Z","repository":{"id":42500826,"uuid":"443049226","full_name":"codez-one/CZ.Azure.FileExchange","owner":"codez-one","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-15T15:12:00.000Z","size":1320,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-29T04:27:52.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codez-one.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-30T11:01:57.000Z","updated_at":"2023-10-08T03:38:13.000Z","dependencies_parsed_at":"2024-03-16T23:27:23.166Z","dependency_job_id":"325022bf-28d8-4d77-b7b9-15c65d37a11c","html_url":"https://github.com/codez-one/CZ.Azure.FileExchange","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codez-one%2FCZ.Azure.FileExchange","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codez-one%2FCZ.Azure.FileExchange/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codez-one%2FCZ.Azure.FileExchange/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codez-one%2FCZ.Azure.FileExchange/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codez-one","download_url":"https://codeload.github.com/codez-one/CZ.Azure.FileExchange/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493022,"owners_count":21113159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-25T18:35:13.651Z","updated_at":"2025-04-11T22:41:36.757Z","avatar_url":"https://github.com/codez-one.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CZ.Azure.FileExchange\n\nThis project provides a website to share fast files with the help of azure.\nYou get an upload website that looks like this:\n\n![Upload](docs/.assets/dbf1f27a-e386-4b94-bd34-418bca1a057a.png)\n\nThe important thing there is the guid that is displayed after uploading a file.\nThis can be used on the download page:\n\n![Download](docs/.assets/ce9c3c1a-eb2d-4222-befb-fc57b8823404.png)\n\nA demo can be used here:\n[https://kind-dune-004c2c103.azurestaticapps.net](https://kind-dune-004c2c103.azurestaticapps.net)\n\n## Status\n\n| Azure DevOps | GitHub Action |\n| ------------ | ------------- |\n| [![Build Status](https://dev.azure.com/czon/CZ.Azure.FileExchange/_apis/build/status/codez-one.CZ.Azure.FileExchange?branchName=main)](https://dev.azure.com/czon/CZ.Azure.FileExchange/_build/latest?definitionId=9\u0026branchName=main) | [![Azure Static Web Apps CI/CD](https://github.com/codez-one/CZ.Azure.FileExchange/actions/workflows/main.yml/badge.svg)](https://github.com/codez-one/CZ.Azure.FileExchange/actions/workflows/main.yml) |\n\n## Deployment\n\nIn every [release](https://github.com/codez-one/CZ.Azure.FileExchange/releases/latest) of this repository you will find a `azuredeploy.json`.\nJust take this json and deploy it [here](https://portal.azure.com/#create/Microsoft.Template).\nAfter this you have in your resource group an storage account and a static web app.\n\nAfter this download the two ZIPs of the release (API.zip \u0026 Frontend.zip) and extract them.\n\nAfter this you can run the script [`deploy.ps1`](https://github.com/codez-one/CZ.Azure.FileExchange/blob/20220111.21/build/deploy.ps1) with the following parameters from any powershell:\n\n```powershell\n$token = Read-Host -MaskInput;\n./deploy.ps1 -Token $token -appBuildOutput path-to-the-extrated-frontend-zip -apiBuildOutput path-to-the-extracted-api-zip\n```\n\n\u003e Information: The token you get in the azure portal from the overview page of the static webapp. It's called `deployment token`.\n\n### Build App\n\n\u003e Important: If you want deploy this, build it on linux!\n\n```powershell\ndotnet build\ndotnet publish .\\src\\CZ.Azure.FileExchange\\ -o temp/fe\ndotnet publish .\\src\\CZ.Azure.FileExchange.Api\\ -o temp/api\n```\n\n### Run the App local\n\nPull and run [azurite](https://github.com/azure/azurite) on your local machine. (it will simulate azure blob storage on your machine)\n\n```powershell\ndocker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite\n```\n\nafter that you need to configure cors rules on the storage emulator. You can do this with the following powershell script:\n\n```powershell\n$accountKey = (Read-Host -MaskInput -Prompt \"Storage Account Key\");\n$body = \"\u003c?xml version=`\"1.0`\" encoding=`\"utf-8`\"?\u003e\n\u003cStorageServiceProperties\u003e\n    \u003cCors\u003e\n        \u003cCorsRule\u003e\n            \u003cAllowedOrigins\u003e*\u003c/AllowedOrigins\u003e\n            \u003cAllowedMethods\u003eGET,PUT,OPTIONS,HEAD\u003c/AllowedMethods\u003e\n            \u003cAllowedHeaders\u003e*\u003c/AllowedHeaders\u003e\n            \u003cExposedHeaders\u003e*\u003c/ExposedHeaders\u003e\n            \u003cMaxAgeInSeconds\u003e200\u003c/MaxAgeInSeconds\u003e\n        \u003c/CorsRule\u003e\n    \u003c/Cors\u003e\n\u003c/StorageServiceProperties\u003e\"\n$lenght = $body.Length;\n$hmacsha = New-Object System.Security.Cryptography.HMACSHA256;\n$hmacsha.key = [Convert]::FromBase64String($accountKey);\n$date = (Get-Date).ToUniversalTime().ToString(\"R\");\n$test = \"PUT`n`n`n$lenght`n`n`n`n`n`n`n`n`nx-ms-date:$($date)`nx-ms-version:2018-03-28`n/devstoreaccount1/devstoreaccount1`ncomp:properties`nrestype:service\";\n$signature1 = $hmacsha.ComputeHash([Text.Encoding]::UTF8.GetBytes($test));\n$auth = [System.Convert]::ToBase64String($signature1);\nInvoke-WebRequest -Method Put \"http://127.0.0.1:10000/devstoreaccount1?restype=service\u0026comp=properties\" -Headers @{\"Authorization\" = \"SharedKey devstoreaccount1:$($auth)\"; \"x-ms-version\"= \"2018-03-28\"; \"x-ms-date\" = $date } -Body $body\n```\n\n\n### Publish the App\n\n```powershell\n$token = Read-Host -MaskInput;\n./build/deploy.ps1 -Token $token -appBuildOutput ./temp/fe/wwwroot/ -apiBuildOutput ./temp/api/\n```\n\n\u003e Important: You must configure your storage account with the cors ruls, so it accepts request from your static websites hostname....\n\n- enjoy\n\n#### Publish a stage\n\nTo publish a stage the deploy script needs some more parameters:\n\n```powershell\n$token = Read-Host -MaskInput;\n$branchName = git branch --show-current;\n$PrId = \"Replace this string with the Id of your PR here\";\n$PrTitle = \"Replace this string with the title of your PR\";\n./build/deploy.ps1 -Token $token -appBuildOutput ./temp/fe/wwwroot/ -apiBuildOutput ./temp/api/ -envrionmentName $PrId -pullrequestTitle $PrTitle -branchName $branchName\n```\n\n#### Delete a stage\n\nTo delete a stage just add the delete parameter:\n\n```powershell\n$token = Read-Host -MaskInput;\n$branchName = git branch --show-current;\n$PrId = \"Replace this string with the Id of your PR here\";\n$PrTitle = \"Replace this string with the title of your PR\";\n./build/deploy.ps1 -Token $token -appBuildOutput ./temp/fe/wwwroot/ -apiBuildOutput ./temp/api/ -envrionmentName $PrId -pullrequestTitle $PrTitle -branchName $branchName -Delete\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodez-one%2Fcz.azure.fileexchange","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodez-one%2Fcz.azure.fileexchange","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodez-one%2Fcz.azure.fileexchange/lists"}