{"id":20794852,"url":"https://github.com/code-star/sbt-azure-functions-plugin","last_synced_at":"2025-06-23T05:08:21.705Z","repository":{"id":55120787,"uuid":"324704041","full_name":"code-star/sbt-azure-functions-plugin","owner":"code-star","description":"Experimental plugin for sbt to create Azure Function artefacts (function.json) needed to publish code as an Azure Function.","archived":false,"fork":false,"pushed_at":"2021-05-10T04:42:31.000Z","size":84,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-12T01:33:00.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-star.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-27T06:45:58.000Z","updated_at":"2021-09-21T03:40:06.000Z","dependencies_parsed_at":"2022-08-14T12:40:17.185Z","dependency_job_id":null,"html_url":"https://github.com/code-star/sbt-azure-functions-plugin","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/code-star/sbt-azure-functions-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-star%2Fsbt-azure-functions-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-star%2Fsbt-azure-functions-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-star%2Fsbt-azure-functions-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-star%2Fsbt-azure-functions-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-star","download_url":"https://codeload.github.com/code-star/sbt-azure-functions-plugin/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-star%2Fsbt-azure-functions-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261417590,"owners_count":23155074,"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":"2024-11-17T16:18:26.665Z","updated_at":"2025-06-23T05:08:16.694Z","avatar_url":"https://github.com/code-star.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SBT Azure Functions Plugin \n\u003c\u003cTODO: add download link from new location (once moved from bintray)\u003e\u003e\n\nDevelop branch: ![Scala CI](https://github.com/code-star/sbt-azure-functions-plugin/workflows/Scala%20CI/badge.svg?branch=develop)\n\nExperimental plugin for sbt to create Azure Function artefacts (function.json) needed to publish code as an Azure Function.\n\n## Setup and Usage\n\n### Setup\n  \nin your `project/plugins.sbt` add sbt-assembly and sbt-azure-functions:\n  \n    addSbtPlugin(\"com.eed3si9n\" % \"sbt-assembly\" % \"0.14.10\")\n    addSbtPlugin(\"nl.codestar\" % \"sbt-azure-functions\" % \"\u003clatest version\u003e\")\n\nin your `build.sbt` provide values for the assembly and azure-functions plugins:\n\n    lazy val root = (project in file(\".\"))\n      .settings(\n          ...\n\n          // optional: override the zip and/or jar name (defaults are AzureFunction.zip and AzureFunction.jar)\n          azfunZipName := \"myFunctions.zip\",\n          azfunJarName := \"ScalaFunctions.jar\",\n      \n          // you need this dependency to be able to use the annotations\n          libraryDependencies ++= Seq(\n            \"com.microsoft.azure.functions\" % \"azure-functions-java-library\" % \"1.3.1\"\n          )\n        \n      )\n\n### Usage\n\n* `sbt azfunCreateZipFile`\n\n    This will generate the fat jar that you want to upload to Azure (`assembly`), and then generates the function\n    specifications (`function.json` in separate folders for each method that has been annotated with an `@FunctionName`\n    annotation, and further detailed with `@HttpTrigger` annotation).\n  \n    The `azfunCreateZipFile` task will automatically trigger the following intermediate tasks that could also be\n    called individually:\n  \n    * `azfunGenerateFunctionJsons` - to make the `function.json` files (implicitly calls `assembly` task)\n    * `azfunCopyHostJson` - to copy the `host.json` file\n    * `azfunCopyLocalSettingsJson` - to copy the `local.settings.json` file\n\n* `sbt azfunDeploy`\n\n    This will deploy the function to Azure, using the azure CLI, which is expected to be available on your path\n    and logged in to the correct Azure Subscription.\n    You will also have to install the app-insights extension to the CLI, by running `az extension add -n application-insights`\n  \n    You can provide the following settings to determine the destination:\n    * `azfunResourceGroup`\n    * `azfunStorageAccount`\n    \n\n## TODO: \n1. add task to upload to Azure\n1. add support for App Insights workspaces\n1. add tests against multiple Java versions (java 8 and Java 11)\n\n\n## Cross compiling and testing\n### SBT and Scala\nSince this is an sbt plugin, it should be usable with multiple versions of sbt. This means it needs to be built and\nreleased for different scala versions and different sbt versions. I have not (yet) found a good resource that documents\nwhat Scala version is used for each sbt release, except for https://github.com/sbt/sbt/issues/5032, \nso I am also keeping track here:\n\n| SBT release(s)| Scala version     | Remarks                                          |\n|---------------|-------------------|--------------------------------------------------|\n| 0.x           | 2.10.x            |\n| 1.x           | 2.12.x            |\n| 2.x           | 2.13.x or 3.0.x   |\n| 3.x           | 3.0.x or 3.1.x    |\n\nFor now, I will focus only on sbt 1.x and Scala 2.12.x\n\n### Microsoft Azure Dependencies\nThis plugin uses artifacts from Microsoft:\n* \"com.microsoft.azure\" % \"azure-tools-common\" % \"0.10.0\"\n* \"com.microsoft.azure.functions\" % \"azure-functions-java-library\" % \"1.3.1\" % \"test\"\n\nFor now I will use these versions\n\n### Testing\n#### Unit tests\n* `sbt clean test`\n#### Scripted tests\n* `sbt scripted`\n\n## Releasing (for plugin maintainers)\nTo release a new version:\n* Get a [bintray](https://bintray.com) account and make sure you're a member of the [`code-star`](https://bintray.com/code-star) organization.\n* Set your credentials - you can use `sbt bintrayChangeCredentials`, but when run from the interactive sbt prompt\n  you will not see the requests for username and password. So blindly first type your username, press enter, then\n  paste your API key and press enter again.\n\n    (found a workaround that shows the prompt again: add to build.sbt: `ThisBuild / useSuperShell := false`)\n* reload to make new settings known to sbt\n* Run `sbt release`\n\nUpdate Feb 2021: we started moving away from Bintray. We will start using sbt-ci-release and release to Maven Central. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-star%2Fsbt-azure-functions-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-star%2Fsbt-azure-functions-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-star%2Fsbt-azure-functions-plugin/lists"}