services | platforms | author |
---|---|---|
azure-billing |
dotnet-core |
jlian |
This is a simple .NET Core sample that uses the Azure .NET SDK to programmatically get your invoices.
-
Get the .NET Core SDK.
-
Get the Account Admin of the subscription to opt in and turn on API access to invoices.
-
Create an Azure service principal either through Azure CLI, PowerShell or the portal.
-
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
-
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" }
-
Run the sample.
dotnet run
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.