請求書をダウンロードする URL を取得します。 この操作は、契約の種類がMicrosoft Partner AgreementまたはMicrosoft 顧客契約の課金アカウントでサポートされています。
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?api-version=2020-05-01&downloadToken={downloadToken}
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
billingAccountName
|
path |
True
|
string
|
課金アカウントを一意に識別する ID。
|
invoiceName
|
path |
True
|
string
|
請求書を一意に識別する ID。
|
api-version
|
query |
True
|
string
|
クライアント要求で使用される API のバージョン。 現在のバージョンは 2020-05-01 です。
|
downloadToken
|
query |
True
|
string
|
ドキュメント ソースとドキュメント ID を含むトークンをダウンロードします。
|
応答
名前 |
型 |
説明 |
200 OK
|
DownloadUrl
|
OK です。 要求は成功しました。
|
202 Accepted
|
|
受理されました。
Headers
- Location: string
- Retry-After: string
|
Other Status Codes
|
ErrorResponse
|
操作に失敗した理由を説明するエラー応答。
|
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
InvoiceDownload
Sample Request
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?api-version=2020-05-01&downloadToken=DRS_12345
/** Samples for Invoices DownloadInvoice. */
public final class Main {
/*
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json
*/
/**
* Sample code: InvoiceDownload.
*
* @param manager Entry point to BillingManager.
*/
public static void invoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) {
manager
.invoices()
.downloadInvoice("{billingAccountName}", "{invoiceName}", "DRS_12345", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billing
# USAGE
python invoice_download.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.invoices.begin_download_invoice(
billing_account_name="{billingAccountName}",
invoice_name="{invoiceName}",
download_token="DRS_12345",
).result()
print(response)
# x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbilling_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json
func ExampleInvoicesClient_BeginDownloadInvoice() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewInvoicesClient().BeginDownloadInvoice(ctx, "{billingAccountName}", "{invoiceName}", "DRS_12345", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DownloadURL = armbilling.DownloadURL{
// URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingManagementClient } = require("@azure/arm-billing");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
*
* @summary Gets a URL to download an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json
*/
async function invoiceDownload() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const billingAccountName = "{billingAccountName}";
const invoiceName = "{invoiceName}";
const downloadToken = "DRS_12345";
const credential = new DefaultAzureCredential();
const client = new BillingManagementClient(credential, subscriptionId);
const result = await client.invoices.beginDownloadInvoiceAndWait(
billingAccountName,
invoiceName,
downloadToken
);
console.log(result);
}
invoiceDownload().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
Location: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/operationResults/invoiceDownload_{operationId}?api-version=2020-05-01
Retry-After: 10
{
"url": "https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"
}
定義
DownloadUrl
URL の有効期限が切れるまでエンティティをダウンロードするために使用できるセキュリティで保護された URL。
名前 |
型 |
説明 |
expiryTime
|
string
|
ダウンロード URL の有効期限が切れる UTC 時刻。
|
url
|
string
|
PDF ファイルの URL。
|
ErrorDetails
エラーの詳細。
名前 |
型 |
説明 |
code
|
string
|
エラー コード。
|
details
|
ErrorSubDetails[]
|
エラーのサブ詳細。
|
message
|
string
|
操作が失敗した理由を示すエラー メッセージ。
|
target
|
string
|
特定のエラーのターゲット。
|
ErrorResponse
エラー応答は、サービスが受信要求を処理できないことを示します。 理由は、エラー メッセージに示されています。
ErrorSubDetails
名前 |
型 |
説明 |
code
|
string
|
エラー コード。
|
message
|
string
|
操作が失敗した理由を示すエラー メッセージ。
|
target
|
string
|
特定のエラーのターゲット。
|