All Projects → Azure-Samples → billing-dotnet-core-invoice-download

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

Licence: MIT license
An example on how to use .NET Core to connect to Azure and get your invoices

Programming Languages

C#
18002 projects
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 [email protected] with any additional questions or comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].