{"id":24390488,"url":"https://github.com/jwpkg/bicep-assets","last_synced_at":"2026-03-10T13:05:59.231Z","repository":{"id":250055508,"uuid":"833333622","full_name":"jwpkg/bicep-assets","owner":"jwpkg","description":"Asset support for bicep deployments","archived":false,"fork":false,"pushed_at":"2025-09-19T07:38:17.000Z","size":3225,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T13:21:25.341Z","etag":null,"topics":["arm","asset-copy","asset-extract","asset-sas","assets","azure","bicep","build-plugins"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwpkg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-24T20:36:01.000Z","updated_at":"2025-06-24T09:43:46.000Z","dependencies_parsed_at":"2024-07-24T23:41:57.182Z","dependency_job_id":"f9727bf9-a568-4719-b533-7eb01855f9b3","html_url":"https://github.com/jwpkg/bicep-assets","commit_stats":null,"previous_names":["joostvdwsd/bicep-assets"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/jwpkg/bicep-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwpkg%2Fbicep-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwpkg%2Fbicep-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwpkg%2Fbicep-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwpkg%2Fbicep-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwpkg","download_url":"https://codeload.github.com/jwpkg/bicep-assets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwpkg%2Fbicep-assets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30334412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["arm","asset-copy","asset-extract","asset-sas","assets","azure","bicep","build-plugins"],"created_at":"2025-01-19T16:17:57.280Z","updated_at":"2026-03-10T13:05:59.212Z","avatar_url":"https://github.com/jwpkg.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bicep-assets\n\nBicep assets is a tool to add a simple, code completed way of working with local files during your bicep deployment\n\n![NPM Version](https://img.shields.io/npm/v/bicep-assets)\n\n# Topics\n- [How would you use this](#how-would-you-use-this)\n- [Installation](#installation)\n- [Available bicep/ARM Modules](#available-biceparm-modules)\n- [Build phase](#build-phase)\n  - [Generation of biceps-assets.bicep](#generation-of-bicep-assetsbicep)\n  - [Build plugins](#build-plugins)\n- [Explanation why this was created](#explanation-why-this-was-created)\n\n\n# How would you use this\n\n## Configure the asset build\n\n\u003e bicep-assets-config.yaml\n```yaml\nassets:\n  - api.yaml\n  - name: static_frontend\n    path: ./frontend\n    plugin: vite\n```\n\n## Use the asset and decide in bicep what to do with it\n\n\u003e main.bicep\n```bicep\nimport { assets } from './bicep-assets.bicep'\n\n// Create a simple storage account to host a static site\nresource staticStiteStorageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {\n  name: 'staticStiteStorageAccount'\n  kind: 'StorageV2'\n}\n\n// Extract the website asset to the static site storage account using the custom resource provider\nmodule assetExtract 'ts/shared:bicep-assets-extract:1.0.0' = {\n  name: 'Deploy static website'\n  params: {\n    // Here we use the static frontend asset entry from the generated bicep file 'bicep-assets.bicep'\n    asset: assets.static_frontend\n    target: {\n      storageAccount: staticStiteStorageAccount.name\n      container: '$web'\n    }\n  }\n}\n```\n\n## Deploy/Upload the generated assets and run your bicep deployment\n\n```sh\n$ bicep-assets deploy\n$ az stack group create --name static-site-stack -g static-site-rg -f main.bicep\n```\n\n# Installation\n\nInstall the cli package.\n\n```sh\n$ npm install -g bicep-assets\n```\n\nSetup the current folder to use the asset provider. This will deploy the custom resource provider.\n\n```sh\n$ bicep-assets init\n```\n\nDeploy the template specs so you can use them in bicep\n\n```sh\n$ bicep-assets spec deploy -g my-resource-group\n```\n\n# Available bicep/arm modules\n\n## Copy asset\n\nThis copies the asset from the asset storage account to the target storage account blob storage.\n\u003e Example use: copy the generated zip to a storage account to be used by a zipdeploy\n\n```bicep\nmodule assetCopy 'ts/shared:bicep-assets-copy:0.0.0' = {\n  name: 'test-bicep-assets-asset-copy'\n  params: {\n    asset: assets.bicep_assets_config_yaml\n    target: {\n      storageAccount: targetStorage.name\n      container: 'target-container'\n    }\n  }\n}\n```\n\n### Properties\n| Name | Type | Required | Description |\n| :- | :- | :-: | :- |\n| asset | Asset | yes | The asset to deploy |\n| target.storageAccount | string | yes | The name of the target storage account | \n| target.container | string | yes | The name of the target container |\n| target.fileName | string | no | The targetfile name, if not provided it uses the default hash-based filename of the asset |\n\n## Extract asset\n\nThis extract a zip/folder based asset and puts the files in the target storage account blob storage\n\u003e Example use: extract a static website to a storage account blob\n\n```bicep\nmodule assetExtract 'ts/shared:bicep-assets-extract:0.0.0' = {\n  name: 'test-bicep-assets-asset-extract'\n  params: {\n    asset: assets.bicep_assets_config_yaml\n    target: {\n      storageAccount: targetStorage.name\n      container: 'target-container'\n    }\n  }\n}\n```\n\n### Properties\n| Name | Type | Required | Description |\n| :- | :-: | :-: | :- |\n| asset | Asset | yes | The asset to deploy |\n| target.storageAccount | string | yes | The name of the target storage account | \n| target.container | string | yes | The name of the target container |\n\n## Generate SAS url\n\nThis generates a download SAS url to the specified asset\n\u003e Example use: Pass a local file to a custom resource\n\n```bicep\nmodule assetSas 'ts/shared:bicep-assets-sas-url:0.0.0' = {\n  name: 'test-bicep-assets-asset-sas-url'\n  params: {\n    asset: assets.api_yaml\n  }\n}\n\nmodule useAsset './my-module' = {\n  name: 'MyModule'\n  params: {\n    api_yaml_location: assetSas.outputs.downloadSasUrl\n  }\n}\n```\n\n### Properties\n| Name | Type | Required | Description |\n| :- | :-: | :-: | :- |\n| asset | Asset | yes | The asset to deploy |\n\n### Outputs\n| Name | Type | Description |\n| :- | :-: | :- |\n| downloadSasUrl | Asset | The asset to deploy |\n\n# Build phase\n\n## Generation of bicep-assets.bicep\n\nBicep assets has a build phase before deployment. In this phase the *bicep-assets.bicep* file is generated. This file is used to import assets in your own bicep file.\n\n## Build plugins\n\nBy default bicep assets can be used to copy files and folders into the azure space. However, there is also the option for build plugins to generate the content of the asset before deployment.\n\n| Plugin | Description |\n| :- | :- |\n| vite | Build a static frontend using vite. This will call the vite command in the specified path and use the output param to redirect teh output in the asset storage |\n| nodejs | This will bundle a nodejs application as a full functioning function app (v4) |\n| \u003c\u003c t.b.d. \u003e\u003e | Plugins will be added. Currently its node oriented but this is not the target state. There will follow plugins to generate a good python or powershell function (and others) | \n\n# Explanation why this was created\n\nOriginally we worked primarily with AWS in my company using CDK. A full integrated way of working was possible due to the asset management in CDK. We could execute build commands and use the output directly in the deployment.\n\nWhen we moved more towards azure I thought bicep was a decent tool and maybe for our less technical end users better then AWS CDK.\n\nHowever, using bicep I quickly discovered a very frustrating flow:\n1. create a function app (v4) in bicep including storage accounts\n2. upload the function source to the storage account created in step 1\n3. create a zipdeploy package to deploy the function\n\nEven in a simple variant we had 2 deployments separated by an upload. When the application grows this becomes even more troublesome.\n\nWith this cli application everything can be orchestrated in 1 bicep deployment which adds\n- reproducibility\n- consistency\n- ease of use\n- standardizing way of workings\n\n# How does it work\n\n![](./docs/designs/bicep-assets-upload.drawio.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwpkg%2Fbicep-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwpkg%2Fbicep-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwpkg%2Fbicep-assets/lists"}