{"id":18063267,"url":"https://github.com/scale-tone/azfunc4devops","last_synced_at":"2025-04-11T15:26:58.723Z","repository":{"id":64516901,"uuid":"538107594","full_name":"scale-tone/AzFunc4DevOps","owner":"scale-tone","description":"Azure DevOps Triggers and Bindings for Azure Functions","archived":false,"fork":false,"pushed_at":"2023-03-22T08:26:11.000Z","size":185,"stargazers_count":7,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T11:38:13.836Z","etag":null,"topics":["azure","azure-devops","azure-functions","devops","tfs","vsts"],"latest_commit_sha":null,"homepage":"https://scale-tone.github.io/2023/02/14/azfunc4devops","language":"C#","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/scale-tone.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-18T12:49:40.000Z","updated_at":"2025-03-02T19:11:53.000Z","dependencies_parsed_at":"2024-10-31T05:20:29.608Z","dependency_job_id":null,"html_url":"https://github.com/scale-tone/AzFunc4DevOps","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2FAzFunc4DevOps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2FAzFunc4DevOps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2FAzFunc4DevOps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2FAzFunc4DevOps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scale-tone","download_url":"https://codeload.github.com/scale-tone/AzFunc4DevOps/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429982,"owners_count":21101930,"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":["azure","azure-devops","azure-functions","devops","tfs","vsts"],"created_at":"2024-10-31T05:10:22.393Z","updated_at":"2025-04-11T15:26:58.699Z","avatar_url":"https://github.com/scale-tone.png","language":"C#","readme":"# AzFunc4DevOps\n\nA set of [Azure DevOps](https://learn.microsoft.com/en-us/azure/devops/user-guide/what-is-azure-devops) Triggers and Bindings for [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/). Leverages [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/) platform to simplify integration, automation, import/export and data synchronization scenarios for [Azure DevOps](https://learn.microsoft.com/en-us/azure/devops/user-guide/what-is-azure-devops).\n\n[\u003cimg alt=\"Nuget\" src=\"https://img.shields.io/nuget/v/AzFunc4DevOps.AzureDevOps?label=current%20version\"\u003e](https://www.nuget.org/profiles/AzFunc4DevOps) [\u003cimg alt=\"Nuget\" src=\"https://img.shields.io/nuget/dt/AzFunc4DevOps.AzureDevOps?label=nuget%20downloads\"\u003e](https://www.nuget.org/profiles/AzFunc4DevOps) [![.NET](https://github.com/scale-tone/AzFunc4DevOps/actions/workflows/dotnet.yml/badge.svg)](https://github.com/scale-tone/AzFunc4DevOps/actions/workflows/dotnet.yml)\n\n## How to use\n\nAs a prerequisite, you will need [Azure Functions Core Tools installed on your devbox](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#install-the-azure-functions-core-tools).\n\n#### 1. Create a local folder, name it e.g. `AzFunc4DevOpsTest` and initialize an Azure Functions .NET project in it:\n``` \n  func init --worker-runtime dotnet\n```\n\n#### 2. Install [AzFunc4DevOps.AzureDevOps](https://www.nuget.org/packages/AzFunc4DevOps.AzureDevOps) NuGet package:\n```\n  dotnet add package AzFunc4DevOps.AzureDevOps\n```\n\n#### 3. Open the folder in Visual Studio Code:\n```\n  code .\n```\nAlternatively open the project in Visual Studio or any other IDE of your choice.\n\n#### 4. In `local.settings.json` file configure the following required settings:\n```\n{\n    \"IsEncrypted\": false,\n    \"Values\": {\n        \"FUNCTIONS_WORKER_RUNTIME\": \"dotnet\",\n\n        \"AzureWebJobsStorage\": \"my-azure-storage-connection-string\",\n\n        \"AZFUNC4DEVOPS_AZURE_DEVOPS_ORG_URL\": \"https://dev.azure.com/my-company-name\",\n        \"AZFUNC4DEVOPS_AZURE_DEVOPS_PAT\": \"my-azure-devops-personal-access-token\"\n    }\n}\n```\n  \n  `AzureWebJobsStorage` needs to be configured, because AzFunc4DevOps internally uses [Azure Durable Functions](https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview), which require a storage. It's OK to use [Azurite](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite) for local development.\n  \n  `AZFUNC4DEVOPS_AZURE_DEVOPS_ORG_URL` is your Azure DevOps organization's full URL. E.g. `https://dev.azure.com/my-company-name`.\n  \n  `AZFUNC4DEVOPS_AZURE_DEVOPS_PAT` is your Azure DevOps Personal Access Token. [Create one in Azure DevOps portal](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate#create-a-pat). Alternatively use [KeeShepherd](https://marketplace.visualstudio.com/items?itemName=kee-shepherd.kee-shepherd-vscode) tool for creating and safely handling it. \n    \n  NOTE: the PAT needs to be given all [relevant scopes](https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#scopes). E.g. if your Function is going to read/write Work Items, then `vso.work_write` will be needed.\n  \n  As an alternative to `AZFUNC4DEVOPS_AZURE_DEVOPS_ORG_URL` and `AZFUNC4DEVOPS_AZURE_DEVOPS_PAT` settings you can specify `OrgUrl` and `PersonalAccessToken` properties in every trigger/binding attribute. Those properties (just like any other trigger/binding attribute property) also support `%MY-SETTING-NAME%` syntax. See [the example here](https://github.com/scale-tone/AzFunc4DevOps/blob/main/samples/CloneBugsIntoDifferentOrg.cs#L23).\n\n\n#### 5. Start adding Functions that use AzFunc4DevOps triggers and bindings. \n  E.g. the following Function adds `[Critical]` title prefix to a bug, once its `Severity` field changes to `1 - Critical`:\n```\npublic static class AddCriticalToBugTitle\n{\n    [FunctionName(nameof(AddCriticalToBugTitle))]\n    [return: WorkItem(Project = \"MyProjectName\")]\n    public static WorkItemProxy Run\n    (\n        [WorkItemChangedTrigger\n        (\n            Project = \"MyProjectName\",\n            WiqlQueryWhereClause = \"[System.WorkItemType] = 'Bug'\",\n            FieldName = \"Microsoft.VSTS.Common.Severity\",\n            ToValue = \"1 - Critical\"\n        )]\n        WorkItemChange change\n    )\n    {\n        var item = change.NewVersion;\n\n        if (!item.Title.StartsWith(\"[Critical]\"))\n        {\n            item.Title = \"[Critical] \" + item.Title;\n        }\n\n        return item;\n    }\n}\n```\n\n#### 6. Run your Function locally:\n```\n  func start\n```\n\n## Samples\n\nYou can find more sample Functions [in the samples folder](https://github.com/scale-tone/AzFunc4DevOps/tree/main/samples#azfunc4devopsazuredevops-samples).\n\n\n## Reference\n\nSee the [documentation in our Wiki](https://github.com/scale-tone/AzFunc4DevOps/wiki).\n\nAlso see [this introductory blog post about AzFunc4DevOps here](https://scale-tone.github.io/2023/02/14/azfunc4devops).\n\n## Contributing\n\nIs very much welcomed.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscale-tone%2Fazfunc4devops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscale-tone%2Fazfunc4devops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscale-tone%2Fazfunc4devops/lists"}