{"id":16006614,"url":"https://github.com/svanboxel/azure-cost-report-action","last_synced_at":"2026-01-21T17:33:00.072Z","repository":{"id":43978541,"uuid":"246575651","full_name":"SvanBoxel/azure-cost-report-action","owner":"SvanBoxel","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-10T21:15:20.000Z","size":1150,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T17:52:45.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/SvanBoxel.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}},"created_at":"2020-03-11T13:16:15.000Z","updated_at":"2021-05-07T08:56:14.000Z","dependencies_parsed_at":"2023-01-05T04:49:41.657Z","dependency_job_id":null,"html_url":"https://github.com/SvanBoxel/azure-cost-report-action","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.4,"last_synced_commit":"e3305fb7f00611893d192a08fd7df85aaadb2f6b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fazure-cost-report-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fazure-cost-report-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fazure-cost-report-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SvanBoxel%2Fazure-cost-report-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SvanBoxel","download_url":"https://codeload.github.com/SvanBoxel/azure-cost-report-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675599,"owners_count":20977378,"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-10-08T11:42:45.709Z","updated_at":"2026-01-21T17:33:00.027Z","avatar_url":"https://github.com/SvanBoxel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Cost Report\n\nThis GitHub Action allows you to publish all consumed Azure resources and associated costs for the last billing period of an Azure subscription. By default it posts the results to a GitHub issue the action is running in, but it also allows you to use the output in a subsequent action.\n\nThis GitHub Actions works on a per-subscription basis. This means that if you want to use this functionality for all subscriptions within an Azure account, you need to run it multiple times.\n\n## Configuration\nTo run this GitHub Action you need to create an Enterprise application in Azure and give it permission to access your subscription info:\n\n1. Search for 'App Registration' in the Azure portal.\n2. Click 'New Registration'.\n    - Name it so you can easily identify it later on.\n    - Check \"Accounts in this organizational directory only (salesgithub (Default Directory) only - Single tenant)\".\n    - No Redirect URI needed. \n3. Note the Application (client) ID and Directory (tenant) ID.\n4. Click 'Certificates and Secrets' in the left-hand menu.\n    - Click the 'New client secret' button and give it a name a expiry setting.\n    - Note the client secret (and make sure to delete this note when you're done setting everything up).\n5. Search for 'Subscriptions' in the Azure portal.\n6. Click the subscription you like to scan.\n    - Note the subscription ID\n7. Click 'Access control' in the left-hand menu\n8. Add a new role assignment\n    - Select 'Reader' role.\n    - Select for the name of the Enterprise application you created in step 2.\n    - Save.\n9. Save the secret from step 4 in the GitHub secret manager within the repository you want to run this action in. `(https://github.com/\u003cowner\u003e/\u003crepository\u003e/settings/secrets)`.\n10. Copy-paste one of the examples below to get started.\n\n## Examples\nRun this action on every release and publish results to issue:\n```\non: [release]\n\njobs:\n  azure-cost-analyser:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v2.0.0\n    - name: Azure-cost\n      uses: ./\n      with:\n        subscriptionId: \u003cAzure subscription id\u003e # Per step 6\n        directoryId: \u003cAzure directory id\u003e # Per step 3\n        clientId: \u003cAzure client id\u003e # Per step 3\n        clientSecret: ${{ secrets.azure_client_secret }} # Per step 10\n        githubToken: ${{ secrets.GITHUB_TOKEN }}\n```\n\nRun this action on every release, but skip posting results to issue. (Result are available as [output](https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions#outputs))\n\n```\non: [release]\n\njobs:\n  azure-cost-analyser:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v2.0.0\n    - name: Azure-cost\n      uses: ./\n      with:\n        subscriptionId: \u003cAzure subscription id\u003e # Per step 6\n        directoryId: \u003cAzure directory id\u003e # Per step 3\n        clientId: \u003cAzure client id\u003e # Per step 3\n        clientSecret: ${{ secrets.azure_client_secret }} # Per step 10\n        disableIssue: true\n```\n\nRun this action every month and include \"team\" and \"owner\" tag\n\n```\non:\n  schedule:\n    - cron:  '0 0 1 * *'\njobs:\n  azure-cost-analyser:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v2.0.0\n    - name: Azure-cost\n      uses: ./\n      with:\n        subscriptionId: \u003cAzure subscription id\u003e # Per step 6\n        directoryId: \u003cAzure directory id\u003e # Per step 3\n        clientId: \u003cAzure client id\u003e # Per step 3\n        clientSecret: ${{ secrets.azure_client_secret }} # Per step 10\n        githubToken: ${{ secrets.GITHUB_TOKEN }}\n        includeTags: \"team,owner\"\n```\n\n## Output\nNext to publishing the results in a markdown table to a GitHub issue, a JSON output is also available for further consumption.\n\nOutput format:\n```\n{ totalNumberOfResources: 123,\n  totalCosts: '1234.12',\n  currency: 'USD',\n  period: 202003\n  resources:\n   [ { instanceName: '112bf220-8243-485c-abaf-187252d34178-eus',\n       costs: '123.12 USD',\n       instanceLocation: 'US East',\n       service: 'microsoft.operationalinsights',\n      },\n     { instanceName: 'main-sec-linux',\n       costs: '312.95 USD',\n       instanceLocation: 'US East 2',\n       service: 'Microsoft.Compute',\n      },\n       ```\n   ]\n}\n```\n\n## Local testing\nRun the following command from the command line to test this action locally.\n\n```\nsubscriptionId=\"\u003csubscription id\u003e\" directoryId=\"\u003cdirectory id\u003e\" clientId=\"\u003cclient id\u003e\" clientSecret=\"\u003cclient secret\u003e\" node src/index.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvanboxel%2Fazure-cost-report-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvanboxel%2Fazure-cost-report-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvanboxel%2Fazure-cost-report-action/lists"}