Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Azure-Samples/billing-dotnet-core-invoice-download

Repository files navigation

page_type languages products description
sample
csharp
dotnet
azure
This is a simple .NET Core sample that uses the Azure .NET SDK to programmatically get your invoices.

Get Azure invoice with .NET Core

This is a simple .NET Core sample that uses the Azure .NET SDK to programmatically get your invoices.

Run this sample

  1. Get the .NET Core SDK.

  2. Get the Account Admin of the subscription to opt in and turn on API access to invoices.

  3. Create an Azure service principal either through Azure CLI, PowerShell or the portal.

  4. Clone the repository and install dependencies

    git clone https://github.com/Azure-Samples/billing-dotnet-core-invoice-download.git
    cd billing-dotnet-core-invoice-download
    dotnet restore
  5. Edit appsettings.json using your subscription ID, tenant domain, client ID, and client secret from the service principle that you created. Example:

    {
        "TenantDomain": "yourtenant.onmicrosoft.com",
        "SubscriptionID": "your subscription ID",
        "ClientID": "your client ID",
        "ClientSecret": "your client secret"
    }
  6. Run the sample.

    dotnet run

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

An example on how to use .NET Core to connect to Azure and get your invoices

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages