0

I want to be able to use c# to retrieve an azure invoice section using the azure sdk library (azure.resourcemanager.billing) in order to recreate this powershell method

`$token = Get-AzAccessToken $request = @{ Method = 'PUT' Uri = "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/$($billingAccountName)/billingProfiles/$($billingProfileName)/invoiceSections/$($invoicesectionname)?api-version=2019-10-01-preview" Headers = @{ "Authorization" = "Bearer $($token.Token)" "Content-type" = "application/json" } Body = '{"properties": { "displayName" : "Test"}}' } Invoke-RestMethod @request

$invoiceSection = Get-AzInvoiceSection -BillingAccountName $billingAccountName -BillingProfileName $billingProfileName | Where-Object {$_.Name -eq "Test"}`

I know this can be done using powershell and using the rest api but i want to use the azure sdk library.

I have tried using the azure.resourcemanager.billing library as the previous library is now marked as deprecated but i cannot find the right methods to use

0 Answers0