From 588cbdd64c502fb24699749266432aadebe06dc4 Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Wed, 22 Apr 2020 14:53:02 +0800 Subject: [PATCH 01/17] Init for CostManagement --- src/{BlockChain => Blockchain}/.gitattributes | 0 src/{BlockChain => Blockchain}/.gitignore | 0 .../Az.Blockchain.psd1 | 0 .../custom/New-AzBlockchainMember.ps1 | 0 .../New-AzBlockchainTransactionNode.ps1 | 0 .../custom/Update-AzBlockchainMember.ps1 | 0 .../Update-AzBlockchainTransactionNode.ps1 | 0 .../custom/readme.md | 0 .../docs/Az.Blockchain.md | 0 .../docs/Get-AzBlockchainConsortium.md | 0 .../docs/Get-AzBlockchainMember.md | 2 +- .../docs/Get-AzBlockchainMemberApiKey.md | 0 .../Get-AzBlockchainMemberConsortiumMember.md | 0 .../docs/Get-AzBlockchainSku.md | 0 .../docs/Get-AzBlockchainTransactionNode.md | 0 .../Get-AzBlockchainTransactionNodeApiKey.md | 0 .../docs/New-AzBlockchainMember.md | 0 .../docs/New-AzBlockchainMemberApiKey.md | 16 +- .../docs/New-AzBlockchainTransactionNode.md | 0 .../New-AzBlockchainTransactionNodeApiKey.md | 4 +- .../docs/Remove-AzBlockchainMember.md | 0 .../Remove-AzBlockchainTransactionNode.md | 0 ...st-AzBlockchainLocationNameAvailability.md | 0 .../docs/Update-AzBlockchainMember.md | 0 .../Update-AzBlockchainTransactionNode.md | 0 src/{BlockChain => Blockchain}/docs/readme.md | 0 .../examples/Get-AzBlockchainConsortium.md | 0 .../examples/Get-AzBlockchainMember.md | 2 +- .../examples/Get-AzBlockchainMemberApiKey.md | 0 .../Get-AzBlockchainMemberConsortiumMember.md | 0 .../examples/Get-AzBlockchainSku.md | 0 .../Get-AzBlockchainTransactionNode.md | 0 .../Get-AzBlockchainTransactionNodeApiKey.md | 0 .../examples/New-AzBlockchainMember.md | 0 .../examples/New-AzBlockchainMemberApiKey.md | 16 +- .../New-AzBlockchainTransactionNode.md | 0 .../New-AzBlockchainTransactionNodeApiKey.md | 6 +- .../examples/Remove-AzBlockchainMember.md | 0 .../Remove-AzBlockchainTransactionNode.md | 0 ...st-AzBlockchainLocationNameAvailability.md | 0 .../examples/Update-AzBlockchainMember.md | 0 .../Update-AzBlockchainTransactionNode.md | 0 src/{BlockChain => Blockchain}/how-to.md | 0 src/{BlockChain => Blockchain}/license.txt | 0 src/{BlockChain => Blockchain}/readme.md | 0 .../resources/readme.md | 0 .../Get-AzBlockchainConsortium.Recording.json | 0 .../test/Get-AzBlockchainConsortium.Tests.ps1 | 0 .../Get-AzBlockchainMember.Recording.json | 0 .../test/Get-AzBlockchainMember.Tests.ps1 | 0 ...et-AzBlockchainMemberApiKey.Recording.json | 0 .../Get-AzBlockchainMemberApiKey.Tests.ps1 | 0 ...chainMemberConsortiumMember.Recording.json | 0 ...BlockchainMemberConsortiumMember.Tests.ps1 | 0 .../test/Get-AzBlockchainSku.Recording.json | 0 .../test/Get-AzBlockchainSku.Tests.ps1 | 0 ...AzBlockchainTransactionNode.Recording.json | 0 .../Get-AzBlockchainTransactionNode.Tests.ps1 | 0 ...kchainTransactionNodeApiKey.Recording.json | 0 ...zBlockchainTransactionNodeApiKey.Tests.ps1 | 0 .../New-AzBlockchainMember.Recording.json | 0 .../test/New-AzBlockchainMember.Tests.ps1 | 0 ...ew-AzBlockchainMemberApiKey.Recording.json | 0 .../New-AzBlockchainMemberApiKey.Tests.ps1 | 0 ...AzBlockchainTransactionNode.Recording.json | 0 .../New-AzBlockchainTransactionNode.Tests.ps1 | 0 ...kchainTransactionNodeApiKey.Recording.json | 0 ...zBlockchainTransactionNodeApiKey.Tests.ps1 | 0 .../Remove-AzBlockchainMember.Recording.json | 0 .../test/Remove-AzBlockchainMember.Tests.ps1 | 0 ...AzBlockchainTransactionNode.Recording.json | 0 ...move-AzBlockchainTransactionNode.Tests.ps1 | 0 ...ainLocationNameAvailability.Recording.json | 0 ...ockchainLocationNameAvailability.Tests.ps1 | 0 .../Update-AzBlockchainMember.Recording.json | 0 .../test/Update-AzBlockchainMember.Tests.ps1 | 0 ...AzBlockchainTransactionNode.Recording.json | 0 ...date-AzBlockchainTransactionNode.Tests.ps1 | 0 src/{BlockChain => Blockchain}/test/env.json | 0 .../test/loadEnv.ps1 | 0 src/{BlockChain => Blockchain}/test/readme.md | 0 src/{BlockChain => Blockchain}/test/utils.ps1 | 0 .../Invoke-AzCostManagementUsageQuery.ps1 | 329 ++ .../New-AzCostManagementQueryColumnObject.ps1 | 48 + ...agementQueryComparisonExpressionObject.ps1 | 52 + .../New-AzCostManagementQueryFilterObject.ps1 | 60 + src/CostManagement/custom/readme.md | 41 + src/CostManagement/readme.md | 85 + src/CostManagement/resources/Create.ps1 | 21 + .../resources/costmanagement.json | 3153 +++++++++++++++++ src/CostManagement/resources/readme.md | 11 + 91 files changed, 3823 insertions(+), 23 deletions(-) rename src/{BlockChain => Blockchain}/.gitattributes (100%) rename src/{BlockChain => Blockchain}/.gitignore (100%) rename src/{BlockChain => Blockchain}/Az.Blockchain.psd1 (100%) rename src/{BlockChain => Blockchain}/custom/New-AzBlockchainMember.ps1 (100%) rename src/{BlockChain => Blockchain}/custom/New-AzBlockchainTransactionNode.ps1 (100%) rename src/{BlockChain => Blockchain}/custom/Update-AzBlockchainMember.ps1 (100%) rename src/{BlockChain => Blockchain}/custom/Update-AzBlockchainTransactionNode.ps1 (100%) rename src/{BlockChain => Blockchain}/custom/readme.md (100%) rename src/{BlockChain => Blockchain}/docs/Az.Blockchain.md (100%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainConsortium.md (100%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainMember.md (98%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainMemberApiKey.md (100%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainMemberConsortiumMember.md (100%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainSku.md (100%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/docs/Get-AzBlockchainTransactionNodeApiKey.md (100%) rename src/{BlockChain => Blockchain}/docs/New-AzBlockchainMember.md (100%) rename src/{BlockChain => Blockchain}/docs/New-AzBlockchainMemberApiKey.md (91%) rename src/{BlockChain => Blockchain}/docs/New-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/docs/New-AzBlockchainTransactionNodeApiKey.md (97%) rename src/{BlockChain => Blockchain}/docs/Remove-AzBlockchainMember.md (100%) rename src/{BlockChain => Blockchain}/docs/Remove-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/docs/Test-AzBlockchainLocationNameAvailability.md (100%) rename src/{BlockChain => Blockchain}/docs/Update-AzBlockchainMember.md (100%) rename src/{BlockChain => Blockchain}/docs/Update-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/docs/readme.md (100%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainConsortium.md (100%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainMember.md (93%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainMemberApiKey.md (100%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainMemberConsortiumMember.md (100%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainSku.md (100%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/examples/Get-AzBlockchainTransactionNodeApiKey.md (100%) rename src/{BlockChain => Blockchain}/examples/New-AzBlockchainMember.md (100%) rename src/{BlockChain => Blockchain}/examples/New-AzBlockchainMemberApiKey.md (53%) rename src/{BlockChain => Blockchain}/examples/New-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/examples/New-AzBlockchainTransactionNodeApiKey.md (82%) rename src/{BlockChain => Blockchain}/examples/Remove-AzBlockchainMember.md (100%) rename src/{BlockChain => Blockchain}/examples/Remove-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/examples/Test-AzBlockchainLocationNameAvailability.md (100%) rename src/{BlockChain => Blockchain}/examples/Update-AzBlockchainMember.md (100%) rename src/{BlockChain => Blockchain}/examples/Update-AzBlockchainTransactionNode.md (100%) rename src/{BlockChain => Blockchain}/how-to.md (100%) rename src/{BlockChain => Blockchain}/license.txt (100%) rename src/{BlockChain => Blockchain}/readme.md (100%) rename src/{BlockChain => Blockchain}/resources/readme.md (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainConsortium.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainConsortium.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainMember.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainMember.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainMemberApiKey.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainMemberApiKey.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainMemberConsortiumMember.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainMemberConsortiumMember.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainSku.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainSku.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainTransactionNode.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainTransactionNode.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainTransactionNodeApiKey.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Get-AzBlockchainTransactionNodeApiKey.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainMember.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainMember.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainMemberApiKey.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainMemberApiKey.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainTransactionNode.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainTransactionNode.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainTransactionNodeApiKey.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/New-AzBlockchainTransactionNodeApiKey.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Remove-AzBlockchainMember.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Remove-AzBlockchainMember.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Remove-AzBlockchainTransactionNode.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Remove-AzBlockchainTransactionNode.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Test-AzBlockchainLocationNameAvailability.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Test-AzBlockchainLocationNameAvailability.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Update-AzBlockchainMember.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Update-AzBlockchainMember.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/Update-AzBlockchainTransactionNode.Recording.json (100%) rename src/{BlockChain => Blockchain}/test/Update-AzBlockchainTransactionNode.Tests.ps1 (100%) rename src/{BlockChain => Blockchain}/test/env.json (100%) rename src/{BlockChain => Blockchain}/test/loadEnv.ps1 (100%) rename src/{BlockChain => Blockchain}/test/readme.md (100%) rename src/{BlockChain => Blockchain}/test/utils.ps1 (100%) create mode 100644 src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 create mode 100644 src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 create mode 100644 src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 create mode 100644 src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 create mode 100644 src/CostManagement/custom/readme.md create mode 100644 src/CostManagement/readme.md create mode 100644 src/CostManagement/resources/Create.ps1 create mode 100644 src/CostManagement/resources/costmanagement.json create mode 100644 src/CostManagement/resources/readme.md diff --git a/src/BlockChain/.gitattributes b/src/Blockchain/.gitattributes similarity index 100% rename from src/BlockChain/.gitattributes rename to src/Blockchain/.gitattributes diff --git a/src/BlockChain/.gitignore b/src/Blockchain/.gitignore similarity index 100% rename from src/BlockChain/.gitignore rename to src/Blockchain/.gitignore diff --git a/src/BlockChain/Az.Blockchain.psd1 b/src/Blockchain/Az.Blockchain.psd1 similarity index 100% rename from src/BlockChain/Az.Blockchain.psd1 rename to src/Blockchain/Az.Blockchain.psd1 diff --git a/src/BlockChain/custom/New-AzBlockchainMember.ps1 b/src/Blockchain/custom/New-AzBlockchainMember.ps1 similarity index 100% rename from src/BlockChain/custom/New-AzBlockchainMember.ps1 rename to src/Blockchain/custom/New-AzBlockchainMember.ps1 diff --git a/src/BlockChain/custom/New-AzBlockchainTransactionNode.ps1 b/src/Blockchain/custom/New-AzBlockchainTransactionNode.ps1 similarity index 100% rename from src/BlockChain/custom/New-AzBlockchainTransactionNode.ps1 rename to src/Blockchain/custom/New-AzBlockchainTransactionNode.ps1 diff --git a/src/BlockChain/custom/Update-AzBlockchainMember.ps1 b/src/Blockchain/custom/Update-AzBlockchainMember.ps1 similarity index 100% rename from src/BlockChain/custom/Update-AzBlockchainMember.ps1 rename to src/Blockchain/custom/Update-AzBlockchainMember.ps1 diff --git a/src/BlockChain/custom/Update-AzBlockchainTransactionNode.ps1 b/src/Blockchain/custom/Update-AzBlockchainTransactionNode.ps1 similarity index 100% rename from src/BlockChain/custom/Update-AzBlockchainTransactionNode.ps1 rename to src/Blockchain/custom/Update-AzBlockchainTransactionNode.ps1 diff --git a/src/BlockChain/custom/readme.md b/src/Blockchain/custom/readme.md similarity index 100% rename from src/BlockChain/custom/readme.md rename to src/Blockchain/custom/readme.md diff --git a/src/BlockChain/docs/Az.Blockchain.md b/src/Blockchain/docs/Az.Blockchain.md similarity index 100% rename from src/BlockChain/docs/Az.Blockchain.md rename to src/Blockchain/docs/Az.Blockchain.md diff --git a/src/BlockChain/docs/Get-AzBlockchainConsortium.md b/src/Blockchain/docs/Get-AzBlockchainConsortium.md similarity index 100% rename from src/BlockChain/docs/Get-AzBlockchainConsortium.md rename to src/Blockchain/docs/Get-AzBlockchainConsortium.md diff --git a/src/BlockChain/docs/Get-AzBlockchainMember.md b/src/Blockchain/docs/Get-AzBlockchainMember.md similarity index 98% rename from src/BlockChain/docs/Get-AzBlockchainMember.md rename to src/Blockchain/docs/Get-AzBlockchainMember.md index e5a056066e79..149857fb4d9d 100644 --- a/src/BlockChain/docs/Get-AzBlockchainMember.md +++ b/src/Blockchain/docs/Get-AzBlockchainMember.md @@ -78,7 +78,7 @@ This command gets a blockchain member under a resource group. ### Example 4: Get a blockchain member ```powershell -PS C:\> $member = Get-AzBlockchainMember -ResourceGroupName lucas-blockchain-rg -Name myblockchaine0f3ol +PS C:\> $member = Get-AzBlockchainMember -ResourceGroupName blockchain-rg -Name myblockchaine0f3ol PS C:\> Get-AzBlockchainMember -InputObject $membe Location Name Type diff --git a/src/BlockChain/docs/Get-AzBlockchainMemberApiKey.md b/src/Blockchain/docs/Get-AzBlockchainMemberApiKey.md similarity index 100% rename from src/BlockChain/docs/Get-AzBlockchainMemberApiKey.md rename to src/Blockchain/docs/Get-AzBlockchainMemberApiKey.md diff --git a/src/BlockChain/docs/Get-AzBlockchainMemberConsortiumMember.md b/src/Blockchain/docs/Get-AzBlockchainMemberConsortiumMember.md similarity index 100% rename from src/BlockChain/docs/Get-AzBlockchainMemberConsortiumMember.md rename to src/Blockchain/docs/Get-AzBlockchainMemberConsortiumMember.md diff --git a/src/BlockChain/docs/Get-AzBlockchainSku.md b/src/Blockchain/docs/Get-AzBlockchainSku.md similarity index 100% rename from src/BlockChain/docs/Get-AzBlockchainSku.md rename to src/Blockchain/docs/Get-AzBlockchainSku.md diff --git a/src/BlockChain/docs/Get-AzBlockchainTransactionNode.md b/src/Blockchain/docs/Get-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/docs/Get-AzBlockchainTransactionNode.md rename to src/Blockchain/docs/Get-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/docs/Get-AzBlockchainTransactionNodeApiKey.md b/src/Blockchain/docs/Get-AzBlockchainTransactionNodeApiKey.md similarity index 100% rename from src/BlockChain/docs/Get-AzBlockchainTransactionNodeApiKey.md rename to src/Blockchain/docs/Get-AzBlockchainTransactionNodeApiKey.md diff --git a/src/BlockChain/docs/New-AzBlockchainMember.md b/src/Blockchain/docs/New-AzBlockchainMember.md similarity index 100% rename from src/BlockChain/docs/New-AzBlockchainMember.md rename to src/Blockchain/docs/New-AzBlockchainMember.md diff --git a/src/BlockChain/docs/New-AzBlockchainMemberApiKey.md b/src/Blockchain/docs/New-AzBlockchainMemberApiKey.md similarity index 91% rename from src/BlockChain/docs/New-AzBlockchainMemberApiKey.md rename to src/Blockchain/docs/New-AzBlockchainMemberApiKey.md index ea1471a75854..ffd0d3f595cc 100644 --- a/src/BlockChain/docs/New-AzBlockchainMemberApiKey.md +++ b/src/Blockchain/docs/New-AzBlockchainMemberApiKey.md @@ -30,10 +30,10 @@ Regenerate the API keys for a blockchain member. ## EXAMPLES -### Example 1: Regenerate Api keys for a blockchain member +### Example 1: Regenerate Api keys for a blockchain member using name ```powershell -PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName lucas-bc-rg -PS C:\> New-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName lucas-bc-rg -KeyName $keyPair[0].KeyName +PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName bc-rg +PS C:\> New-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName bc-rg -KeyName $keyPair[0].KeyName KeyName Value ------- ----- @@ -41,12 +41,12 @@ key1 D7wyajHMZcBw4MndMgytqanz key2 eu9kx94TKH506R0i4JhYBmsx ``` -This command regenerates Api keys for a blockchain member. +This command regenerates Api keys for a blockchain member using name, resource group. -### Example 1: Regenerate Api keys for a blockchain member +### Example 2: Regenerate Api keys for a blockchain member using idenity ```powershell -PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName lucas-bc-rg -PS C:\> $bcMember = Get-AzBlockchainMember -Name myblockchainhlqc92 -ResourceGroupName lucas-bc-rg +PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName bc-rg +PS C:\> $bcMember = Get-AzBlockchainMember -Name myblockchainhlqc92 -ResourceGroupName bc-rg PS C:\> New-AzBlockchainMemberApiKey -InputObject $bcMember -KeyName $keyPair[0].KeyName KeyName Value @@ -55,7 +55,7 @@ key1 DdsyaaHsdasd46asd8Bw4Mnd key2 eu9kx94TKH506R0i4JhYBmsx ``` -This command regenerates Api keys for a blockchain member. +This command regenerates Api keys for a blockchain member using input object. ## PARAMETERS diff --git a/src/BlockChain/docs/New-AzBlockchainTransactionNode.md b/src/Blockchain/docs/New-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/docs/New-AzBlockchainTransactionNode.md rename to src/Blockchain/docs/New-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/docs/New-AzBlockchainTransactionNodeApiKey.md b/src/Blockchain/docs/New-AzBlockchainTransactionNodeApiKey.md similarity index 97% rename from src/BlockChain/docs/New-AzBlockchainTransactionNodeApiKey.md rename to src/Blockchain/docs/New-AzBlockchainTransactionNodeApiKey.md index 2d1c8da791e7..67425797501d 100644 --- a/src/BlockChain/docs/New-AzBlockchainTransactionNodeApiKey.md +++ b/src/Blockchain/docs/New-AzBlockchainTransactionNodeApiKey.md @@ -30,7 +30,7 @@ Regenerate the API keys for the blockchain member. ## EXAMPLES -### Example 1: Regenerate Api keys for a transaction node +### Example 1: Regenerate Api keys for a transaction node using name. ```powershell PS C:\> $keyPair = Get-AzBlockchainTransactionNodeApiKey -BlockchainMemberName dolauli001 -ResourceGroupName testgroup -TransactionNodeName tranctionnode001 PS C:\> New-AzBlockchainTransactionNodeApiKey -BlockchainMemberName dolauli001 -ResourceGroupName testgroup -TransactionNodeName tranctionnode001 -KeyName $keyPair[0].KeyName @@ -41,7 +41,7 @@ key1 0-UCaNSNfS0lwRKRyv09sgb- key2 0Prk4Dl3lsOKdhyPEFQ-AnQb ``` -This command generates Api keys for a transaction node. +This command generates Api keys for a transaction node using name, resource group. ### Example 2: Regenerate Api keys for a transaction node ```powershell diff --git a/src/BlockChain/docs/Remove-AzBlockchainMember.md b/src/Blockchain/docs/Remove-AzBlockchainMember.md similarity index 100% rename from src/BlockChain/docs/Remove-AzBlockchainMember.md rename to src/Blockchain/docs/Remove-AzBlockchainMember.md diff --git a/src/BlockChain/docs/Remove-AzBlockchainTransactionNode.md b/src/Blockchain/docs/Remove-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/docs/Remove-AzBlockchainTransactionNode.md rename to src/Blockchain/docs/Remove-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/docs/Test-AzBlockchainLocationNameAvailability.md b/src/Blockchain/docs/Test-AzBlockchainLocationNameAvailability.md similarity index 100% rename from src/BlockChain/docs/Test-AzBlockchainLocationNameAvailability.md rename to src/Blockchain/docs/Test-AzBlockchainLocationNameAvailability.md diff --git a/src/BlockChain/docs/Update-AzBlockchainMember.md b/src/Blockchain/docs/Update-AzBlockchainMember.md similarity index 100% rename from src/BlockChain/docs/Update-AzBlockchainMember.md rename to src/Blockchain/docs/Update-AzBlockchainMember.md diff --git a/src/BlockChain/docs/Update-AzBlockchainTransactionNode.md b/src/Blockchain/docs/Update-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/docs/Update-AzBlockchainTransactionNode.md rename to src/Blockchain/docs/Update-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/docs/readme.md b/src/Blockchain/docs/readme.md similarity index 100% rename from src/BlockChain/docs/readme.md rename to src/Blockchain/docs/readme.md diff --git a/src/BlockChain/examples/Get-AzBlockchainConsortium.md b/src/Blockchain/examples/Get-AzBlockchainConsortium.md similarity index 100% rename from src/BlockChain/examples/Get-AzBlockchainConsortium.md rename to src/Blockchain/examples/Get-AzBlockchainConsortium.md diff --git a/src/BlockChain/examples/Get-AzBlockchainMember.md b/src/Blockchain/examples/Get-AzBlockchainMember.md similarity index 93% rename from src/BlockChain/examples/Get-AzBlockchainMember.md rename to src/Blockchain/examples/Get-AzBlockchainMember.md index bb3b455210f2..1394a454d5ec 100644 --- a/src/BlockChain/examples/Get-AzBlockchainMember.md +++ b/src/Blockchain/examples/Get-AzBlockchainMember.md @@ -38,7 +38,7 @@ This command gets a blockchain member under a resource group. ### Example 4: Get a blockchain member ```powershell -PS C:\> $member = Get-AzBlockchainMember -ResourceGroupName lucas-blockchain-rg -Name myblockchaine0f3ol +PS C:\> $member = Get-AzBlockchainMember -ResourceGroupName blockchain-rg -Name myblockchaine0f3ol PS C:\> Get-AzBlockchainMember -InputObject $membe Location Name Type diff --git a/src/BlockChain/examples/Get-AzBlockchainMemberApiKey.md b/src/Blockchain/examples/Get-AzBlockchainMemberApiKey.md similarity index 100% rename from src/BlockChain/examples/Get-AzBlockchainMemberApiKey.md rename to src/Blockchain/examples/Get-AzBlockchainMemberApiKey.md diff --git a/src/BlockChain/examples/Get-AzBlockchainMemberConsortiumMember.md b/src/Blockchain/examples/Get-AzBlockchainMemberConsortiumMember.md similarity index 100% rename from src/BlockChain/examples/Get-AzBlockchainMemberConsortiumMember.md rename to src/Blockchain/examples/Get-AzBlockchainMemberConsortiumMember.md diff --git a/src/BlockChain/examples/Get-AzBlockchainSku.md b/src/Blockchain/examples/Get-AzBlockchainSku.md similarity index 100% rename from src/BlockChain/examples/Get-AzBlockchainSku.md rename to src/Blockchain/examples/Get-AzBlockchainSku.md diff --git a/src/BlockChain/examples/Get-AzBlockchainTransactionNode.md b/src/Blockchain/examples/Get-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/examples/Get-AzBlockchainTransactionNode.md rename to src/Blockchain/examples/Get-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/examples/Get-AzBlockchainTransactionNodeApiKey.md b/src/Blockchain/examples/Get-AzBlockchainTransactionNodeApiKey.md similarity index 100% rename from src/BlockChain/examples/Get-AzBlockchainTransactionNodeApiKey.md rename to src/Blockchain/examples/Get-AzBlockchainTransactionNodeApiKey.md diff --git a/src/BlockChain/examples/New-AzBlockchainMember.md b/src/Blockchain/examples/New-AzBlockchainMember.md similarity index 100% rename from src/BlockChain/examples/New-AzBlockchainMember.md rename to src/Blockchain/examples/New-AzBlockchainMember.md diff --git a/src/BlockChain/examples/New-AzBlockchainMemberApiKey.md b/src/Blockchain/examples/New-AzBlockchainMemberApiKey.md similarity index 53% rename from src/BlockChain/examples/New-AzBlockchainMemberApiKey.md rename to src/Blockchain/examples/New-AzBlockchainMemberApiKey.md index 732fafe41d99..1bfb3d0b0582 100644 --- a/src/BlockChain/examples/New-AzBlockchainMemberApiKey.md +++ b/src/Blockchain/examples/New-AzBlockchainMemberApiKey.md @@ -1,7 +1,7 @@ -### Example 1: Regenerate Api keys for a blockchain member +### Example 1: Regenerate Api keys for a blockchain member using name ```powershell -PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName lucas-bc-rg -PS C:\> New-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName lucas-bc-rg -KeyName $keyPair[0].KeyName +PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName bc-rg +PS C:\> New-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName bc-rg -KeyName $keyPair[0].KeyName KeyName Value ------- ----- @@ -9,13 +9,13 @@ key1 D7wyajHMZcBw4MndMgytqanz key2 eu9kx94TKH506R0i4JhYBmsx ``` -This command regenerates Api keys for a blockchain member. +This command regenerates Api keys for a blockchain member using name, resource group. -### Example 1: Regenerate Api keys for a blockchain member +### Example 2: Regenerate Api keys for a blockchain member using idenity ```powershell -PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName lucas-bc-rg -PS C:\> $bcMember = Get-AzBlockchainMember -Name myblockchainhlqc92 -ResourceGroupName lucas-bc-rg +PS C:\> $keyPair = Get-AzBlockchainMemberApiKey -BlockchainMemberName myblockchainhlqc92 -ResourceGroupName bc-rg +PS C:\> $bcMember = Get-AzBlockchainMember -Name myblockchainhlqc92 -ResourceGroupName bc-rg PS C:\> New-AzBlockchainMemberApiKey -InputObject $bcMember -KeyName $keyPair[0].KeyName KeyName Value @@ -24,4 +24,4 @@ key1 DdsyaaHsdasd46asd8Bw4Mnd key2 eu9kx94TKH506R0i4JhYBmsx ``` -This command regenerates Api keys for a blockchain member. +This command regenerates Api keys for a blockchain member using identity. diff --git a/src/BlockChain/examples/New-AzBlockchainTransactionNode.md b/src/Blockchain/examples/New-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/examples/New-AzBlockchainTransactionNode.md rename to src/Blockchain/examples/New-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/examples/New-AzBlockchainTransactionNodeApiKey.md b/src/Blockchain/examples/New-AzBlockchainTransactionNodeApiKey.md similarity index 82% rename from src/BlockChain/examples/New-AzBlockchainTransactionNodeApiKey.md rename to src/Blockchain/examples/New-AzBlockchainTransactionNodeApiKey.md index c8341948dc5c..f874f2dee91d 100644 --- a/src/BlockChain/examples/New-AzBlockchainTransactionNodeApiKey.md +++ b/src/Blockchain/examples/New-AzBlockchainTransactionNodeApiKey.md @@ -1,4 +1,4 @@ -### Example 1: Regenerate Api keys for a transaction node +### Example 1: Regenerate Api keys for a transaction node using name. ```powershell PS C:\> $keyPair = Get-AzBlockchainTransactionNodeApiKey -BlockchainMemberName dolauli001 -ResourceGroupName testgroup -TransactionNodeName tranctionnode001 PS C:\> New-AzBlockchainTransactionNodeApiKey -BlockchainMemberName dolauli001 -ResourceGroupName testgroup -TransactionNodeName tranctionnode001 -KeyName $keyPair[0].KeyName @@ -9,7 +9,7 @@ key1 0-UCaNSNfS0lwRKRyv09sgb- key2 0Prk4Dl3lsOKdhyPEFQ-AnQb ``` -This command generates Api keys for a transaction node. +This command generates Api keys for a transaction node using name, resource group. ### Example 2: Regenerate Api keys for a transaction node ```powershell @@ -23,6 +23,6 @@ key1 0-UCaNSNfS0lwRKRyv09sgb- key2 0Prk4Dl3lsOKdhyPEFQ-AnQb ``` -This command generates Api keys for a transaction node. +This command generates Api keys for a transaction node using idenity. diff --git a/src/BlockChain/examples/Remove-AzBlockchainMember.md b/src/Blockchain/examples/Remove-AzBlockchainMember.md similarity index 100% rename from src/BlockChain/examples/Remove-AzBlockchainMember.md rename to src/Blockchain/examples/Remove-AzBlockchainMember.md diff --git a/src/BlockChain/examples/Remove-AzBlockchainTransactionNode.md b/src/Blockchain/examples/Remove-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/examples/Remove-AzBlockchainTransactionNode.md rename to src/Blockchain/examples/Remove-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/examples/Test-AzBlockchainLocationNameAvailability.md b/src/Blockchain/examples/Test-AzBlockchainLocationNameAvailability.md similarity index 100% rename from src/BlockChain/examples/Test-AzBlockchainLocationNameAvailability.md rename to src/Blockchain/examples/Test-AzBlockchainLocationNameAvailability.md diff --git a/src/BlockChain/examples/Update-AzBlockchainMember.md b/src/Blockchain/examples/Update-AzBlockchainMember.md similarity index 100% rename from src/BlockChain/examples/Update-AzBlockchainMember.md rename to src/Blockchain/examples/Update-AzBlockchainMember.md diff --git a/src/BlockChain/examples/Update-AzBlockchainTransactionNode.md b/src/Blockchain/examples/Update-AzBlockchainTransactionNode.md similarity index 100% rename from src/BlockChain/examples/Update-AzBlockchainTransactionNode.md rename to src/Blockchain/examples/Update-AzBlockchainTransactionNode.md diff --git a/src/BlockChain/how-to.md b/src/Blockchain/how-to.md similarity index 100% rename from src/BlockChain/how-to.md rename to src/Blockchain/how-to.md diff --git a/src/BlockChain/license.txt b/src/Blockchain/license.txt similarity index 100% rename from src/BlockChain/license.txt rename to src/Blockchain/license.txt diff --git a/src/BlockChain/readme.md b/src/Blockchain/readme.md similarity index 100% rename from src/BlockChain/readme.md rename to src/Blockchain/readme.md diff --git a/src/BlockChain/resources/readme.md b/src/Blockchain/resources/readme.md similarity index 100% rename from src/BlockChain/resources/readme.md rename to src/Blockchain/resources/readme.md diff --git a/src/BlockChain/test/Get-AzBlockchainConsortium.Recording.json b/src/Blockchain/test/Get-AzBlockchainConsortium.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainConsortium.Recording.json rename to src/Blockchain/test/Get-AzBlockchainConsortium.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainConsortium.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainConsortium.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainConsortium.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainConsortium.Tests.ps1 diff --git a/src/BlockChain/test/Get-AzBlockchainMember.Recording.json b/src/Blockchain/test/Get-AzBlockchainMember.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainMember.Recording.json rename to src/Blockchain/test/Get-AzBlockchainMember.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainMember.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainMember.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainMember.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainMember.Tests.ps1 diff --git a/src/BlockChain/test/Get-AzBlockchainMemberApiKey.Recording.json b/src/Blockchain/test/Get-AzBlockchainMemberApiKey.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainMemberApiKey.Recording.json rename to src/Blockchain/test/Get-AzBlockchainMemberApiKey.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainMemberApiKey.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainMemberApiKey.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainMemberApiKey.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainMemberApiKey.Tests.ps1 diff --git a/src/BlockChain/test/Get-AzBlockchainMemberConsortiumMember.Recording.json b/src/Blockchain/test/Get-AzBlockchainMemberConsortiumMember.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainMemberConsortiumMember.Recording.json rename to src/Blockchain/test/Get-AzBlockchainMemberConsortiumMember.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainMemberConsortiumMember.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainMemberConsortiumMember.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainMemberConsortiumMember.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainMemberConsortiumMember.Tests.ps1 diff --git a/src/BlockChain/test/Get-AzBlockchainSku.Recording.json b/src/Blockchain/test/Get-AzBlockchainSku.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainSku.Recording.json rename to src/Blockchain/test/Get-AzBlockchainSku.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainSku.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainSku.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainSku.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainSku.Tests.ps1 diff --git a/src/BlockChain/test/Get-AzBlockchainTransactionNode.Recording.json b/src/Blockchain/test/Get-AzBlockchainTransactionNode.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainTransactionNode.Recording.json rename to src/Blockchain/test/Get-AzBlockchainTransactionNode.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainTransactionNode.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainTransactionNode.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainTransactionNode.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainTransactionNode.Tests.ps1 diff --git a/src/BlockChain/test/Get-AzBlockchainTransactionNodeApiKey.Recording.json b/src/Blockchain/test/Get-AzBlockchainTransactionNodeApiKey.Recording.json similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainTransactionNodeApiKey.Recording.json rename to src/Blockchain/test/Get-AzBlockchainTransactionNodeApiKey.Recording.json diff --git a/src/BlockChain/test/Get-AzBlockchainTransactionNodeApiKey.Tests.ps1 b/src/Blockchain/test/Get-AzBlockchainTransactionNodeApiKey.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Get-AzBlockchainTransactionNodeApiKey.Tests.ps1 rename to src/Blockchain/test/Get-AzBlockchainTransactionNodeApiKey.Tests.ps1 diff --git a/src/BlockChain/test/New-AzBlockchainMember.Recording.json b/src/Blockchain/test/New-AzBlockchainMember.Recording.json similarity index 100% rename from src/BlockChain/test/New-AzBlockchainMember.Recording.json rename to src/Blockchain/test/New-AzBlockchainMember.Recording.json diff --git a/src/BlockChain/test/New-AzBlockchainMember.Tests.ps1 b/src/Blockchain/test/New-AzBlockchainMember.Tests.ps1 similarity index 100% rename from src/BlockChain/test/New-AzBlockchainMember.Tests.ps1 rename to src/Blockchain/test/New-AzBlockchainMember.Tests.ps1 diff --git a/src/BlockChain/test/New-AzBlockchainMemberApiKey.Recording.json b/src/Blockchain/test/New-AzBlockchainMemberApiKey.Recording.json similarity index 100% rename from src/BlockChain/test/New-AzBlockchainMemberApiKey.Recording.json rename to src/Blockchain/test/New-AzBlockchainMemberApiKey.Recording.json diff --git a/src/BlockChain/test/New-AzBlockchainMemberApiKey.Tests.ps1 b/src/Blockchain/test/New-AzBlockchainMemberApiKey.Tests.ps1 similarity index 100% rename from src/BlockChain/test/New-AzBlockchainMemberApiKey.Tests.ps1 rename to src/Blockchain/test/New-AzBlockchainMemberApiKey.Tests.ps1 diff --git a/src/BlockChain/test/New-AzBlockchainTransactionNode.Recording.json b/src/Blockchain/test/New-AzBlockchainTransactionNode.Recording.json similarity index 100% rename from src/BlockChain/test/New-AzBlockchainTransactionNode.Recording.json rename to src/Blockchain/test/New-AzBlockchainTransactionNode.Recording.json diff --git a/src/BlockChain/test/New-AzBlockchainTransactionNode.Tests.ps1 b/src/Blockchain/test/New-AzBlockchainTransactionNode.Tests.ps1 similarity index 100% rename from src/BlockChain/test/New-AzBlockchainTransactionNode.Tests.ps1 rename to src/Blockchain/test/New-AzBlockchainTransactionNode.Tests.ps1 diff --git a/src/BlockChain/test/New-AzBlockchainTransactionNodeApiKey.Recording.json b/src/Blockchain/test/New-AzBlockchainTransactionNodeApiKey.Recording.json similarity index 100% rename from src/BlockChain/test/New-AzBlockchainTransactionNodeApiKey.Recording.json rename to src/Blockchain/test/New-AzBlockchainTransactionNodeApiKey.Recording.json diff --git a/src/BlockChain/test/New-AzBlockchainTransactionNodeApiKey.Tests.ps1 b/src/Blockchain/test/New-AzBlockchainTransactionNodeApiKey.Tests.ps1 similarity index 100% rename from src/BlockChain/test/New-AzBlockchainTransactionNodeApiKey.Tests.ps1 rename to src/Blockchain/test/New-AzBlockchainTransactionNodeApiKey.Tests.ps1 diff --git a/src/BlockChain/test/Remove-AzBlockchainMember.Recording.json b/src/Blockchain/test/Remove-AzBlockchainMember.Recording.json similarity index 100% rename from src/BlockChain/test/Remove-AzBlockchainMember.Recording.json rename to src/Blockchain/test/Remove-AzBlockchainMember.Recording.json diff --git a/src/BlockChain/test/Remove-AzBlockchainMember.Tests.ps1 b/src/Blockchain/test/Remove-AzBlockchainMember.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Remove-AzBlockchainMember.Tests.ps1 rename to src/Blockchain/test/Remove-AzBlockchainMember.Tests.ps1 diff --git a/src/BlockChain/test/Remove-AzBlockchainTransactionNode.Recording.json b/src/Blockchain/test/Remove-AzBlockchainTransactionNode.Recording.json similarity index 100% rename from src/BlockChain/test/Remove-AzBlockchainTransactionNode.Recording.json rename to src/Blockchain/test/Remove-AzBlockchainTransactionNode.Recording.json diff --git a/src/BlockChain/test/Remove-AzBlockchainTransactionNode.Tests.ps1 b/src/Blockchain/test/Remove-AzBlockchainTransactionNode.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Remove-AzBlockchainTransactionNode.Tests.ps1 rename to src/Blockchain/test/Remove-AzBlockchainTransactionNode.Tests.ps1 diff --git a/src/BlockChain/test/Test-AzBlockchainLocationNameAvailability.Recording.json b/src/Blockchain/test/Test-AzBlockchainLocationNameAvailability.Recording.json similarity index 100% rename from src/BlockChain/test/Test-AzBlockchainLocationNameAvailability.Recording.json rename to src/Blockchain/test/Test-AzBlockchainLocationNameAvailability.Recording.json diff --git a/src/BlockChain/test/Test-AzBlockchainLocationNameAvailability.Tests.ps1 b/src/Blockchain/test/Test-AzBlockchainLocationNameAvailability.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Test-AzBlockchainLocationNameAvailability.Tests.ps1 rename to src/Blockchain/test/Test-AzBlockchainLocationNameAvailability.Tests.ps1 diff --git a/src/BlockChain/test/Update-AzBlockchainMember.Recording.json b/src/Blockchain/test/Update-AzBlockchainMember.Recording.json similarity index 100% rename from src/BlockChain/test/Update-AzBlockchainMember.Recording.json rename to src/Blockchain/test/Update-AzBlockchainMember.Recording.json diff --git a/src/BlockChain/test/Update-AzBlockchainMember.Tests.ps1 b/src/Blockchain/test/Update-AzBlockchainMember.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Update-AzBlockchainMember.Tests.ps1 rename to src/Blockchain/test/Update-AzBlockchainMember.Tests.ps1 diff --git a/src/BlockChain/test/Update-AzBlockchainTransactionNode.Recording.json b/src/Blockchain/test/Update-AzBlockchainTransactionNode.Recording.json similarity index 100% rename from src/BlockChain/test/Update-AzBlockchainTransactionNode.Recording.json rename to src/Blockchain/test/Update-AzBlockchainTransactionNode.Recording.json diff --git a/src/BlockChain/test/Update-AzBlockchainTransactionNode.Tests.ps1 b/src/Blockchain/test/Update-AzBlockchainTransactionNode.Tests.ps1 similarity index 100% rename from src/BlockChain/test/Update-AzBlockchainTransactionNode.Tests.ps1 rename to src/Blockchain/test/Update-AzBlockchainTransactionNode.Tests.ps1 diff --git a/src/BlockChain/test/env.json b/src/Blockchain/test/env.json similarity index 100% rename from src/BlockChain/test/env.json rename to src/Blockchain/test/env.json diff --git a/src/BlockChain/test/loadEnv.ps1 b/src/Blockchain/test/loadEnv.ps1 similarity index 100% rename from src/BlockChain/test/loadEnv.ps1 rename to src/Blockchain/test/loadEnv.ps1 diff --git a/src/BlockChain/test/readme.md b/src/Blockchain/test/readme.md similarity index 100% rename from src/BlockChain/test/readme.md rename to src/Blockchain/test/readme.md diff --git a/src/BlockChain/test/utils.ps1 b/src/Blockchain/test/utils.ps1 similarity index 100% rename from src/BlockChain/test/utils.ps1 rename to src/Blockchain/test/utils.ps1 diff --git a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 new file mode 100644 index 000000000000..093cf0b3f25f --- /dev/null +++ b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 @@ -0,0 +1,329 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Query the usage data for scope defined. +.Description +Query the usage data for scope defined. +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryDefinition +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DATASETFILTER : Has filter expression to use in the query. + [And ]: The logical "AND" expression. Must have at least 2 items. + [Dimension ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Operator : The operator to use for comparison. + Value : Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or ]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag + +DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Name : The name of the column to group. + Type : Has type of the column to group. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [ExportName ]: Export Name. + [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [Id ]: Resource identity path + [Scope ]: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + [ViewName ]: View name + +PARAMETER : The definition of a query. + TimePeriodFrom : The start date to pull data from. + TimePeriodTo : The end date to pull data to. + Timeframe : The time frame for pulling data for the query. If custom, then a specific time period must be provided. + Type : The type of the query. + [ConfigurationColumn ]: Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. + [DatasetAggregation ]: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. + [(Any) ]: This indicates any property can be added to this object. + [DatasetFilter ]: Has filter expression to use in the query. + [And ]: The logical "AND" expression. Must have at least 2 items. + [Dimension ]: Has comparison expression for a dimension + Name : The name of the column to use in comparison. + Operator : The operator to use for comparison. + Value : Array of values to use for comparison + [Not ]: The logical "NOT" expression. + [Or ]: The logical "OR" expression. Must have at least 2 items. + [Tag ]: Has comparison expression for a tag + [DatasetGranularity ]: The granularity of rows in the query. + [DatasetGrouping ]: Array of group by expression to use in the query. Query can have up to 2 group by clauses. + Name : The name of the column to group. + Type : Has type of the column to group. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery +#> +function Invoke-AzCostManagementUsageQuery { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult])] +[CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The scope associated with query and export operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # The scope associated with query and export operations. + # This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + ${Scope}, + + [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [System.String] + # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + ${ExternalCloudProviderId}, + + [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The external cloud provider type associated with dimension/query operations.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + # The external cloud provider type associated with dimension/query operations. + # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + ${ExternalCloudProviderType}, + + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, ValueFromPipeline, HelpMessage="Identity Parameter")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, ValueFromPipeline, HelpMessage="Identity Parameter")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The time frame for pulling data for the query.")] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The time frame for pulling data for the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, HelpMessage="The time frame for pulling data for the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, HelpMessage="The time frame for pulling data for the query.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] + # The time frame for pulling data for the query. + # If custom, then a specific time period must be provided. + ${Timeframe}, + + [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The type of the query.")] + [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The type of the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, HelpMessage="The type of the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, HelpMessage="The type of the query.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] + # The type of the query. + ${Type}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Array of column names to be included in the query.")] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of column names to be included in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Array of column names to be included in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Array of column names to be included in the query.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.String[]] + # Array of column names to be included in the query. + # Any valid query column name is allowed. + # If not provided, then query includes all columns. + ${ConfigurationColumn}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Dictionary of aggregation expression to use in the query.")] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Dictionary of aggregation expression to use in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Dictionary of aggregation expression to use in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Dictionary of aggregation expression to use in the query.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryDatasetAggregation]))] + [System.Collections.Hashtable] + # Dictionary of aggregation expression to use in the query. + # The key of each item in the dictionary is the alias for the aggregated column. + # Query can have up to 2 aggregation clauses. + ${DatasetAggregation}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Has filter expression to use in the query.")] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Has filter expression to use in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Has filter expression to use in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Has filter expression to use in the query.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter] + # Has filter expression to use in the query. + # To construct, see NOTES section for DATASETFILTER properties and create a hash table. + ${DatasetFilter}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The granularity of rows in the query.")] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The granularity of rows in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="The granularity of rows in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="The granularity of rows in the query.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + # The granularity of rows in the query. + ${DatasetGranularity}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage='Array of group by expression to use in the query.')] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of group by expression to use in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Array of group by expression to use in the query.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Array of group by expression to use in the query.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[]] + # Array of group by expression to use in the query. + # Query can have up to 2 group by clauses. + # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + ${DatasetGrouping}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The start date to pull data from.")] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The start date to pull data from.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="The start date to pull data from.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="The start date to pull data from.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The start date to pull data from. + ${TimePeriodFrom}, + + [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The end date to pull data to.")] + [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The end date to pull data to.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="The end date to pull data to.")] + [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="The end date to pull data to.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [System.DateTime] + # The end date to pull data to. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + + process { + $ApiVersion = '2019-11-01-preview' + + $URL = '' + if ($PSBoundParameters.ContainsKey('ExternalCloudProviderType')) { + $URL = [System.Uri]::New([System.Text.RegularExpressions.Regex]::Replace( + "https://management.azure.com/providers/Microsoft.CostManagement/$ExternalCloudProviderType/$ExternalCloudProviderId/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2")) + } else { + if (-not $PSBoundParameters.ContainsKey('Scope')) { + $ResourceId = $InputObject.Id + if ($null -eq $ResourceId) { + $ErrorMessage = 'Id in input object should not be empty.' + throw [System.IO.FileNotFoundException] $ErrorMessage + } + $match = [System.Text.RegularExpressions].Regex("^/(?[^/]+)/providers/Microsoft.CostManagement/query$").Match($ResourceId); + if (-not $match.Success) + { + throw [System.IO.FileNotFoundException] "Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/query'" + } + $Scope = $match.Groups["scope"].Value + } + $URL = [System.Uri]::New([System.Text.RegularExpressions.Regex]::Replace( + "https://management.azure.com/$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2")) + } + + $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryDefinition]::New() + if ($PSBoundParameters.ContainsKey('ConfigurationColumn')) { + $Request.ConfigurationColumn = $ConfigurationColumn + } + if ($PSBoundParameters.ContainsKey('DatasetAggregation')) { + $Request.DatasetAggregation = $DatasetAggregation + } + if ($PSBoundParameters.ContainsKey('DatasetFilter')) { + $Request.DatasetFilter = $DatasetFilter + } + if ($PSBoundParameters.ContainsKey('DatasetGranularity')) { + $Request.DatasetGranularity = $DatasetGranularity + } + if ($PSBoundParameters.ContainsKey('DatasetGrouping')) { + $Request.DatasetGrouping = $DatasetGrouping + } + if ($PSBoundParameters.ContainsKey('TimePeriodFrom')) { + $Request.TimePeriodFrom = $TimePeriodFrom + } + if ($PSBoundParameters.ContainsKey('TimePeriodTo')) { + $Request.TimePeriodTo = $TimePeriodTo + } + if ($PSBoundParameters.ContainsKey('Timeframe')) { + $Request.Timeframe = $Timeframe + } + if ($PSBoundParameters.ContainsKey('Type')) { + $Request.Type = $Type + } + Write-Host $URL + $Response = Invoke-AzRest -Path $URL $RequestBody $Request | ConvertFrom-Json + $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryResult]::New() + $Result.Column = $Response.Columns + $Result.Row = $Response.Rows + # foreach ($RawRow in $Response.Row) { + # $Row = New-Object System.Collections.ArrayList + # for ($Index=0; $Index -lt $Result.Column.Length; $Index++) { + # $Column = $Result.Column[$Index] + + # } + # } + return $Result + } +} diff --git a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 new file mode 100644 index 000000000000..f1209b40db1d --- /dev/null +++ b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 @@ -0,0 +1,48 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the \"License\"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an \"AS IS\" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a in-memory object for QueryColumn +.Description +Create a in-memory object for QueryColumn + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn +.Link +https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject +#> +function New-AzCostManagementQueryColumnObject { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(HelpMessage="The name of column.")] + [string] + $Name, + [Parameter(HelpMessage="The type of column.")] + [string] + $Type + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn]::New() + + $Object.Name = $Name + $Object.Type = $Type + return $Object + } +} + diff --git a/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 new file mode 100644 index 000000000000..0e3d7f4eb685 --- /dev/null +++ b/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 @@ -0,0 +1,52 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the \"License\"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an \"AS IS\" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a in-memory object for QueryComparisonExpression +.Description +Create a in-memory object for QueryComparisonExpression + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +.Link +https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject +#> +function New-AzCostManagementQueryComparisonExpressionObject { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(Mandatory, HelpMessage="The name of the column to use in comparison.")] + [string] + $Name, + [Parameter(Mandatory, HelpMessage="The operator to use for comparison.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType] + $Operator, + [Parameter(Mandatory, HelpMessage="Array of values to use for comparison.")] + [string[]] + $Value + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression]::New() + + $Object.Name = $Name + $Object.Operator = $Operator + $Object.Value = $Value + return $Object + } +} + diff --git a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 new file mode 100644 index 000000000000..26ac0edcb43e --- /dev/null +++ b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 @@ -0,0 +1,60 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the \"License\"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an \"AS IS\" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a in-memory object for QueryFilter +.Description +Create a in-memory object for QueryFilter + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter +.Link +https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject +#> +function New-AzCostManagementQueryFilterObject { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(HelpMessage="The logical `"AND`" expression. Must have at least 2 items.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[]] + $And, + [Parameter(HelpMessage="Has comparison expression for a dimension.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression] + $Dimension, + [Parameter(HelpMessage="The logical `"NOT`" expression.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter] + $Not, + [Parameter(HelpMessage="The logical `"OR`" expression. Must have at least 2 items.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[]] + $Or, + [Parameter(HelpMessage="Has comparison expression for a tag.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression] + $Tag + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter]::New() + + $Object.And = $And + $Object.Dimension = $Dimension + $Object.Not = $Not + $Object.Or = $Or + $Object.Tag = $Tag + return $Object + } +} + diff --git a/src/CostManagement/custom/readme.md b/src/CostManagement/custom/readme.md new file mode 100644 index 000000000000..504158c62401 --- /dev/null +++ b/src/CostManagement/custom/readme.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.Cost` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Cost.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.Cost` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.Cost.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.Cost.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.Cost`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Cost`. +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Cost`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md new file mode 100644 index 000000000000..c0dca9e8b76c --- /dev/null +++ b/src/CostManagement/readme.md @@ -0,0 +1,85 @@ + +# Az.Cost +This directory contains the PowerShell module for the Cost service. + +--- +## Status +[![Az.Cost](https://img.shields.io/powershellgallery/v/Az.Cost.svg?style=flat-square&label=Az.Cost "Az.Cost")](https://www.powershellgallery.com/packages/Az.Cost/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Cost`, see [how-to.md](how-to.md). + + +--- +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@beta`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  +## Run Generation +In this directory, run AutoRest: +> `autorest` +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + # - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json + - $(this-folder)/resources/costmanagement.json +title: CostManagement +module-version: 0.1.0 +subject-prefix: 'CostManagement' +directive: + - where: + variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ + remove: true + - from: source-file-csharp + where: $ + transform: $ = $.replace(/AlertCategory System/, 'AlertCategory System1'); + - from: source-file-csharp + where: $ + transform: $ = $.replace(/internal partial interface/, 'public partial interface'); + - where: + verb: Set + set: + verb: Update + - where: + subject: UsageQuery + verb: invoke + hide: true + - where: + subject: ByDimensionExternalCloudProviderType|CloudForecast|DismissAlert|Forecast + verb: invoke + remove: true + - where: + subject: Alert|AlertExternal|Dimension|ExportExecutionHistory|View + remove: true + + - no-inline: + - QueryFilter + - ReportConfigFilter +``` diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 new file mode 100644 index 000000000000..fad6a85da0ba --- /dev/null +++ b/src/CostManagement/resources/Create.ps1 @@ -0,0 +1,21 @@ +$QueryOrDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') +$QueryOrTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') +$QueryFilterOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $QueryOrDimension), (New-AzCostManagementQueryFilterObject -Tag $QueryOrTag)) +$QueryAndDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' +$a = New-AzCostManagementQueryFilterObject -Dimension $QueryAndDimension +$QueryFileterAnd = New-AzCostManagementQueryFilterObject -And @($QueryFilterOr, $a) + +$Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} +$Aggregation2 = @{ name = 'Cost'; function='sum'} +$AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} + +# New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExport1" ` +# -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-11T20:00:00Z" ` +# -RecurrencePeriodTo "2020-06-20T00:00:00Z" -Format "Csv" ` +# -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` +# -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + # -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') + # -DatasetAggregation $AggregationDict -DatasetGrouping @(@{type='Dimension'; name='SubscriptionName'}; @{type='Tag'; name='Environment'}) + # -DatasetFilter $QueryFileterAnd -Debug +Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' + # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file diff --git a/src/CostManagement/resources/costmanagement.json b/src/CostManagement/resources/costmanagement.json new file mode 100644 index 000000000000..e8d1e13e2ee7 --- /dev/null +++ b/src/CostManagement/resources/costmanagement.json @@ -0,0 +1,3153 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-11-01", + "title": "CostManagementClient" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/providers/Microsoft.CostManagement/views": { + "get": { + "tags": [ + "Views" + ], + "operationId": "Views_List", + "description": "Lists all views by tenant and object.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "PrivateViewList": { + "$ref": "./examples/PrivateViewList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ViewListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/views": { + "get": { + "tags": [ + "Views" + ], + "operationId": "Views_ListByScope", + "description": "Lists all views at the given scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupViewList": { + "$ref": "./examples/ViewListByResourceGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeViewParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ViewListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.CostManagement/views/{viewName}": { + "get": { + "tags": [ + "Views" + ], + "operationId": "Views_Get", + "description": "Gets the view by view name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "PrivateView": { + "$ref": "./examples/PrivateView.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/viewNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/View" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Views" + ], + "operationId": "Views_CreateOrUpdate", + "description": "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "CreateOrUpdatePrivateView": { + "$ref": "./examples/PrivateViewCreateOrUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/viewNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/View" + }, + "description": "Parameters supplied to the CreateOrUpdate View operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/View" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/View" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Views" + ], + "operationId": "Views_Delete", + "description": "The operation to delete a view.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "DeletePrivateView": { + "$ref": "./examples/PrivateViewDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/viewNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "204": { + "description": "NoContent. Resource is not available." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/views/{viewName}": { + "get": { + "tags": [ + "Views" + ], + "operationId": "Views_GetByScope", + "description": "Gets the view for the defined scope by view name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupView": { + "$ref": "./examples/ViewByResourceGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeViewParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/viewNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/View" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Views" + ], + "operationId": "Views_CreateOrUpdateByScope", + "description": "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupCreateOrUpdateView": { + "$ref": "./examples/ViewCreateOrUpdateByResourceGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeViewParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/viewNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/View" + }, + "description": "Parameters supplied to the CreateOrUpdate View operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/View" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/View" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Views" + ], + "operationId": "Views_DeleteByScope", + "description": "The operation to delete a view.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupDeleteView": { + "$ref": "./examples/ViewDeleteByResourceGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeViewParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/viewNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "204": { + "description": "NoContent. Resource is not available." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_List", + "description": "Lists the alerts for scope defined.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "BillingAccountAlerts": { + "$ref": "./examples/BillingAccountAlerts.json" + }, + "BillingProfileAlerts": { + "$ref": "./examples/BillingProfileAlerts.json" + }, + "InvoiceSectionAlerts": { + "$ref": "./examples/InvoiceSectionAlerts.json" + }, + "EnrollmentAccountAlerts": { + "$ref": "./examples/EnrollmentAccountAlerts.json" + }, + "DepartmentAlerts": { + "$ref": "./examples/DepartmentAlerts.json" + }, + "SubscriptionAlerts": { + "$ref": "./examples/SubscriptionAlerts.json" + }, + "ResourceGroupAlerts": { + "$ref": "./examples/ResourceGroupAlerts.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/scopeAlertParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertsResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_Get", + "description": "Gets the alert for the scope by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionAlerts": { + "$ref": "./examples/SingleSubscriptionAlert.json" + }, + "ResourceGroupAlerts": { + "$ref": "./examples/SingleResourceGroupAlert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/scopeAlertParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_Dismiss", + "description": "Dismisses the specified alert", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionAlerts": { + "$ref": "./examples/DismissSubscriptionAlerts.json" + }, + "ResourceGroupAlerts": { + "$ref": "./examples/DismissResourceGroupAlerts.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/scopeAlertParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DismissAlertPayload" + }, + "description": "Parameters supplied to the Dismiss Alert operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListExternal", + "description": "Lists the Alerts for external cloud provider type defined.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExternalBillingAccountAlerts": { + "$ref": "./examples/ExternalBillingAccountAlerts.json" + }, + "ExternalSubscriptionAlerts": { + "$ref": "./examples/ExternalSubscriptionAlerts.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalCloudProviderTypeParameter" + }, + { + "$ref": "#/parameters/externalCloudProviderIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertsResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/forecast": { + "post": { + "tags": [ + "Forecast" + ], + "operationId": "Forecast_Usage", + "description": "Lists the forecast charges for scope defined.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "BillingAccountForecast": { + "$ref": "./examples/BillingAccountForecast.json" + }, + "BillingProfileForecast": { + "$ref": "./examples/BillingProfileForecast.json" + }, + "InvoiceSectionForecast": { + "$ref": "./examples/InvoiceSectionForecast.json" + }, + "EnrollmentAccountForecast": { + "$ref": "./examples/EnrollmentAccountForecast.json" + }, + "DepartmentForecast": { + "$ref": "./examples/DepartmentForecast.json" + }, + "SubscriptionForecast": { + "$ref": "./examples/SubscriptionForecast.json" + }, + "ResourceGroupForecast": { + "$ref": "./examples/ResourceGroupForecast.json" + } + }, + "parameters": [ + { + "name": "$filter", + "description": "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/scopeForecastParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ForecastDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Forecast Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast": { + "post": { + "tags": [ + "Forecast" + ], + "operationId": "Forecast_ExternalCloudProviderUsage", + "description": "Lists the forecast charges for external cloud provider type defined.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExternalBillingAccountForecast": { + "$ref": "./examples/ExternalBillingAccountForecast.json" + }, + "ExternalSubscriptionForecast": { + "$ref": "./examples/ExternalSubscriptionForecast.json" + } + }, + "parameters": [ + { + "name": "$filter", + "description": "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalCloudProviderTypeParameter" + }, + { + "$ref": "#/parameters/externalCloudProviderIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ForecastDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Forecast Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "Dimensions_List", + "description": "Lists the dimensions by the defined scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionDimensionsList-Legacy": { + "$ref": "./examples/SubscriptionDimensionsList.json" + }, + "ResourceGroupDimensionsList-Legacy": { + "$ref": "./examples/ResourceGroupDimensionsList.json" + }, + "ManagementGroupDimensionsList-Legacy": { + "$ref": "./examples/ManagementGroupDimensionsList.json" + }, + "ManagementGroupDimensionsListExpandAndTop-Legacy": { + "$ref": "./examples/ManagementGroupDimensionsListExpandAndTop.json" + }, + "ManagementGroupDimensionsListWithFilter-Legacy": { + "$ref": "./examples/ManagementGroupDimensionsListWithFilter.json" + }, + "DepartmentDimensionsList-Legacy": { + "$ref": "./examples/DepartmentDimensionsList.json" + }, + "DepartmentDimensionsListExpandAndTop-Legacy": { + "$ref": "./examples/DepartmentDimensionsListExpandAndTop.json" + }, + "DepartmentDimensionsListWithFilter-Legacy": { + "$ref": "./examples/DepartmentDimensionsListWithFilter.json" + }, + "EnrollmentAccountDimensionsList-Legacy": { + "$ref": "./examples/EnrollmentAccountDimensionsList.json" + }, + "EnrollmentAccountDimensionsListExpandAndTop-Legacy": { + "$ref": "./examples/EnrollmentAccountDimensionsListExpandAndTop.json" + }, + "EnrollmentAccountDimensionsListWithFilter-Legacy": { + "$ref": "./examples/EnrollmentAccountDimensionsListWithFilter.json" + }, + "BillingAccountDimensionsList-Legacy": { + "$ref": "./examples/BillingAccountDimensionsList.json" + }, + "BillingAccountDimensionsListExpandAndTop-Legacy": { + "$ref": "./examples/BillingAccountDimensionsListExpandAndTop.json" + }, + "BillingAccountDimensionsListWithFilter-Legacy": { + "$ref": "./examples/BillingAccountDimensionsListWithFilter.json" + }, + "BillingAccountDimensionsList-Modern": { + "$ref": "./examples/MCABillingAccountDimensionsList.json" + }, + "BillingAccountDimensionsListExpandAndTop-Modern": { + "$ref": "./examples/MCABillingAccountDimensionsListExpandAndTop.json" + }, + "BillingAccountDimensionsListWithFilter-Modern": { + "$ref": "./examples/MCABillingAccountDimensionsListWithFilter.json" + }, + "BillingProfileDimensionsList-Modern": { + "$ref": "./examples/MCABillingProfileDimensionsList.json" + }, + "BillingProfileDimensionsListExpandAndTop-Modern": { + "$ref": "./examples/MCABillingProfileDimensionsListExpandAndTop.json" + }, + "BillingProfileDimensionsListWithFilter-Modern": { + "$ref": "./examples/MCABillingProfileDimensionsListWithFilter.json" + }, + "InvoiceSectionDimensionsList-Modern": { + "$ref": "./examples/MCAInvoiceSectionDimensionsList.json" + }, + "InvoiceSectionDimensionsListExpandAndTop-Modern": { + "$ref": "./examples/MCAInvoiceSectionDimensionsListExpandAndTop.json" + }, + "InvoiceSectionDimensionsListWithFilter-Modern": { + "$ref": "./examples/MCAInvoiceSectionDimensionsListWithFilter.json" + }, + "CustomerDimensionsList-Modern": { + "$ref": "./examples/MCACustomerDimensionsList.json" + }, + "CustomerDimensionsListExpandAndTop-Modern": { + "$ref": "./examples/MCACustomerDimensionsListExpandAndTop.json" + }, + "CustomerDimensionsListWithFilter-Modern": { + "$ref": "./examples/MCACustomerDimensionsListWithFilter.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeDimensionParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "Dimensions_ByExternalCloudProviderType", + "description": "Lists the dimensions by the external cloud provider type.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExternalBillingAccountDimensionList": { + "$ref": "./examples/ExternalBillingAccountsDimensions.json" + }, + "ExternalSubscriptionDimensionList": { + "$ref": "./examples/ExternalSubscriptionsDimensions.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/externalCloudProviderTypeParameter" + }, + { + "$ref": "#/parameters/externalCloudProviderIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/query": { + "post": { + "tags": [ + "Query" + ], + "operationId": "Query_Usage", + "description": "Query the usage data for scope defined.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionQuery-Legacy": { + "$ref": "./examples/SubscriptionQuery.json" + }, + "SubscriptionQueryGrouping-Legacy": { + "$ref": "./examples/SubscriptionQueryGrouping.json" + }, + "ResourceGroupQuery-Legacy": { + "$ref": "./examples/ResourceGroupQuery.json" + }, + "ResourceGroupQueryGrouping-Legacy": { + "$ref": "./examples/ResourceGroupQueryGrouping.json" + }, + "BillingAccountQuery-Legacy": { + "$ref": "./examples/BillingAccountQuery.json" + }, + "BillingAccountQueryGrouping-Legacy": { + "$ref": "./examples/BillingAccountQueryGrouping.json" + }, + "EnrollmentAccountQuery-Legacy": { + "$ref": "./examples/EnrollmentAccountQuery.json" + }, + "EnrollmentAccountQueryGrouping-Legacy": { + "$ref": "./examples/EnrollmentAccountQueryGrouping.json" + }, + "DepartmentQuery-Legacy": { + "$ref": "./examples/DepartmentQuery.json" + }, + "DepartmentQueryGrouping-Legacy": { + "$ref": "./examples/DepartmentQueryGrouping.json" + }, + "ManagementGroupQuery-Legacy": { + "$ref": "./examples/ManagementGroupQuery.json" + }, + "ManagementGroupQueryGrouping-Legacy": { + "$ref": "./examples/ManagementGroupQueryGrouping.json" + }, + "BillingAccountQuery-Modern": { + "$ref": "./examples/MCABillingAccountQuery.json" + }, + "BillingAccountQueryGrouping-Modern": { + "$ref": "./examples/MCABillingAccountQueryGrouping.json" + }, + "BillingProfileQuery-Modern": { + "$ref": "./examples/MCABillingProfileQuery.json" + }, + "BillingProfileQueryGrouping-Modern": { + "$ref": "./examples/MCABillingProfileQueryGrouping.json" + }, + "InvoiceSectionQuery-Modern": { + "$ref": "./examples/MCAInvoiceSectionQuery.json" + }, + "InvoiceSectionQueryGrouping-Modern": { + "$ref": "./examples/MCAInvoiceSectionQueryGrouping.json" + }, + "CustomerQuery-Modern": { + "$ref": "./examples/MCACustomerQuery.json" + }, + "CustomerQueryGrouping-Modern": { + "$ref": "./examples/MCACustomerQueryGrouping.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QueryDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Query Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query": { + "post": { + "tags": [ + "Query" + ], + "operationId": "Query_UsageByExternalCloudProviderType", + "description": "Query the usage data for external cloud provider type defined.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExternalBillingAccountQueryList": { + "$ref": "./examples/ExternalBillingAccountsQuery.json" + }, + "ExternalSubscriptionsQuery": { + "$ref": "./examples/ExternalSubscriptionsQuery.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/externalCloudProviderTypeParameter" + }, + { + "$ref": "#/parameters/externalCloudProviderIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/QueryDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Query Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_List", + "description": "The operation to list all exports at the given scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionExportList": { + "$ref": "./examples/ExportListBySubscription.json" + }, + "ResourceGroupExportList": { + "$ref": "./examples/ExportListByResourceGroup.json" + }, + "BillingAccountExportList": { + "$ref": "./examples/ExportListByBillingAccount.json" + }, + "DepartmentExportList": { + "$ref": "./examples/ExportListByDepartment.json" + }, + "EnrollmentAccountExportList": { + "$ref": "./examples/ExportListByEnrollmentAccount.json" + }, + "ManagementGroupExportList": { + "$ref": "./examples/ExportListByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExportListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Get", + "description": "The operation to get the export for the defined scope by export name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionExport": { + "$ref": "./examples/ExportBySubscription.json" + }, + "ResourceGroupExport": { + "$ref": "./examples/ExportByResourceGroup.json" + }, + "BillingAccountExport": { + "$ref": "./examples/ExportByBillingAccount.json" + }, + "DepartmentExport": { + "$ref": "./examples/ExportByDepartment.json" + }, + "EnrollmentAccountExport": { + "$ref": "./examples/ExportByEnrollmentAccount.json" + }, + "ManagementGroupExport": { + "$ref": "./examples/ExportByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Exports" + ], + "operationId": "Exports_CreateOrUpdate", + "description": "The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionCreateOrUpdateExport": { + "$ref": "./examples/ExportCreateOrUpdateBySubscription.json" + }, + "ResourceGroupCreateOrUpdateExport": { + "$ref": "./examples/ExportCreateOrUpdateByResourceGroup.json" + }, + "BillingAccountCreateOrUpdateExport": { + "$ref": "./examples/ExportCreateOrUpdateByBillingAccount.json" + }, + "DepartmentCreateOrUpdateExport": { + "$ref": "./examples/ExportCreateOrUpdateByDepartment.json" + }, + "EnrollmentAccountCreateOrUpdateExport": { + "$ref": "./examples/ExportCreateOrUpdateByEnrollmentAccount.json" + }, + "ManagementGroupCreateOrUpdateExport": { + "$ref": "./examples/ExportCreateOrUpdateByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Export" + }, + "description": "Parameters supplied to the CreateOrUpdate Export operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/Export" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Delete", + "description": "The operation to delete a export.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionDeleteExport": { + "$ref": "./examples/ExportDeleteBySubscription.json" + }, + "ResourceGroupDeleteExport": { + "$ref": "./examples/ExportDeleteByResourceGroup.json" + }, + "BillingAccountDeleteExport": { + "$ref": "./examples/ExportDeleteByBillingAccount.json" + }, + "EnrollmentAccountDeleteExport": { + "$ref": "./examples/ExportDeleteByEnrollmentAccount.json" + }, + "DepartmentDeleteExport": { + "$ref": "./examples/ExportDeleteByDepartment.json" + }, + "ManagementGroupDeleteExport": { + "$ref": "./examples/ExportDeleteByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run": { + "post": { + "tags": [ + "Exports" + ], + "operationId": "Exports_Execute", + "description": "The operation to execute a export.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionExecuteExport": { + "$ref": "./examples/ExportExecutionBySubscription.json" + }, + "ResourceGroupExecuteExport": { + "$ref": "./examples/ExportExecutionByResourceGroup.json" + }, + "BillingAccountExecuteExport": { + "$ref": "./examples/ExportExecutionByBillingAccount.json" + }, + "DepartmentExecuteExport": { + "$ref": "./examples/ExportExecutionByDepartment.json" + }, + "EnrollmentAccountExecuteExport": { + "$ref": "./examples/ExportExecutionByEnrollmentAccount.json" + }, + "ManagementGroupExecuteExport": { + "$ref": "./examples/ExportExecutionByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory": { + "get": { + "tags": [ + "Exports" + ], + "operationId": "Exports_GetExecutionHistory", + "description": "The operation to get the execution history of an export for the defined scope by export name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionExecutionHistoryExport": { + "$ref": "./examples/ExportExecutionListBySubscription.json" + }, + "ResourceGroupExecutionHistoryExport": { + "$ref": "./examples/ExportExecutionListByResourceGroup.json" + }, + "BillingAccountExecutionHistoryExport": { + "$ref": "./examples/ExportExecutionListByBillingAccount.json" + }, + "DepartmentExecutionHistoryExport": { + "$ref": "./examples/ExportExecutionListByDepartment.json" + }, + "EnrollmentAccountExecutionHistoryExport": { + "$ref": "./examples/ExportExecutionListByEnrollmentAccount.json" + }, + "ManagementGroupExecutionHistoryExport": { + "$ref": "./examples/ExportExecutionListByManagementGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeQueryParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/exportNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExportExecutionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "description": "Lists all of the available cost management REST API operations.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "ReportConfigDefinition": { + "description": "The definition of a report config.", + "properties": { + "type": { + "description": "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", + "type": "string", + "enum": [ + "Usage" + ], + "x-ms-enum": { + "name": "ReportType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the report. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "WeekToDate", + "MonthToDate", + "YearToDate", + "Custom" + ], + "x-ms-enum": { + "name": "ReportTimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the report.", + "$ref": "#/definitions/ReportConfigTimePeriod" + }, + "dataset": { + "description": "Has definition for data in this report config.", + "$ref": "#/definitions/ReportConfigDataset" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "ReportConfigTimePeriod": { + "description": "The start and end date for pulling data for the report.", + "properties": { + "from": { + "description": "The start date to pull data from.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date to pull data to.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from", + "to" + ] + }, + "ReportConfigDataset": { + "description": "The definition of data present in the report.", + "properties": { + "granularity": { + "description": "The granularity of rows in the report.", + "type": "string", + "enum": [ + "Daily", + "Monthly" + ], + "x-ms-enum": { + "name": "ReportGranularityType", + "modelAsString": true + } + }, + "configuration": { + "description": "Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.", + "$ref": "#/definitions/ReportConfigDatasetConfiguration" + }, + "aggregation": { + "type": "object", + "description": "Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/ReportConfigAggregation" + }, + "maxItems": 2 + }, + "grouping": { + "description": "Array of group by expression to use in the report. Report can have up to 2 group by clauses.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigGrouping" + }, + "maxItems": 2 + }, + "sorting": { + "description": "Array of order by expression to use in the report.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigSorting" + } + }, + "filter": { + "type": "object", + "description": "Has filter expression to use in the report.", + "$ref": "#/definitions/ReportConfigFilter" + } + } + }, + "ReportConfigDatasetConfiguration": { + "description": "The configuration of dataset in the report.", + "properties": { + "columns": { + "description": "Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ReportConfigAggregation": { + "description": "The aggregation expression to be used in the report.", + "properties": { + "name": { + "description": "The name of the column to aggregate.", + "type": "string" + }, + "function": { + "description": "The name of the aggregation function to use.", + "type": "string", + "enum": [ + "Sum" + ], + "x-ms-enum": { + "name": "FunctionType", + "modelAsString": true + } + } + }, + "required": [ + "name", + "function" + ] + }, + "ReportConfigSorting": { + "description": "The order by expression to be used in the report.", + "properties": { + "direction": { + "description": "Direction of sort.", + "type": "string", + "enum": [ + "Ascending", + "Descending" + ] + }, + "name": { + "description": "The name of the column to sort.", + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "ReportConfigGrouping": { + "description": "The group by expression to be used in the report.", + "properties": { + "type": { + "description": "Has type of the column to group.", + "$ref": "#/definitions/ReportConfigColumnType" + }, + "name": { + "description": "The name of the column to group. This version supports subscription lowest possible grain.", + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + "ReportConfigFilter": { + "description": "The filter expression to be used in the report.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "not": { + "description": "The logical \"NOT\" expression.", + "$ref": "#/definitions/ReportConfigFilter" + }, + "dimension": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/ReportConfigComparisonExpression" + }, + "tag": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/ReportConfigComparisonExpression" + } + } + }, + "ReportConfigColumnType": { + "description": "The type of the column in the report.", + "type": "string", + "enum": [ + "Tag", + "Dimension" + ], + "x-ms-enum": { + "name": "ReportConfigColumnType", + "modelAsString": true + } + }, + "ReportConfigComparisonExpression": { + "description": "The comparison expression to be used in the report.", + "properties": { + "name": { + "description": "The name of the column to use in comparison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In", + "Contains" + ], + "x-ms-enum": { + "name": "OperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "ViewListResult": { + "description": "Result of listing views. It contains a list of available views.", + "type": "object", + "properties": { + "value": { + "description": "The list of views.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/View" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "View": { + "description": "States and configurations of Cost Analysis.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ViewProperties", + "title": "View properties" + } + } + }, + "ViewProperties": { + "type": "object", + "description": "The properties of the view.", + "properties": { + "displayName": { + "description": "User input name of the view. Required.", + "type": "string" + }, + "scope": { + "description": "Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.", + "type": "string" + }, + "createdOn": { + "description": "Date the user created this view.", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "modifiedOn": { + "description": "Date when the user last modified this view.", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "query": { + "description": "Query body configuration. Required.", + "type": "object", + "x-ms-client-flatten": true, + "$ref": "#/definitions/ReportConfigDefinition" + }, + "chart": { + "description": "Chart type of the main view in Cost Analysis. Required.", + "type": "string", + "enum": [ + "Area", + "Line", + "StackedColumn", + "GroupedColumn", + "Table" + ], + "x-ms-enum": { + "name": "ChartType", + "modelAsString": true + } + }, + "accumulated": { + "description": "Show costs accumulated over time.", + "type": "string", + "enum": [ + "true", + "false" + ], + "x-ms-enum": { + "name": "AccumulatedType", + "modelAsString": true + } + }, + "metric": { + "description": "Metric to use when displaying costs.", + "type": "string", + "enum": [ + "ActualCost", + "AmortizedCost", + "AHUB" + ], + "x-ms-enum": { + "name": "MetricType", + "modelAsString": true + } + }, + "kpis": { + "description": "List of KPIs to show in Cost Analysis UI.", + "type": "array", + "items": { + "$ref": "#/definitions/KpiProperties" + } + }, + "pivots": { + "description": "Configuration of 3 sub-views in the Cost Analysis UI.", + "type": "array", + "items": { + "$ref": "#/definitions/PivotProperties" + } + } + } + }, + "KpiProperties": { + "description": "Each KPI must contain a 'type' and 'enabled' key.", + "type": "object", + "properties": { + "type": { + "description": "KPI type (Forecast, Budget).", + "type": "string", + "enum": [ + "Forecast", + "Budget" + ], + "x-ms-enum": { + "name": "KpiTypeType", + "modelAsString": true + } + }, + "id": { + "description": "ID of resource related to metric (budget).", + "type": "string" + }, + "enabled": { + "description": "show the KPI in the UI?", + "type": "boolean" + } + } + }, + "PivotProperties": { + "description": "Each pivot must contain a 'type' and 'name'.", + "type": "object", + "properties": { + "type": { + "description": "Data type to show in view.", + "type": "string", + "enum": [ + "Dimension", + "TagKey" + ], + "x-ms-enum": { + "name": "PivotTypeType", + "modelAsString": true + } + }, + "name": { + "description": "Data field to show in view.", + "type": "string" + } + } + }, + "ErrorDetails": { + "description": "The details of the error.", + "properties": { + "code": { + "description": "Error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string", + "readOnly": true + } + } + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "tags": { + "readOnly": true, + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags." + } + }, + "x-ms-azure-resource": true + }, + "ProxyResource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "eTag": { + "type": "string", + "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." + } + }, + "x-ms-azure-resource": true + }, + "DimensionsListResult": { + "description": "Result of listing dimensions. It contains a list of available dimensions.", + "type": "object", + "properties": { + "value": { + "description": "The list of dimensions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Dimension" + } + } + } + }, + "Dimension": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DimensionProperties", + "title": "Dimension properties" + } + } + }, + "DimensionProperties": { + "type": "object", + "properties": { + "description": { + "description": "Dimension description.", + "type": "string", + "readOnly": true + }, + "filterEnabled": { + "description": "Filter enabled.", + "type": "boolean", + "readOnly": true + }, + "groupingEnabled": { + "description": "Grouping enabled.", + "type": "boolean", + "readOnly": true + }, + "data": { + "type": "array", + "items": { + "description": "Dimension data item.", + "type": "string", + "readOnly": true + } + }, + "total": { + "description": "Total number of data for the dimension.", + "format": "int32", + "type": "integer", + "readOnly": true + }, + "category": { + "description": "Dimension category.", + "type": "string", + "readOnly": true + }, + "usageStart": { + "description": "Usage start.", + "format": "date-time", + "type": "string", + "readOnly": true + }, + "usageEnd": { + "description": "Usage end.", + "format": "date-time", + "type": "string", + "readOnly": true + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "AlertsResult": { + "description": "Result of alerts.", + "type": "object", + "properties": { + "value": { + "description": "List of alerts.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Alert" + } + }, + "nextLink": { + "description": "URL to get the next set of alerts results if there are any.", + "type": "string", + "readOnly": true + } + } + }, + "Alert": { + "description": "An individual alert.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AlertProperties", + "title": "Alert properties" + } + } + }, + "AlertProperties": { + "type": "object", + "properties": { + "definition": { + "description": "defines the type of alert", + "type": "object", + "properties": { + "type": { + "description": "type of alert", + "type": "string", + "enum": [ + "Budget", + "Invoice", + "Credit", + "Quota", + "General", + "xCloud", + "BudgetForecast" + ], + "x-ms-enum": { + "name": "AlertType", + "modelAsString": true + } + }, + "category": { + "description": "Alert category", + "type": "string", + "enum": [ + "Cost", + "Usage", + "Billing", + "System" + ], + "x-ms-enum": { + "name": "AlertCategory", + "modelAsString": true + } + }, + "criteria": { + "description": "Criteria that triggered alert", + "type": "string", + "enum": [ + "CostThresholdExceeded", + "UsageThresholdExceeded", + "CreditThresholdApproaching", + "CreditThresholdReached", + "QuotaThresholdApproaching", + "QuotaThresholdReached", + "MultiCurrency", + "ForecastCostThresholdExceeded", + "ForecastUsageThresholdExceeded", + "InvoiceDueDateApproaching", + "InvoiceDueDateReached", + "CrossCloudNewDataAvailable", + "CrossCloudCollectionError", + "GeneralThresholdError" + ], + "x-ms-enum": { + "name": "AlertCriteria", + "modelAsString": true + } + } + } + }, + "description": { + "description": "Alert description", + "type": "string" + }, + "source": { + "description": "Source of alert", + "type": "string", + "enum": [ + "Preset", + "User" + ], + "x-ms-enum": { + "name": "AlertSource", + "modelAsString": true + } + }, + "details": { + "description": "Alert details", + "type": "object", + "properties": { + "timeGrainType": { + "description": "Type of timegrain cadence", + "type": "string", + "enum": [ + "None", + "Monthly", + "Quarterly", + "Annually", + "BillingMonth", + "BillingQuarter", + "BillingAnnual" + ], + "x-ms-enum": { + "name": "AlertTimeGrainType", + "modelAsString": true + } + }, + "periodStartDate": { + "description": "datetime of periodStartDate", + "type": "string" + }, + "triggeredBy": { + "description": "notificationId that triggered this alert", + "type": "string" + }, + "resourceGroupFilter": { + "description": "array of resourceGroups to filter by", + "type": "array", + "items": { + "type": "object" + } + }, + "resourceFilter": { + "description": "array of resources to filter by", + "type": "array", + "items": { + "type": "object" + } + }, + "meterFilter": { + "description": "array of meters to filter by", + "type": "array", + "items": { + "type": "object" + } + }, + "tagFilter": { + "description": "tags to filter by", + "type": "object", + "properties": {} + }, + "threshold": { + "description": "notification threshold percentage as a decimal which activated this alert", + "type": "number", + "format": "decimal" + }, + "operator": { + "description": "operator used to compare currentSpend with amount", + "type": "string", + "enum": [ + "None", + "EqualTo", + "GreaterThan", + "GreaterThanOrEqualTo", + "LessThan", + "LessThanOrEqualTo" + ], + "x-ms-enum": { + "name": "AlertOperator", + "modelAsString": true + } + }, + "amount": { + "description": "budget threshold amount", + "type": "number", + "format": "decimal" + }, + "unit": { + "description": "unit of currency being used", + "type": "string" + }, + "currentSpend": { + "description": "current spend", + "type": "number", + "format": "decimal" + }, + "contactEmails": { + "description": "list of emails to contact", + "type": "array", + "items": { + "type": "string" + } + }, + "contactGroups": { + "description": "list of action groups to broadcast to", + "type": "array", + "items": { + "type": "string" + } + }, + "contactRoles": { + "description": "list of contact roles", + "type": "array", + "items": { + "type": "string" + } + }, + "overridingAlert": { + "description": "overriding alert", + "type": "string" + } + } + }, + "costEntityId": { + "description": "related budget", + "type": "string" + }, + "status": { + "description": "alert status", + "type": "string", + "enum": [ + "None", + "Active", + "Overridden", + "Resolved", + "Dismissed" + ], + "x-ms-enum": { + "name": "AlertStatus", + "modelAsString": true + } + }, + "creationTime": { + "description": "dateTime in which alert was created", + "type": "string" + }, + "closeTime": { + "description": "dateTime in which alert was closed", + "type": "string" + }, + "modificationTime": { + "description": "dateTime in which alert was last modified", + "type": "string" + }, + "statusModificationUserName": { + "description": "", + "type": "string" + }, + "statusModificationTime": { + "description": "dateTime in which the alert status was last modified", + "type": "string" + } + } + }, + "DismissAlertPayload": { + "description": "The request payload to update an alert", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AlertProperties", + "title": "Alert properties" + } + } + }, + "QueryResult": { + "description": "Result of query. It contains all columns listed under groupings and aggregation.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/QueryProperties", + "title": "Query properties" + } + } + }, + "QueryProperties": { + "type": "object", + "properties": { + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string" + }, + "columns": { + "description": "Array of columns", + "type": "array", + "items": { + "$ref": "#/definitions/QueryColumn" + } + }, + "rows": { + "description": "Array of rows", + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "QueryColumn": { + "type": "object", + "properties": { + "name": { + "description": "The name of column.", + "type": "string" + }, + "type": { + "description": "The type of column.", + "type": "string" + } + } + }, + "OperationListResult": { + "description": "Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.", + "properties": { + "value": { + "description": "List of cost management operations supported by the Microsoft.CostManagement resource provider.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Operation" + } + }, + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", + "type": "string", + "readOnly": true + } + } + }, + "Operation": { + "description": "A Cost management REST API operation.", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}.", + "type": "string", + "readOnly": true + }, + "display": { + "description": "The object that represents the operation.", + "properties": { + "provider": { + "description": "Service provider: Microsoft.CostManagement.", + "type": "string", + "readOnly": true + }, + "resource": { + "description": "Resource on which the operation is performed: Dimensions, Query.", + "type": "string", + "readOnly": true + }, + "operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string", + "readOnly": true + } + } + } + } + }, + "ForecastDefinition": { + "description": "The definition of a forecast.", + "properties": { + "type": { + "description": "The type of the forecast.", + "type": "string", + "enum": [ + "Usage", + "ActualCost", + "AmortizedCost" + ], + "x-ms-enum": { + "name": "ForecastType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "MonthToDate", + "BillingMonthToDate", + "TheLastMonth", + "TheLastBillingMonth", + "WeekToDate", + "Custom" + ], + "x-ms-enum": { + "name": "ForecastTimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the forecast.", + "$ref": "#/definitions/QueryTimePeriod" + }, + "dataset": { + "description": "Has definition for data in this forecast.", + "$ref": "#/definitions/QueryDataset" + }, + "includeActualCost": { + "description": "a boolean determining if actualCost will be included", + "type": "boolean" + }, + "includeFreshPartialCost": { + "description": "a boolean determining if FreshPartialCost will be included", + "type": "boolean" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "QueryDefinition": { + "description": "The definition of a query.", + "properties": { + "type": { + "description": "The type of the query.", + "type": "string", + "enum": [ + "Usage", + "ActualCost", + "AmortizedCost" + ], + "x-ms-enum": { + "name": "ExportType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the query. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "MonthToDate", + "BillingMonthToDate", + "TheLastMonth", + "TheLastBillingMonth", + "WeekToDate", + "Custom" + ], + "x-ms-enum": { + "name": "TimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the query.", + "$ref": "#/definitions/QueryTimePeriod" + }, + "dataset": { + "description": "Has definition for data in this query.", + "$ref": "#/definitions/QueryDataset" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "QueryTimePeriod": { + "description": "The start and end date for pulling data for the query.", + "properties": { + "from": { + "description": "The start date to pull data from.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date to pull data to.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from", + "to" + ] + }, + "QueryDataset": { + "description": "The definition of data present in the query.", + "properties": { + "granularity": { + "description": "The granularity of rows in the query.", + "type": "string", + "enum": [ + "Daily" + ], + "x-ms-enum": { + "name": "GranularityType", + "modelAsString": true + } + }, + "configuration": { + "description": "Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.", + "$ref": "#/definitions/QueryDatasetConfiguration" + }, + "aggregation": { + "type": "object", + "description": "Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/QueryAggregation" + }, + "maxItems": 2 + }, + "grouping": { + "description": "Array of group by expression to use in the query. Query can have up to 2 group by clauses.", + "type": "array", + "items": { + "$ref": "#/definitions/QueryGrouping" + }, + "maxItems": 2 + }, + "filter": { + "type": "object", + "description": "Has filter expression to use in the query.", + "$ref": "#/definitions/QueryFilter" + } + } + }, + "QueryDatasetConfiguration": { + "description": "The configuration of dataset in the query.", + "properties": { + "columns": { + "description": "Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "QueryAggregation": { + "description": "The aggregation expression to be used in the query.", + "properties": { + "name": { + "description": "The name of the column to aggregate.", + "type": "string" + }, + "function": { + "description": "The name of the aggregation function to use.", + "type": "string", + "enum": [ + "Sum" + ], + "x-ms-enum": { + "name": "FunctionType", + "modelAsString": true + } + } + }, + "required": [ + "name", + "function" + ] + }, + "QueryGrouping": { + "description": "The group by expression to be used in the query.", + "properties": { + "type": { + "description": "Has type of the column to group.", + "$ref": "#/definitions/QueryColumnType" + }, + "name": { + "description": "The name of the column to group.", + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + "QueryFilter": { + "description": "The filter expression to be used in the export.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/QueryFilter" + }, + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/QueryFilter" + }, + "minItems": 2 + }, + "not": { + "description": "The logical \"NOT\" expression.", + "$ref": "#/definitions/QueryFilter" + }, + "dimension": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/QueryComparisonExpression" + }, + "tag": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/QueryComparisonExpression" + } + } + }, + "QueryColumnType": { + "description": "The type of the column in the export.", + "type": "string", + "enum": [ + "Tag", + "Dimension" + ], + "x-ms-enum": { + "name": "QueryColumnType", + "modelAsString": true + } + }, + "QueryComparisonExpression": { + "description": "The comparison expression to be used in the query.", + "properties": { + "name": { + "description": "The name of the column to use in comparison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In" + ], + "x-ms-enum": { + "name": "OperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "ExportListResult": { + "description": "Result of listing exports. It contains a list of available exports in the scope provided.", + "properties": { + "value": { + "description": "The list of exports.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Export" + } + } + } + }, + "Export": { + "description": "A export resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExportProperties", + "title": "Export properties" + } + } + }, + "ExportProperties": { + "description": "The properties of the export.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CommonExportProperties" + } + ], + "properties": { + "schedule": { + "description": "Has schedule information for the export.", + "$ref": "#/definitions/ExportSchedule" + } + } + }, + "CommonExportProperties": { + "description": "The common properties of the export.", + "properties": { + "format": { + "description": "The format of the export being delivered.", + "type": "string", + "enum": [ + "Csv" + ], + "x-ms-enum": { + "name": "FormatType", + "modelAsString": true + } + }, + "deliveryInfo": { + "description": "Has delivery information for the export.", + "$ref": "#/definitions/ExportDeliveryInfo" + }, + "definition": { + "description": "Has definition for the export.", + "$ref": "#/definitions/QueryDefinition" + } + }, + "required": [ + "deliveryInfo", + "definition" + ] + }, + "ExportSchedule": { + "description": "The schedule associated with a export.", + "properties": { + "status": { + "description": "The status of the schedule. Whether active or not. If inactive, the export's scheduled execution is paused.", + "type": "string", + "enum": [ + "Active", + "Inactive" + ], + "x-ms-enum": { + "name": "StatusType", + "modelAsString": true + } + }, + "recurrence": { + "description": "The schedule recurrence.", + "type": "string", + "enum": [ + "Daily", + "Weekly", + "Monthly", + "Annually" + ], + "x-ms-enum": { + "name": "RecurrenceType", + "modelAsString": true + } + }, + "recurrencePeriod": { + "description": "Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.", + "$ref": "#/definitions/ExportRecurrencePeriod" + } + }, + "required": [ + "recurrence" + ] + }, + "ExportDeliveryInfo": { + "description": "The delivery information associated with a export.", + "properties": { + "destination": { + "description": "Has destination for the export being delivered.", + "$ref": "#/definitions/ExportDeliveryDestination" + } + }, + "required": [ + "destination" + ] + }, + "ExportRecurrencePeriod": { + "description": "The start and end date for recurrence schedule.", + "properties": { + "from": { + "description": "The start date of recurrence.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date of recurrence.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from" + ] + }, + "ExportDeliveryDestination": { + "description": "The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .", + "properties": { + "resourceId": { + "description": "The resource id of the storage account where exports will be delivered.", + "type": "string" + }, + "container": { + "description": "The name of the container where exports will be uploaded.", + "type": "string" + }, + "rootFolderPath": { + "description": "The name of the directory where exports will be uploaded.", + "type": "string" + } + }, + "required": [ + "resourceId", + "container" + ] + }, + "ExportExecutionListResult": { + "description": "Result of listing exports execution history of a export by name", + "properties": { + "value": { + "description": "The list of export executions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ExportExecution" + } + } + } + }, + "ExportExecution": { + "description": "A export execution.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExportExecutionProperties", + "title": "Export execution properties" + } + } + }, + "ExportExecutionProperties": { + "description": "The properties of the export execution.", + "properties": { + "executionType": { + "description": "The type of the export execution.", + "type": "string", + "enum": [ + "OnDemand", + "Scheduled" + ], + "x-ms-enum": { + "name": "ExecutionType", + "modelAsString": true + } + }, + "status": { + "description": "The status of the export execution.", + "type": "string", + "enum": [ + "Queued", + "InProgress", + "Completed", + "Failed", + "Timeout", + "NewDataNotAvailable", + "DataNotAvailable" + ], + "x-ms-enum": { + "name": "ExecutionStatus", + "modelAsString": true + } + }, + "submittedBy": { + "description": "The identifier for the entity that executed the export. For OnDemand executions, it is the email id. For Scheduled executions, it is the constant value - System.", + "type": "string" + }, + "submittedTime": { + "description": "The time when export was queued to be executed.", + "type": "string", + "format": "date-time" + }, + "processingStartTime": { + "description": "The time when export was picked up to be executed.", + "type": "string", + "format": "date-time" + }, + "processingEndTime": { + "description": "The time when export execution finished.", + "type": "string", + "format": "date-time" + }, + "fileName": { + "description": "The name of the file export got written to.", + "type": "string" + }, + "runSettings": { + "$ref": "#/definitions/CommonExportProperties" + } + } + } + }, + "parameters": { + "viewNameParameter": { + "name": "viewName", + "in": "path", + "description": "View name", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "scopeViewParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.", + "x-ms-parameter-location": "method" + }, + "scopeDimensionParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "scopeAlertParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "scopeForecastParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "scopeQueryParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. The current version is 2019-11-01." + }, + "subscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "Azure Subscription ID.", + "required": true, + "type": "string" + }, + "resourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "Azure Resource Group Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "billingAccountIdParameter": { + "name": "billingAccountId", + "in": "path", + "description": "BillingAccount ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "managementGroupIdParameter": { + "name": "managementGroupId", + "in": "path", + "description": "ManagementGroup ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "departmentIdParameter": { + "name": "departmentId", + "in": "path", + "description": "Department ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "enrollmentAccountIdParameter": { + "name": "enrollmentAccountId", + "in": "path", + "description": "Enrollment Account ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "exportNameParameter": { + "name": "exportName", + "in": "path", + "description": "Export Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "externalCloudProviderTypeParameter": { + "name": "externalCloudProviderType", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "externalSubscriptions", + "externalBillingAccounts" + ], + "x-ms-enum": { + "name": "externalCloudProviderType", + "modelAsString": true + }, + "description": "The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.", + "x-ms-parameter-location": "method" + }, + "externalCloudProviderIdParameter": { + "name": "externalCloudProviderId", + "in": "path", + "required": true, + "type": "string", + "description": "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", + "x-ms-parameter-location": "method" + }, + "alertIdParameter": { + "name": "alertId", + "in": "path", + "description": "Alert ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/src/CostManagement/resources/readme.md b/src/CostManagement/resources/readme.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/src/CostManagement/resources/readme.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file From 4ce2e151fc6f95ea223b2d315442ca9c587e3433 Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Wed, 24 Jun 2020 17:04:22 +0800 Subject: [PATCH 02/17] save --- src/CostManagement/resources/Create.ps1 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 index fad6a85da0ba..4efde9f09df5 100644 --- a/src/CostManagement/resources/Create.ps1 +++ b/src/CostManagement/resources/Create.ps1 @@ -9,13 +9,11 @@ $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} $Aggregation2 = @{ name = 'Cost'; function='sum'} $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} -# New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExport1" ` -# -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-11T20:00:00Z" ` -# -RecurrencePeriodTo "2020-06-20T00:00:00Z" -Format "Csv" ` -# -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` -# -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - # -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') - # -DatasetAggregation $AggregationDict -DatasetGrouping @(@{type='Dimension'; name='SubscriptionName'}; @{type='Tag'; name='Environment'}) - # -DatasetFilter $QueryFileterAnd -Debug -Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExport7" ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-25T20:00:00Z" ` + -RecurrencePeriodTo "2020-06-29T00:00:00Z" -Format "Csv" ` + -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" -DatasetFilter $QueryFileterAnd +# Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file From 4aa057dd162032499f354991487cca79cfb21808 Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Tue, 30 Jun 2020 16:37:57 +0800 Subject: [PATCH 03/17] Fix the issues of url --- src/CostManagement/readme.md | 8 ++++++++ src/CostManagement/resources/Create.ps1 | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index c0dca9e8b76c..23a62ba72247 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -52,7 +52,11 @@ input-file: - $(this-folder)/resources/costmanagement.json title: CostManagement module-version: 0.1.0 + subject-prefix: 'CostManagement' + +identity-correction-for-post: true + directive: - where: variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ @@ -78,6 +82,10 @@ directive: - where: subject: Alert|AlertExternal|Dimension|ExportExecutionHistory|View remove: true + - from: source-file-csharp + where: $ + transform: $ = $.replace(/\^\/\(\?\[\^\/\]\+\)/g, "(?.+)"); + # transform: $ = $.replace("^/(?[^/]+)", "(?.+)"); - no-inline: - QueryFilter diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 index 4efde9f09df5..cd136ab2b8eb 100644 --- a/src/CostManagement/resources/Create.ps1 +++ b/src/CostManagement/resources/Create.ps1 @@ -9,11 +9,11 @@ $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} $Aggregation2 = @{ name = 'Cost'; function='sum'} $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} -New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExport7" ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-25T20:00:00Z" ` - -RecurrencePeriodTo "2020-06-29T00:00:00Z" -Format "Csv" ` +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/lucas-manual-test" -Name "TestExport9" ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T20:00:00Z" ` + -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" -DatasetFilter $QueryFileterAnd + -DatasetGranularity "Daily" # Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file From 70dd19fb4d9f1f59ee488b61bf26bb1aa0d7eff1 Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Thu, 2 Jul 2020 19:56:52 +0800 Subject: [PATCH 04/17] Fix format table of QueryRusult --- .../Invoke-AzCostManagementUsageQuery.ps1 | 99 +++++++++++-------- src/CostManagement/readme.md | 33 ++++++- 2 files changed, 89 insertions(+), 43 deletions(-) diff --git a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 index 093cf0b3f25f..83a5532a0181 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 @@ -260,7 +260,7 @@ param( ) process { - $ApiVersion = '2019-11-01-preview' + $ApiVersion = '2019-11-01' $URL = '' if ($PSBoundParameters.ContainsKey('ExternalCloudProviderType')) { @@ -273,7 +273,7 @@ param( $ErrorMessage = 'Id in input object should not be empty.' throw [System.IO.FileNotFoundException] $ErrorMessage } - $match = [System.Text.RegularExpressions].Regex("^/(?[^/]+)/providers/Microsoft.CostManagement/query$").Match($ResourceId); + $match = [System.Text.RegularExpressions].Regex("(?.+)/providers/Microsoft.CostManagement/query$").Match($ResourceId); if (-not $match.Success) { throw [System.IO.FileNotFoundException] "Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/query'" @@ -283,47 +283,62 @@ param( $URL = [System.Uri]::New([System.Text.RegularExpressions.Regex]::Replace( "https://management.azure.com/$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2")) } + $URL = $URL -replace "https://management.azure.com/","" - $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryDefinition]::New() - if ($PSBoundParameters.ContainsKey('ConfigurationColumn')) { - $Request.ConfigurationColumn = $ConfigurationColumn - } - if ($PSBoundParameters.ContainsKey('DatasetAggregation')) { - $Request.DatasetAggregation = $DatasetAggregation - } - if ($PSBoundParameters.ContainsKey('DatasetFilter')) { - $Request.DatasetFilter = $DatasetFilter - } - if ($PSBoundParameters.ContainsKey('DatasetGranularity')) { - $Request.DatasetGranularity = $DatasetGranularity - } - if ($PSBoundParameters.ContainsKey('DatasetGrouping')) { - $Request.DatasetGrouping = $DatasetGrouping - } - if ($PSBoundParameters.ContainsKey('TimePeriodFrom')) { - $Request.TimePeriodFrom = $TimePeriodFrom - } - if ($PSBoundParameters.ContainsKey('TimePeriodTo')) { - $Request.TimePeriodTo = $TimePeriodTo - } - if ($PSBoundParameters.ContainsKey('Timeframe')) { - $Request.Timeframe = $Timeframe - } - if ($PSBoundParameters.ContainsKey('Type')) { - $Request.Type = $Type + $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryDefinition]::New() + if ($PSBoundParameters.ContainsKey('ConfigurationColumn')) { + $Request.ConfigurationColumn = $ConfigurationColumn + } + if ($PSBoundParameters.ContainsKey('DatasetAggregation')) { + $Request.DatasetAggregation = $DatasetAggregation + } + if ($PSBoundParameters.ContainsKey('DatasetFilter')) { + $Request.DatasetFilter = $DatasetFilter + } + if ($PSBoundParameters.ContainsKey('DatasetGranularity')) { + $Request.DatasetGranularity = $DatasetGranularity + } + if ($PSBoundParameters.ContainsKey('DatasetGrouping')) { + $Request.DatasetGrouping = $DatasetGrouping + } + if ($PSBoundParameters.ContainsKey('TimePeriodFrom')) { + $Request.TimePeriodFrom = $TimePeriodFrom + } + if ($PSBoundParameters.ContainsKey('TimePeriodTo')) { + $Request.TimePeriodTo = $TimePeriodTo + } + if ($PSBoundParameters.ContainsKey('Timeframe')) { + $Request.Timeframe = $Timeframe + } + if ($PSBoundParameters.ContainsKey('Type')) { + $Request.Type = $Type + } + $ResponseContent = (Invoke-AzRest -Path $URL -Payload $Request.ToJsonString() -Method POST).Content | ConvertFrom-Json + if ($Null -ne $ResponseContent.Error) { + throw $ResponseContent.Error.Message + } + $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryResult]::New() + $Result.NextLink = $ResponseContent.Properties.NextLink + + $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryColumn] + foreach ($Column in $ResponseContent.Properties.Columns) { + Write-Host $Column.ToString() + $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn]::New() + $QueryColumn.Name = $Column.Name + $QueryColumn.Type = $Column.Type + $ColumnList.Add($QueryColumn) + } + $Result.Column = $ColumnList + + $RowList = New-Object System.Collections.Generic.List[System.Collections.Generic.List[string]] + foreach ($Row in $ResponseContent.Properties.Rows) { + $QueryRow = New-Object System.Collections.Generic.List[string] + foreach ($Item in $Row) { + $QueryRow.Add($Item.ToString()) } - Write-Host $URL - $Response = Invoke-AzRest -Path $URL $RequestBody $Request | ConvertFrom-Json - $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryResult]::New() - $Result.Column = $Response.Columns - $Result.Row = $Response.Rows - # foreach ($RawRow in $Response.Row) { - # $Row = New-Object System.Collections.ArrayList - # for ($Index=0; $Index -lt $Result.Column.Length; $Index++) { - # $Column = $Result.Column[$Index] - - # } - # } - return $Result + $RowList.Add($QueryRow) + } + $Result.Row = $RowList + return $Result } } diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 23a62ba72247..32e6f8fb9b1d 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -85,7 +85,38 @@ directive: - from: source-file-csharp where: $ transform: $ = $.replace(/\^\/\(\?\[\^\/\]\+\)/g, "(?.+)"); - # transform: $ = $.replace("^/(?[^/]+)", "(?.+)"); + - where: + model-name: QueryResult + set: + format-table: + properties: + - NextLink + - Column + - Row + # - from: swagger-document + # where: $.definitions.AlertProperties.properties.details.properties.resourceGroupFilter.items + # transform: >- + # return { + # "type": "string" + # } + # - from: swagger-document + # where: $.definitions.AlertProperties.properties.details.properties.resourceFilter.items + # transform: >- + # return { + # "type": "string" + # } + # - from: swagger-document + # where: $.definitions.AlertProperties.properties.details.properties.meterFilter.items + # transform: >- + # return { + # "type": "string" + # } + # - from: swagger-document + # where: $.definitions.QueryProperties.rows.items.items + # transform: >- + # return { + # "type": "string" + # } - no-inline: - QueryFilter From d98cc188fe0bb1d292b5b6fa766e002a938fb66a Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Fri, 3 Jul 2020 10:54:32 +0800 Subject: [PATCH 05/17] Fix the issue of new resource --- src/CostManagement/readme.md | 54 +- src/CostManagement/resources/Create.ps1 | 9 +- .../resources/costmanagement.json | 3153 ----------------- 3 files changed, 32 insertions(+), 3184 deletions(-) delete mode 100644 src/CostManagement/resources/costmanagement.json diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 32e6f8fb9b1d..2d67b2d857c6 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -48,8 +48,8 @@ In this directory, run AutoRest: require: - $(this-folder)/../readme.azure.noprofile.md input-file: - # - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json - - $(this-folder)/resources/costmanagement.json + - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json + # - $(this-folder)/resources/costmanagement.json title: CostManagement module-version: 0.1.0 @@ -80,7 +80,7 @@ directive: verb: invoke remove: true - where: - subject: Alert|AlertExternal|Dimension|ExportExecutionHistory|View + subject: Alert|AlertExternal|Dimension|View remove: true - from: source-file-csharp where: $ @@ -93,30 +93,30 @@ directive: - NextLink - Column - Row - # - from: swagger-document - # where: $.definitions.AlertProperties.properties.details.properties.resourceGroupFilter.items - # transform: >- - # return { - # "type": "string" - # } - # - from: swagger-document - # where: $.definitions.AlertProperties.properties.details.properties.resourceFilter.items - # transform: >- - # return { - # "type": "string" - # } - # - from: swagger-document - # where: $.definitions.AlertProperties.properties.details.properties.meterFilter.items - # transform: >- - # return { - # "type": "string" - # } - # - from: swagger-document - # where: $.definitions.QueryProperties.rows.items.items - # transform: >- - # return { - # "type": "string" - # } + - from: swagger-document + where: $.definitions.AlertProperties.properties.details.properties.resourceGroupFilter.items + transform: >- + return { + "type": "string" + } + - from: swagger-document + where: $.definitions.AlertProperties.properties.details.properties.resourceFilter.items + transform: >- + return { + "type": "string" + } + - from: swagger-document + where: $.definitions.AlertProperties.properties.details.properties.meterFilter.items + transform: >- + return { + "type": "string" + } + - from: swagger-document + where: $.definitions.QueryProperties.properties.rows.items.items + transform: >- + return { + "type": "string" + } - no-inline: - QueryFilter diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 index cd136ab2b8eb..81f99779c07f 100644 --- a/src/CostManagement/resources/Create.ps1 +++ b/src/CostManagement/resources/Create.ps1 @@ -3,17 +3,18 @@ $QueryOrTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environ $QueryFilterOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $QueryOrDimension), (New-AzCostManagementQueryFilterObject -Tag $QueryOrTag)) $QueryAndDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' $a = New-AzCostManagementQueryFilterObject -Dimension $QueryAndDimension +$tag = New-AzCostManagementQueryFilterObject -Tag $QueryAndDimension $QueryFileterAnd = New-AzCostManagementQueryFilterObject -And @($QueryFilterOr, $a) $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} $Aggregation2 = @{ name = 'Cost'; function='sum'} $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} -New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/lucas-manual-test" -Name "TestExport9" ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T20:00:00Z" ` - -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExportDatasetAggregation" ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-07-03T20:00:00Z" ` + -RecurrencePeriodTo "2020-07-10T00:00:00Z" -Format "Csv" ` -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" + -DatasetGranularity "Daily" -DatasetAggregation $AggregationDict # Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file diff --git a/src/CostManagement/resources/costmanagement.json b/src/CostManagement/resources/costmanagement.json deleted file mode 100644 index e8d1e13e2ee7..000000000000 --- a/src/CostManagement/resources/costmanagement.json +++ /dev/null @@ -1,3153 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2019-11-01", - "title": "CostManagementClient" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/providers/Microsoft.CostManagement/views": { - "get": { - "tags": [ - "Views" - ], - "operationId": "Views_List", - "description": "Lists all views by tenant and object.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "PrivateViewList": { - "$ref": "./examples/PrivateViewList.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ViewListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/views": { - "get": { - "tags": [ - "Views" - ], - "operationId": "Views_ListByScope", - "description": "Lists all views at the given scope.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ResourceGroupViewList": { - "$ref": "./examples/ViewListByResourceGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeViewParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ViewListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/providers/Microsoft.CostManagement/views/{viewName}": { - "get": { - "tags": [ - "Views" - ], - "operationId": "Views_Get", - "description": "Gets the view by view name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "PrivateView": { - "$ref": "./examples/PrivateView.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/viewNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/View" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Views" - ], - "operationId": "Views_CreateOrUpdate", - "description": "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "CreateOrUpdatePrivateView": { - "$ref": "./examples/PrivateViewCreateOrUpdate.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/viewNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/View" - }, - "description": "Parameters supplied to the CreateOrUpdate View operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/View" - } - }, - "201": { - "description": "Created.", - "schema": { - "$ref": "#/definitions/View" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Views" - ], - "operationId": "Views_Delete", - "description": "The operation to delete a view.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "DeletePrivateView": { - "$ref": "./examples/PrivateViewDelete.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/viewNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "204": { - "description": "NoContent. Resource is not available." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/views/{viewName}": { - "get": { - "tags": [ - "Views" - ], - "operationId": "Views_GetByScope", - "description": "Gets the view for the defined scope by view name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ResourceGroupView": { - "$ref": "./examples/ViewByResourceGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeViewParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/viewNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/View" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Views" - ], - "operationId": "Views_CreateOrUpdateByScope", - "description": "The operation to create or update a view. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ResourceGroupCreateOrUpdateView": { - "$ref": "./examples/ViewCreateOrUpdateByResourceGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeViewParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/viewNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/View" - }, - "description": "Parameters supplied to the CreateOrUpdate View operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/View" - } - }, - "201": { - "description": "Created.", - "schema": { - "$ref": "#/definitions/View" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Views" - ], - "operationId": "Views_DeleteByScope", - "description": "The operation to delete a view.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ResourceGroupDeleteView": { - "$ref": "./examples/ViewDeleteByResourceGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeViewParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/viewNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "204": { - "description": "NoContent. Resource is not available." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/alerts": { - "get": { - "tags": [ - "Alerts" - ], - "operationId": "Alerts_List", - "description": "Lists the alerts for scope defined.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "BillingAccountAlerts": { - "$ref": "./examples/BillingAccountAlerts.json" - }, - "BillingProfileAlerts": { - "$ref": "./examples/BillingProfileAlerts.json" - }, - "InvoiceSectionAlerts": { - "$ref": "./examples/InvoiceSectionAlerts.json" - }, - "EnrollmentAccountAlerts": { - "$ref": "./examples/EnrollmentAccountAlerts.json" - }, - "DepartmentAlerts": { - "$ref": "./examples/DepartmentAlerts.json" - }, - "SubscriptionAlerts": { - "$ref": "./examples/SubscriptionAlerts.json" - }, - "ResourceGroupAlerts": { - "$ref": "./examples/ResourceGroupAlerts.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/scopeAlertParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/AlertsResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/alerts/{alertId}": { - "get": { - "tags": [ - "Alerts" - ], - "operationId": "Alerts_Get", - "description": "Gets the alert for the scope by alert ID.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionAlerts": { - "$ref": "./examples/SingleSubscriptionAlert.json" - }, - "ResourceGroupAlerts": { - "$ref": "./examples/SingleResourceGroupAlert.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/scopeAlertParameter" - }, - { - "$ref": "#/parameters/alertIdParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Alert" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "tags": [ - "Alerts" - ], - "operationId": "Alerts_Dismiss", - "description": "Dismisses the specified alert", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionAlerts": { - "$ref": "./examples/DismissSubscriptionAlerts.json" - }, - "ResourceGroupAlerts": { - "$ref": "./examples/DismissResourceGroupAlerts.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/scopeAlertParameter" - }, - { - "$ref": "#/parameters/alertIdParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DismissAlertPayload" - }, - "description": "Parameters supplied to the Dismiss Alert operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Alert" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/alerts": { - "get": { - "tags": [ - "Alerts" - ], - "operationId": "Alerts_ListExternal", - "description": "Lists the Alerts for external cloud provider type defined.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExternalBillingAccountAlerts": { - "$ref": "./examples/ExternalBillingAccountAlerts.json" - }, - "ExternalSubscriptionAlerts": { - "$ref": "./examples/ExternalSubscriptionAlerts.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/externalCloudProviderTypeParameter" - }, - { - "$ref": "#/parameters/externalCloudProviderIdParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/AlertsResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/forecast": { - "post": { - "tags": [ - "Forecast" - ], - "operationId": "Forecast_Usage", - "description": "Lists the forecast charges for scope defined.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "BillingAccountForecast": { - "$ref": "./examples/BillingAccountForecast.json" - }, - "BillingProfileForecast": { - "$ref": "./examples/BillingProfileForecast.json" - }, - "InvoiceSectionForecast": { - "$ref": "./examples/InvoiceSectionForecast.json" - }, - "EnrollmentAccountForecast": { - "$ref": "./examples/EnrollmentAccountForecast.json" - }, - "DepartmentForecast": { - "$ref": "./examples/DepartmentForecast.json" - }, - "SubscriptionForecast": { - "$ref": "./examples/SubscriptionForecast.json" - }, - "ResourceGroupForecast": { - "$ref": "./examples/ResourceGroupForecast.json" - } - }, - "parameters": [ - { - "name": "$filter", - "description": "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", - "in": "query", - "required": false, - "type": "string" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/scopeForecastParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ForecastDefinition" - }, - "description": "Parameters supplied to the CreateOrUpdate Forecast Config operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/QueryResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/forecast": { - "post": { - "tags": [ - "Forecast" - ], - "operationId": "Forecast_ExternalCloudProviderUsage", - "description": "Lists the forecast charges for external cloud provider type defined.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExternalBillingAccountForecast": { - "$ref": "./examples/ExternalBillingAccountForecast.json" - }, - "ExternalSubscriptionForecast": { - "$ref": "./examples/ExternalSubscriptionForecast.json" - } - }, - "parameters": [ - { - "name": "$filter", - "description": "May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", - "in": "query", - "required": false, - "type": "string" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/externalCloudProviderTypeParameter" - }, - { - "$ref": "#/parameters/externalCloudProviderIdParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ForecastDefinition" - }, - "description": "Parameters supplied to the CreateOrUpdate Forecast Config operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/QueryResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/dimensions": { - "get": { - "tags": [ - "Dimensions" - ], - "x-ms-odata": "#/definitions/Dimension", - "operationId": "Dimensions_List", - "description": "Lists the dimensions by the defined scope.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionDimensionsList-Legacy": { - "$ref": "./examples/SubscriptionDimensionsList.json" - }, - "ResourceGroupDimensionsList-Legacy": { - "$ref": "./examples/ResourceGroupDimensionsList.json" - }, - "ManagementGroupDimensionsList-Legacy": { - "$ref": "./examples/ManagementGroupDimensionsList.json" - }, - "ManagementGroupDimensionsListExpandAndTop-Legacy": { - "$ref": "./examples/ManagementGroupDimensionsListExpandAndTop.json" - }, - "ManagementGroupDimensionsListWithFilter-Legacy": { - "$ref": "./examples/ManagementGroupDimensionsListWithFilter.json" - }, - "DepartmentDimensionsList-Legacy": { - "$ref": "./examples/DepartmentDimensionsList.json" - }, - "DepartmentDimensionsListExpandAndTop-Legacy": { - "$ref": "./examples/DepartmentDimensionsListExpandAndTop.json" - }, - "DepartmentDimensionsListWithFilter-Legacy": { - "$ref": "./examples/DepartmentDimensionsListWithFilter.json" - }, - "EnrollmentAccountDimensionsList-Legacy": { - "$ref": "./examples/EnrollmentAccountDimensionsList.json" - }, - "EnrollmentAccountDimensionsListExpandAndTop-Legacy": { - "$ref": "./examples/EnrollmentAccountDimensionsListExpandAndTop.json" - }, - "EnrollmentAccountDimensionsListWithFilter-Legacy": { - "$ref": "./examples/EnrollmentAccountDimensionsListWithFilter.json" - }, - "BillingAccountDimensionsList-Legacy": { - "$ref": "./examples/BillingAccountDimensionsList.json" - }, - "BillingAccountDimensionsListExpandAndTop-Legacy": { - "$ref": "./examples/BillingAccountDimensionsListExpandAndTop.json" - }, - "BillingAccountDimensionsListWithFilter-Legacy": { - "$ref": "./examples/BillingAccountDimensionsListWithFilter.json" - }, - "BillingAccountDimensionsList-Modern": { - "$ref": "./examples/MCABillingAccountDimensionsList.json" - }, - "BillingAccountDimensionsListExpandAndTop-Modern": { - "$ref": "./examples/MCABillingAccountDimensionsListExpandAndTop.json" - }, - "BillingAccountDimensionsListWithFilter-Modern": { - "$ref": "./examples/MCABillingAccountDimensionsListWithFilter.json" - }, - "BillingProfileDimensionsList-Modern": { - "$ref": "./examples/MCABillingProfileDimensionsList.json" - }, - "BillingProfileDimensionsListExpandAndTop-Modern": { - "$ref": "./examples/MCABillingProfileDimensionsListExpandAndTop.json" - }, - "BillingProfileDimensionsListWithFilter-Modern": { - "$ref": "./examples/MCABillingProfileDimensionsListWithFilter.json" - }, - "InvoiceSectionDimensionsList-Modern": { - "$ref": "./examples/MCAInvoiceSectionDimensionsList.json" - }, - "InvoiceSectionDimensionsListExpandAndTop-Modern": { - "$ref": "./examples/MCAInvoiceSectionDimensionsListExpandAndTop.json" - }, - "InvoiceSectionDimensionsListWithFilter-Modern": { - "$ref": "./examples/MCAInvoiceSectionDimensionsListWithFilter.json" - }, - "CustomerDimensionsList-Modern": { - "$ref": "./examples/MCACustomerDimensionsList.json" - }, - "CustomerDimensionsListExpandAndTop-Modern": { - "$ref": "./examples/MCACustomerDimensionsListExpandAndTop.json" - }, - "CustomerDimensionsListWithFilter-Modern": { - "$ref": "./examples/MCACustomerDimensionsListWithFilter.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeDimensionParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "$filter", - "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "$expand", - "description": "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "$skiptoken", - "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "$top", - "description": "May be used to limit the number of results to the most recent N dimension data.", - "in": "query", - "required": false, - "type": "integer", - "minimum": 1, - "maximum": 1000 - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/DimensionsListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - } - } - }, - "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/dimensions": { - "get": { - "tags": [ - "Dimensions" - ], - "x-ms-odata": "#/definitions/Dimension", - "operationId": "Dimensions_ByExternalCloudProviderType", - "description": "Lists the dimensions by the external cloud provider type.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExternalBillingAccountDimensionList": { - "$ref": "./examples/ExternalBillingAccountsDimensions.json" - }, - "ExternalSubscriptionDimensionList": { - "$ref": "./examples/ExternalSubscriptionsDimensions.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/externalCloudProviderTypeParameter" - }, - { - "$ref": "#/parameters/externalCloudProviderIdParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "$filter", - "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "$expand", - "description": "May be used to expand the properties/data within a dimension category. By default, data is not included when listing dimensions.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "$skiptoken", - "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "$top", - "description": "May be used to limit the number of results to the most recent N dimension data.", - "in": "query", - "required": false, - "type": "integer", - "minimum": 1, - "maximum": 1000 - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/DimensionsListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/query": { - "post": { - "tags": [ - "Query" - ], - "operationId": "Query_Usage", - "description": "Query the usage data for scope defined.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionQuery-Legacy": { - "$ref": "./examples/SubscriptionQuery.json" - }, - "SubscriptionQueryGrouping-Legacy": { - "$ref": "./examples/SubscriptionQueryGrouping.json" - }, - "ResourceGroupQuery-Legacy": { - "$ref": "./examples/ResourceGroupQuery.json" - }, - "ResourceGroupQueryGrouping-Legacy": { - "$ref": "./examples/ResourceGroupQueryGrouping.json" - }, - "BillingAccountQuery-Legacy": { - "$ref": "./examples/BillingAccountQuery.json" - }, - "BillingAccountQueryGrouping-Legacy": { - "$ref": "./examples/BillingAccountQueryGrouping.json" - }, - "EnrollmentAccountQuery-Legacy": { - "$ref": "./examples/EnrollmentAccountQuery.json" - }, - "EnrollmentAccountQueryGrouping-Legacy": { - "$ref": "./examples/EnrollmentAccountQueryGrouping.json" - }, - "DepartmentQuery-Legacy": { - "$ref": "./examples/DepartmentQuery.json" - }, - "DepartmentQueryGrouping-Legacy": { - "$ref": "./examples/DepartmentQueryGrouping.json" - }, - "ManagementGroupQuery-Legacy": { - "$ref": "./examples/ManagementGroupQuery.json" - }, - "ManagementGroupQueryGrouping-Legacy": { - "$ref": "./examples/ManagementGroupQueryGrouping.json" - }, - "BillingAccountQuery-Modern": { - "$ref": "./examples/MCABillingAccountQuery.json" - }, - "BillingAccountQueryGrouping-Modern": { - "$ref": "./examples/MCABillingAccountQueryGrouping.json" - }, - "BillingProfileQuery-Modern": { - "$ref": "./examples/MCABillingProfileQuery.json" - }, - "BillingProfileQueryGrouping-Modern": { - "$ref": "./examples/MCABillingProfileQueryGrouping.json" - }, - "InvoiceSectionQuery-Modern": { - "$ref": "./examples/MCAInvoiceSectionQuery.json" - }, - "InvoiceSectionQueryGrouping-Modern": { - "$ref": "./examples/MCAInvoiceSectionQueryGrouping.json" - }, - "CustomerQuery-Modern": { - "$ref": "./examples/MCACustomerQuery.json" - }, - "CustomerQueryGrouping-Modern": { - "$ref": "./examples/MCACustomerQueryGrouping.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/QueryDefinition" - }, - "description": "Parameters supplied to the CreateOrUpdate Query Config operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/QueryResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query": { - "post": { - "tags": [ - "Query" - ], - "operationId": "Query_UsageByExternalCloudProviderType", - "description": "Query the usage data for external cloud provider type defined.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "ExternalBillingAccountQueryList": { - "$ref": "./examples/ExternalBillingAccountsQuery.json" - }, - "ExternalSubscriptionsQuery": { - "$ref": "./examples/ExternalSubscriptionsQuery.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/externalCloudProviderTypeParameter" - }, - { - "$ref": "#/parameters/externalCloudProviderIdParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/QueryDefinition" - }, - "description": "Parameters supplied to the CreateOrUpdate Query Config operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/QueryResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_List", - "description": "The operation to list all exports at the given scope.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionExportList": { - "$ref": "./examples/ExportListBySubscription.json" - }, - "ResourceGroupExportList": { - "$ref": "./examples/ExportListByResourceGroup.json" - }, - "BillingAccountExportList": { - "$ref": "./examples/ExportListByBillingAccount.json" - }, - "DepartmentExportList": { - "$ref": "./examples/ExportListByDepartment.json" - }, - "EnrollmentAccountExportList": { - "$ref": "./examples/ExportListByEnrollmentAccount.json" - }, - "ManagementGroupExportList": { - "$ref": "./examples/ExportListByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ExportListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Get", - "description": "The operation to get the export for the defined scope by export name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionExport": { - "$ref": "./examples/ExportBySubscription.json" - }, - "ResourceGroupExport": { - "$ref": "./examples/ExportByResourceGroup.json" - }, - "BillingAccountExport": { - "$ref": "./examples/ExportByBillingAccount.json" - }, - "DepartmentExport": { - "$ref": "./examples/ExportByDepartment.json" - }, - "EnrollmentAccountExport": { - "$ref": "./examples/ExportByEnrollmentAccount.json" - }, - "ManagementGroupExport": { - "$ref": "./examples/ExportByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Exports" - ], - "operationId": "Exports_CreateOrUpdate", - "description": "The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionCreateOrUpdateExport": { - "$ref": "./examples/ExportCreateOrUpdateBySubscription.json" - }, - "ResourceGroupCreateOrUpdateExport": { - "$ref": "./examples/ExportCreateOrUpdateByResourceGroup.json" - }, - "BillingAccountCreateOrUpdateExport": { - "$ref": "./examples/ExportCreateOrUpdateByBillingAccount.json" - }, - "DepartmentCreateOrUpdateExport": { - "$ref": "./examples/ExportCreateOrUpdateByDepartment.json" - }, - "EnrollmentAccountCreateOrUpdateExport": { - "$ref": "./examples/ExportCreateOrUpdateByEnrollmentAccount.json" - }, - "ManagementGroupCreateOrUpdateExport": { - "$ref": "./examples/ExportCreateOrUpdateByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Export" - }, - "description": "Parameters supplied to the CreateOrUpdate Export operation." - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "201": { - "description": "Created.", - "schema": { - "$ref": "#/definitions/Export" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Delete", - "description": "The operation to delete a export.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionDeleteExport": { - "$ref": "./examples/ExportDeleteBySubscription.json" - }, - "ResourceGroupDeleteExport": { - "$ref": "./examples/ExportDeleteByResourceGroup.json" - }, - "BillingAccountDeleteExport": { - "$ref": "./examples/ExportDeleteByBillingAccount.json" - }, - "EnrollmentAccountDeleteExport": { - "$ref": "./examples/ExportDeleteByEnrollmentAccount.json" - }, - "DepartmentDeleteExport": { - "$ref": "./examples/ExportDeleteByDepartment.json" - }, - "ManagementGroupDeleteExport": { - "$ref": "./examples/ExportDeleteByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/run": { - "post": { - "tags": [ - "Exports" - ], - "operationId": "Exports_Execute", - "description": "The operation to execute a export.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionExecuteExport": { - "$ref": "./examples/ExportExecutionBySubscription.json" - }, - "ResourceGroupExecuteExport": { - "$ref": "./examples/ExportExecutionByResourceGroup.json" - }, - "BillingAccountExecuteExport": { - "$ref": "./examples/ExportExecutionByBillingAccount.json" - }, - "DepartmentExecuteExport": { - "$ref": "./examples/ExportExecutionByDepartment.json" - }, - "EnrollmentAccountExecuteExport": { - "$ref": "./examples/ExportExecutionByEnrollmentAccount.json" - }, - "ManagementGroupExecuteExport": { - "$ref": "./examples/ExportExecutionByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory": { - "get": { - "tags": [ - "Exports" - ], - "operationId": "Exports_GetExecutionHistory", - "description": "The operation to get the execution history of an export for the defined scope by export name.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" - }, - "x-ms-examples": { - "SubscriptionExecutionHistoryExport": { - "$ref": "./examples/ExportExecutionListBySubscription.json" - }, - "ResourceGroupExecutionHistoryExport": { - "$ref": "./examples/ExportExecutionListByResourceGroup.json" - }, - "BillingAccountExecutionHistoryExport": { - "$ref": "./examples/ExportExecutionListByBillingAccount.json" - }, - "DepartmentExecutionHistoryExport": { - "$ref": "./examples/ExportExecutionListByDepartment.json" - }, - "EnrollmentAccountExecutionHistoryExport": { - "$ref": "./examples/ExportExecutionListByEnrollmentAccount.json" - }, - "ManagementGroupExecutionHistoryExport": { - "$ref": "./examples/ExportExecutionListByManagementGroup.json" - } - }, - "parameters": [ - { - "$ref": "#/parameters/scopeQueryParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "$ref": "#/parameters/exportNameParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/ExportExecutionListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Microsoft.CostManagement/operations": { - "get": { - "tags": [ - "Operations" - ], - "operationId": "Operations_List", - "description": "Lists all of the available cost management REST API operations.", - "parameters": [ - { - "$ref": "#/parameters/apiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK. The request has succeeded.", - "schema": { - "$ref": "#/definitions/OperationListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "ReportConfigDefinition": { - "description": "The definition of a report config.", - "properties": { - "type": { - "description": "The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.", - "type": "string", - "enum": [ - "Usage" - ], - "x-ms-enum": { - "name": "ReportType", - "modelAsString": true - } - }, - "timeframe": { - "description": "The time frame for pulling data for the report. If custom, then a specific time period must be provided.", - "type": "string", - "enum": [ - "WeekToDate", - "MonthToDate", - "YearToDate", - "Custom" - ], - "x-ms-enum": { - "name": "ReportTimeframeType", - "modelAsString": true - } - }, - "timePeriod": { - "description": "Has time period for pulling data for the report.", - "$ref": "#/definitions/ReportConfigTimePeriod" - }, - "dataset": { - "description": "Has definition for data in this report config.", - "$ref": "#/definitions/ReportConfigDataset" - } - }, - "required": [ - "type", - "timeframe" - ] - }, - "ReportConfigTimePeriod": { - "description": "The start and end date for pulling data for the report.", - "properties": { - "from": { - "description": "The start date to pull data from.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date to pull data to.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from", - "to" - ] - }, - "ReportConfigDataset": { - "description": "The definition of data present in the report.", - "properties": { - "granularity": { - "description": "The granularity of rows in the report.", - "type": "string", - "enum": [ - "Daily", - "Monthly" - ], - "x-ms-enum": { - "name": "ReportGranularityType", - "modelAsString": true - } - }, - "configuration": { - "description": "Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.", - "$ref": "#/definitions/ReportConfigDatasetConfiguration" - }, - "aggregation": { - "type": "object", - "description": "Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.", - "additionalProperties": { - "type": "object", - "$ref": "#/definitions/ReportConfigAggregation" - }, - "maxItems": 2 - }, - "grouping": { - "description": "Array of group by expression to use in the report. Report can have up to 2 group by clauses.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigGrouping" - }, - "maxItems": 2 - }, - "sorting": { - "description": "Array of order by expression to use in the report.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigSorting" - } - }, - "filter": { - "type": "object", - "description": "Has filter expression to use in the report.", - "$ref": "#/definitions/ReportConfigFilter" - } - } - }, - "ReportConfigDatasetConfiguration": { - "description": "The configuration of dataset in the report.", - "properties": { - "columns": { - "description": "Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "ReportConfigAggregation": { - "description": "The aggregation expression to be used in the report.", - "properties": { - "name": { - "description": "The name of the column to aggregate.", - "type": "string" - }, - "function": { - "description": "The name of the aggregation function to use.", - "type": "string", - "enum": [ - "Sum" - ], - "x-ms-enum": { - "name": "FunctionType", - "modelAsString": true - } - } - }, - "required": [ - "name", - "function" - ] - }, - "ReportConfigSorting": { - "description": "The order by expression to be used in the report.", - "properties": { - "direction": { - "description": "Direction of sort.", - "type": "string", - "enum": [ - "Ascending", - "Descending" - ] - }, - "name": { - "description": "The name of the column to sort.", - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "ReportConfigGrouping": { - "description": "The group by expression to be used in the report.", - "properties": { - "type": { - "description": "Has type of the column to group.", - "$ref": "#/definitions/ReportConfigColumnType" - }, - "name": { - "description": "The name of the column to group. This version supports subscription lowest possible grain.", - "type": "string" - } - }, - "required": [ - "type", - "name" - ] - }, - "ReportConfigFilter": { - "description": "The filter expression to be used in the report.", - "properties": { - "and": { - "description": "The logical \"AND\" expression. Must have at least 2 items.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigFilter" - }, - "minItems": 2 - }, - "or": { - "description": "The logical \"OR\" expression. Must have at least 2 items.", - "type": "array", - "items": { - "$ref": "#/definitions/ReportConfigFilter" - }, - "minItems": 2 - }, - "not": { - "description": "The logical \"NOT\" expression.", - "$ref": "#/definitions/ReportConfigFilter" - }, - "dimension": { - "description": "Has comparison expression for a dimension", - "$ref": "#/definitions/ReportConfigComparisonExpression" - }, - "tag": { - "description": "Has comparison expression for a tag", - "$ref": "#/definitions/ReportConfigComparisonExpression" - } - } - }, - "ReportConfigColumnType": { - "description": "The type of the column in the report.", - "type": "string", - "enum": [ - "Tag", - "Dimension" - ], - "x-ms-enum": { - "name": "ReportConfigColumnType", - "modelAsString": true - } - }, - "ReportConfigComparisonExpression": { - "description": "The comparison expression to be used in the report.", - "properties": { - "name": { - "description": "The name of the column to use in comparison.", - "type": "string" - }, - "operator": { - "description": "The operator to use for comparison.", - "type": "string", - "enum": [ - "In", - "Contains" - ], - "x-ms-enum": { - "name": "OperatorType", - "modelAsString": true - } - }, - "values": { - "description": "Array of values to use for comparison", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - }, - "required": [ - "name", - "operator", - "values" - ] - }, - "ViewListResult": { - "description": "Result of listing views. It contains a list of available views.", - "type": "object", - "properties": { - "value": { - "description": "The list of views.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/View" - } - }, - "nextLink": { - "description": "The link (url) to the next page of results.", - "type": "string", - "readOnly": true - } - } - }, - "View": { - "description": "States and configurations of Cost Analysis.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ProxyResource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ViewProperties", - "title": "View properties" - } - } - }, - "ViewProperties": { - "type": "object", - "description": "The properties of the view.", - "properties": { - "displayName": { - "description": "User input name of the view. Required.", - "type": "string" - }, - "scope": { - "description": "Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.", - "type": "string" - }, - "createdOn": { - "description": "Date the user created this view.", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "modifiedOn": { - "description": "Date when the user last modified this view.", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "query": { - "description": "Query body configuration. Required.", - "type": "object", - "x-ms-client-flatten": true, - "$ref": "#/definitions/ReportConfigDefinition" - }, - "chart": { - "description": "Chart type of the main view in Cost Analysis. Required.", - "type": "string", - "enum": [ - "Area", - "Line", - "StackedColumn", - "GroupedColumn", - "Table" - ], - "x-ms-enum": { - "name": "ChartType", - "modelAsString": true - } - }, - "accumulated": { - "description": "Show costs accumulated over time.", - "type": "string", - "enum": [ - "true", - "false" - ], - "x-ms-enum": { - "name": "AccumulatedType", - "modelAsString": true - } - }, - "metric": { - "description": "Metric to use when displaying costs.", - "type": "string", - "enum": [ - "ActualCost", - "AmortizedCost", - "AHUB" - ], - "x-ms-enum": { - "name": "MetricType", - "modelAsString": true - } - }, - "kpis": { - "description": "List of KPIs to show in Cost Analysis UI.", - "type": "array", - "items": { - "$ref": "#/definitions/KpiProperties" - } - }, - "pivots": { - "description": "Configuration of 3 sub-views in the Cost Analysis UI.", - "type": "array", - "items": { - "$ref": "#/definitions/PivotProperties" - } - } - } - }, - "KpiProperties": { - "description": "Each KPI must contain a 'type' and 'enabled' key.", - "type": "object", - "properties": { - "type": { - "description": "KPI type (Forecast, Budget).", - "type": "string", - "enum": [ - "Forecast", - "Budget" - ], - "x-ms-enum": { - "name": "KpiTypeType", - "modelAsString": true - } - }, - "id": { - "description": "ID of resource related to metric (budget).", - "type": "string" - }, - "enabled": { - "description": "show the KPI in the UI?", - "type": "boolean" - } - } - }, - "PivotProperties": { - "description": "Each pivot must contain a 'type' and 'name'.", - "type": "object", - "properties": { - "type": { - "description": "Data type to show in view.", - "type": "string", - "enum": [ - "Dimension", - "TagKey" - ], - "x-ms-enum": { - "name": "PivotTypeType", - "modelAsString": true - } - }, - "name": { - "description": "Data field to show in view.", - "type": "string" - } - } - }, - "ErrorDetails": { - "description": "The details of the error.", - "properties": { - "code": { - "description": "Error code.", - "type": "string", - "readOnly": true - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string", - "readOnly": true - } - } - }, - "ErrorResponse": { - "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", - "type": "object", - "properties": { - "error": { - "description": "The details of the error.", - "$ref": "#/definitions/ErrorDetails" - } - } - }, - "Resource": { - "description": "The Resource model definition.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - }, - "tags": { - "readOnly": true, - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags." - } - }, - "x-ms-azure-resource": true - }, - "ProxyResource": { - "description": "The Resource model definition.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type." - }, - "eTag": { - "type": "string", - "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." - } - }, - "x-ms-azure-resource": true - }, - "DimensionsListResult": { - "description": "Result of listing dimensions. It contains a list of available dimensions.", - "type": "object", - "properties": { - "value": { - "description": "The list of dimensions.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Dimension" - } - } - } - }, - "Dimension": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/DimensionProperties", - "title": "Dimension properties" - } - } - }, - "DimensionProperties": { - "type": "object", - "properties": { - "description": { - "description": "Dimension description.", - "type": "string", - "readOnly": true - }, - "filterEnabled": { - "description": "Filter enabled.", - "type": "boolean", - "readOnly": true - }, - "groupingEnabled": { - "description": "Grouping enabled.", - "type": "boolean", - "readOnly": true - }, - "data": { - "type": "array", - "items": { - "description": "Dimension data item.", - "type": "string", - "readOnly": true - } - }, - "total": { - "description": "Total number of data for the dimension.", - "format": "int32", - "type": "integer", - "readOnly": true - }, - "category": { - "description": "Dimension category.", - "type": "string", - "readOnly": true - }, - "usageStart": { - "description": "Usage start.", - "format": "date-time", - "type": "string", - "readOnly": true - }, - "usageEnd": { - "description": "Usage end.", - "format": "date-time", - "type": "string", - "readOnly": true - }, - "nextLink": { - "description": "The link (url) to the next page of results.", - "type": "string", - "readOnly": true - } - } - }, - "AlertsResult": { - "description": "Result of alerts.", - "type": "object", - "properties": { - "value": { - "description": "List of alerts.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Alert" - } - }, - "nextLink": { - "description": "URL to get the next set of alerts results if there are any.", - "type": "string", - "readOnly": true - } - } - }, - "Alert": { - "description": "An individual alert.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/AlertProperties", - "title": "Alert properties" - } - } - }, - "AlertProperties": { - "type": "object", - "properties": { - "definition": { - "description": "defines the type of alert", - "type": "object", - "properties": { - "type": { - "description": "type of alert", - "type": "string", - "enum": [ - "Budget", - "Invoice", - "Credit", - "Quota", - "General", - "xCloud", - "BudgetForecast" - ], - "x-ms-enum": { - "name": "AlertType", - "modelAsString": true - } - }, - "category": { - "description": "Alert category", - "type": "string", - "enum": [ - "Cost", - "Usage", - "Billing", - "System" - ], - "x-ms-enum": { - "name": "AlertCategory", - "modelAsString": true - } - }, - "criteria": { - "description": "Criteria that triggered alert", - "type": "string", - "enum": [ - "CostThresholdExceeded", - "UsageThresholdExceeded", - "CreditThresholdApproaching", - "CreditThresholdReached", - "QuotaThresholdApproaching", - "QuotaThresholdReached", - "MultiCurrency", - "ForecastCostThresholdExceeded", - "ForecastUsageThresholdExceeded", - "InvoiceDueDateApproaching", - "InvoiceDueDateReached", - "CrossCloudNewDataAvailable", - "CrossCloudCollectionError", - "GeneralThresholdError" - ], - "x-ms-enum": { - "name": "AlertCriteria", - "modelAsString": true - } - } - } - }, - "description": { - "description": "Alert description", - "type": "string" - }, - "source": { - "description": "Source of alert", - "type": "string", - "enum": [ - "Preset", - "User" - ], - "x-ms-enum": { - "name": "AlertSource", - "modelAsString": true - } - }, - "details": { - "description": "Alert details", - "type": "object", - "properties": { - "timeGrainType": { - "description": "Type of timegrain cadence", - "type": "string", - "enum": [ - "None", - "Monthly", - "Quarterly", - "Annually", - "BillingMonth", - "BillingQuarter", - "BillingAnnual" - ], - "x-ms-enum": { - "name": "AlertTimeGrainType", - "modelAsString": true - } - }, - "periodStartDate": { - "description": "datetime of periodStartDate", - "type": "string" - }, - "triggeredBy": { - "description": "notificationId that triggered this alert", - "type": "string" - }, - "resourceGroupFilter": { - "description": "array of resourceGroups to filter by", - "type": "array", - "items": { - "type": "object" - } - }, - "resourceFilter": { - "description": "array of resources to filter by", - "type": "array", - "items": { - "type": "object" - } - }, - "meterFilter": { - "description": "array of meters to filter by", - "type": "array", - "items": { - "type": "object" - } - }, - "tagFilter": { - "description": "tags to filter by", - "type": "object", - "properties": {} - }, - "threshold": { - "description": "notification threshold percentage as a decimal which activated this alert", - "type": "number", - "format": "decimal" - }, - "operator": { - "description": "operator used to compare currentSpend with amount", - "type": "string", - "enum": [ - "None", - "EqualTo", - "GreaterThan", - "GreaterThanOrEqualTo", - "LessThan", - "LessThanOrEqualTo" - ], - "x-ms-enum": { - "name": "AlertOperator", - "modelAsString": true - } - }, - "amount": { - "description": "budget threshold amount", - "type": "number", - "format": "decimal" - }, - "unit": { - "description": "unit of currency being used", - "type": "string" - }, - "currentSpend": { - "description": "current spend", - "type": "number", - "format": "decimal" - }, - "contactEmails": { - "description": "list of emails to contact", - "type": "array", - "items": { - "type": "string" - } - }, - "contactGroups": { - "description": "list of action groups to broadcast to", - "type": "array", - "items": { - "type": "string" - } - }, - "contactRoles": { - "description": "list of contact roles", - "type": "array", - "items": { - "type": "string" - } - }, - "overridingAlert": { - "description": "overriding alert", - "type": "string" - } - } - }, - "costEntityId": { - "description": "related budget", - "type": "string" - }, - "status": { - "description": "alert status", - "type": "string", - "enum": [ - "None", - "Active", - "Overridden", - "Resolved", - "Dismissed" - ], - "x-ms-enum": { - "name": "AlertStatus", - "modelAsString": true - } - }, - "creationTime": { - "description": "dateTime in which alert was created", - "type": "string" - }, - "closeTime": { - "description": "dateTime in which alert was closed", - "type": "string" - }, - "modificationTime": { - "description": "dateTime in which alert was last modified", - "type": "string" - }, - "statusModificationUserName": { - "description": "", - "type": "string" - }, - "statusModificationTime": { - "description": "dateTime in which the alert status was last modified", - "type": "string" - } - } - }, - "DismissAlertPayload": { - "description": "The request payload to update an alert", - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/AlertProperties", - "title": "Alert properties" - } - } - }, - "QueryResult": { - "description": "Result of query. It contains all columns listed under groupings and aggregation.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/QueryProperties", - "title": "Query properties" - } - } - }, - "QueryProperties": { - "type": "object", - "properties": { - "nextLink": { - "description": "The link (url) to the next page of results.", - "type": "string" - }, - "columns": { - "description": "Array of columns", - "type": "array", - "items": { - "$ref": "#/definitions/QueryColumn" - } - }, - "rows": { - "description": "Array of rows", - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "QueryColumn": { - "type": "object", - "properties": { - "name": { - "description": "The name of column.", - "type": "string" - }, - "type": { - "description": "The type of column.", - "type": "string" - } - } - }, - "OperationListResult": { - "description": "Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.", - "properties": { - "value": { - "description": "List of cost management operations supported by the Microsoft.CostManagement resource provider.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Operation" - } - }, - "nextLink": { - "description": "URL to get the next set of operation list results if there are any.", - "type": "string", - "readOnly": true - } - } - }, - "Operation": { - "description": "A Cost management REST API operation.", - "type": "object", - "properties": { - "name": { - "description": "Operation name: {provider}/{resource}/{operation}.", - "type": "string", - "readOnly": true - }, - "display": { - "description": "The object that represents the operation.", - "properties": { - "provider": { - "description": "Service provider: Microsoft.CostManagement.", - "type": "string", - "readOnly": true - }, - "resource": { - "description": "Resource on which the operation is performed: Dimensions, Query.", - "type": "string", - "readOnly": true - }, - "operation": { - "description": "Operation type: Read, write, delete, etc.", - "type": "string", - "readOnly": true - } - } - } - } - }, - "ForecastDefinition": { - "description": "The definition of a forecast.", - "properties": { - "type": { - "description": "The type of the forecast.", - "type": "string", - "enum": [ - "Usage", - "ActualCost", - "AmortizedCost" - ], - "x-ms-enum": { - "name": "ForecastType", - "modelAsString": true - } - }, - "timeframe": { - "description": "The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.", - "type": "string", - "enum": [ - "MonthToDate", - "BillingMonthToDate", - "TheLastMonth", - "TheLastBillingMonth", - "WeekToDate", - "Custom" - ], - "x-ms-enum": { - "name": "ForecastTimeframeType", - "modelAsString": true - } - }, - "timePeriod": { - "description": "Has time period for pulling data for the forecast.", - "$ref": "#/definitions/QueryTimePeriod" - }, - "dataset": { - "description": "Has definition for data in this forecast.", - "$ref": "#/definitions/QueryDataset" - }, - "includeActualCost": { - "description": "a boolean determining if actualCost will be included", - "type": "boolean" - }, - "includeFreshPartialCost": { - "description": "a boolean determining if FreshPartialCost will be included", - "type": "boolean" - } - }, - "required": [ - "type", - "timeframe" - ] - }, - "QueryDefinition": { - "description": "The definition of a query.", - "properties": { - "type": { - "description": "The type of the query.", - "type": "string", - "enum": [ - "Usage", - "ActualCost", - "AmortizedCost" - ], - "x-ms-enum": { - "name": "ExportType", - "modelAsString": true - } - }, - "timeframe": { - "description": "The time frame for pulling data for the query. If custom, then a specific time period must be provided.", - "type": "string", - "enum": [ - "MonthToDate", - "BillingMonthToDate", - "TheLastMonth", - "TheLastBillingMonth", - "WeekToDate", - "Custom" - ], - "x-ms-enum": { - "name": "TimeframeType", - "modelAsString": true - } - }, - "timePeriod": { - "description": "Has time period for pulling data for the query.", - "$ref": "#/definitions/QueryTimePeriod" - }, - "dataset": { - "description": "Has definition for data in this query.", - "$ref": "#/definitions/QueryDataset" - } - }, - "required": [ - "type", - "timeframe" - ] - }, - "QueryTimePeriod": { - "description": "The start and end date for pulling data for the query.", - "properties": { - "from": { - "description": "The start date to pull data from.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date to pull data to.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from", - "to" - ] - }, - "QueryDataset": { - "description": "The definition of data present in the query.", - "properties": { - "granularity": { - "description": "The granularity of rows in the query.", - "type": "string", - "enum": [ - "Daily" - ], - "x-ms-enum": { - "name": "GranularityType", - "modelAsString": true - } - }, - "configuration": { - "description": "Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.", - "$ref": "#/definitions/QueryDatasetConfiguration" - }, - "aggregation": { - "type": "object", - "description": "Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.", - "additionalProperties": { - "type": "object", - "$ref": "#/definitions/QueryAggregation" - }, - "maxItems": 2 - }, - "grouping": { - "description": "Array of group by expression to use in the query. Query can have up to 2 group by clauses.", - "type": "array", - "items": { - "$ref": "#/definitions/QueryGrouping" - }, - "maxItems": 2 - }, - "filter": { - "type": "object", - "description": "Has filter expression to use in the query.", - "$ref": "#/definitions/QueryFilter" - } - } - }, - "QueryDatasetConfiguration": { - "description": "The configuration of dataset in the query.", - "properties": { - "columns": { - "description": "Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns.", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "QueryAggregation": { - "description": "The aggregation expression to be used in the query.", - "properties": { - "name": { - "description": "The name of the column to aggregate.", - "type": "string" - }, - "function": { - "description": "The name of the aggregation function to use.", - "type": "string", - "enum": [ - "Sum" - ], - "x-ms-enum": { - "name": "FunctionType", - "modelAsString": true - } - } - }, - "required": [ - "name", - "function" - ] - }, - "QueryGrouping": { - "description": "The group by expression to be used in the query.", - "properties": { - "type": { - "description": "Has type of the column to group.", - "$ref": "#/definitions/QueryColumnType" - }, - "name": { - "description": "The name of the column to group.", - "type": "string" - } - }, - "required": [ - "type", - "name" - ] - }, - "QueryFilter": { - "description": "The filter expression to be used in the export.", - "properties": { - "and": { - "description": "The logical \"AND\" expression. Must have at least 2 items.", - "type": "array", - "items": { - "$ref": "#/definitions/QueryFilter" - }, - "minItems": 2 - }, - "or": { - "description": "The logical \"OR\" expression. Must have at least 2 items.", - "type": "array", - "items": { - "$ref": "#/definitions/QueryFilter" - }, - "minItems": 2 - }, - "not": { - "description": "The logical \"NOT\" expression.", - "$ref": "#/definitions/QueryFilter" - }, - "dimension": { - "description": "Has comparison expression for a dimension", - "$ref": "#/definitions/QueryComparisonExpression" - }, - "tag": { - "description": "Has comparison expression for a tag", - "$ref": "#/definitions/QueryComparisonExpression" - } - } - }, - "QueryColumnType": { - "description": "The type of the column in the export.", - "type": "string", - "enum": [ - "Tag", - "Dimension" - ], - "x-ms-enum": { - "name": "QueryColumnType", - "modelAsString": true - } - }, - "QueryComparisonExpression": { - "description": "The comparison expression to be used in the query.", - "properties": { - "name": { - "description": "The name of the column to use in comparison.", - "type": "string" - }, - "operator": { - "description": "The operator to use for comparison.", - "type": "string", - "enum": [ - "In" - ], - "x-ms-enum": { - "name": "OperatorType", - "modelAsString": true - } - }, - "values": { - "description": "Array of values to use for comparison", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - }, - "required": [ - "name", - "operator", - "values" - ] - }, - "ExportListResult": { - "description": "Result of listing exports. It contains a list of available exports in the scope provided.", - "properties": { - "value": { - "description": "The list of exports.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/Export" - } - } - } - }, - "Export": { - "description": "A export resource.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExportProperties", - "title": "Export properties" - } - } - }, - "ExportProperties": { - "description": "The properties of the export.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/CommonExportProperties" - } - ], - "properties": { - "schedule": { - "description": "Has schedule information for the export.", - "$ref": "#/definitions/ExportSchedule" - } - } - }, - "CommonExportProperties": { - "description": "The common properties of the export.", - "properties": { - "format": { - "description": "The format of the export being delivered.", - "type": "string", - "enum": [ - "Csv" - ], - "x-ms-enum": { - "name": "FormatType", - "modelAsString": true - } - }, - "deliveryInfo": { - "description": "Has delivery information for the export.", - "$ref": "#/definitions/ExportDeliveryInfo" - }, - "definition": { - "description": "Has definition for the export.", - "$ref": "#/definitions/QueryDefinition" - } - }, - "required": [ - "deliveryInfo", - "definition" - ] - }, - "ExportSchedule": { - "description": "The schedule associated with a export.", - "properties": { - "status": { - "description": "The status of the schedule. Whether active or not. If inactive, the export's scheduled execution is paused.", - "type": "string", - "enum": [ - "Active", - "Inactive" - ], - "x-ms-enum": { - "name": "StatusType", - "modelAsString": true - } - }, - "recurrence": { - "description": "The schedule recurrence.", - "type": "string", - "enum": [ - "Daily", - "Weekly", - "Monthly", - "Annually" - ], - "x-ms-enum": { - "name": "RecurrenceType", - "modelAsString": true - } - }, - "recurrencePeriod": { - "description": "Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.", - "$ref": "#/definitions/ExportRecurrencePeriod" - } - }, - "required": [ - "recurrence" - ] - }, - "ExportDeliveryInfo": { - "description": "The delivery information associated with a export.", - "properties": { - "destination": { - "description": "Has destination for the export being delivered.", - "$ref": "#/definitions/ExportDeliveryDestination" - } - }, - "required": [ - "destination" - ] - }, - "ExportRecurrencePeriod": { - "description": "The start and end date for recurrence schedule.", - "properties": { - "from": { - "description": "The start date of recurrence.", - "type": "string", - "format": "date-time" - }, - "to": { - "description": "The end date of recurrence.", - "type": "string", - "format": "date-time" - } - }, - "required": [ - "from" - ] - }, - "ExportDeliveryDestination": { - "description": "The destination information for the delivery of the export. To allow access to a storage account, you must register the account's subscription with the Microsoft.CostManagementExports resource provider. This is required once per subscription. When creating an export in the Azure portal, it is done automatically, however API users need to register the subscription. For more information see https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .", - "properties": { - "resourceId": { - "description": "The resource id of the storage account where exports will be delivered.", - "type": "string" - }, - "container": { - "description": "The name of the container where exports will be uploaded.", - "type": "string" - }, - "rootFolderPath": { - "description": "The name of the directory where exports will be uploaded.", - "type": "string" - } - }, - "required": [ - "resourceId", - "container" - ] - }, - "ExportExecutionListResult": { - "description": "Result of listing exports execution history of a export by name", - "properties": { - "value": { - "description": "The list of export executions.", - "type": "array", - "readOnly": true, - "items": { - "$ref": "#/definitions/ExportExecution" - } - } - } - }, - "ExportExecution": { - "description": "A export execution.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExportExecutionProperties", - "title": "Export execution properties" - } - } - }, - "ExportExecutionProperties": { - "description": "The properties of the export execution.", - "properties": { - "executionType": { - "description": "The type of the export execution.", - "type": "string", - "enum": [ - "OnDemand", - "Scheduled" - ], - "x-ms-enum": { - "name": "ExecutionType", - "modelAsString": true - } - }, - "status": { - "description": "The status of the export execution.", - "type": "string", - "enum": [ - "Queued", - "InProgress", - "Completed", - "Failed", - "Timeout", - "NewDataNotAvailable", - "DataNotAvailable" - ], - "x-ms-enum": { - "name": "ExecutionStatus", - "modelAsString": true - } - }, - "submittedBy": { - "description": "The identifier for the entity that executed the export. For OnDemand executions, it is the email id. For Scheduled executions, it is the constant value - System.", - "type": "string" - }, - "submittedTime": { - "description": "The time when export was queued to be executed.", - "type": "string", - "format": "date-time" - }, - "processingStartTime": { - "description": "The time when export was picked up to be executed.", - "type": "string", - "format": "date-time" - }, - "processingEndTime": { - "description": "The time when export execution finished.", - "type": "string", - "format": "date-time" - }, - "fileName": { - "description": "The name of the file export got written to.", - "type": "string" - }, - "runSettings": { - "$ref": "#/definitions/CommonExportProperties" - } - } - } - }, - "parameters": { - "viewNameParameter": { - "name": "viewName", - "in": "path", - "description": "View name", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "scopeViewParameter": { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope.", - "x-ms-parameter-location": "method" - }, - "scopeDimensionParameter": { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope associated with dimension operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "scopeAlertParameter": { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope associated with alerts operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "scopeForecastParameter": { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope associated with forecast operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "scopeQueryParameter": { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope associated with query and export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, - "apiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Version of the API to be used with the client request. The current version is 2019-11-01." - }, - "subscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "description": "Azure Subscription ID.", - "required": true, - "type": "string" - }, - "resourceGroupNameParameter": { - "name": "resourceGroupName", - "in": "path", - "description": "Azure Resource Group Name.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "billingAccountIdParameter": { - "name": "billingAccountId", - "in": "path", - "description": "BillingAccount ID", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "managementGroupIdParameter": { - "name": "managementGroupId", - "in": "path", - "description": "ManagementGroup ID", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "departmentIdParameter": { - "name": "departmentId", - "in": "path", - "description": "Department ID", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "enrollmentAccountIdParameter": { - "name": "enrollmentAccountId", - "in": "path", - "description": "Enrollment Account ID", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "exportNameParameter": { - "name": "exportName", - "in": "path", - "description": "Export Name.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "externalCloudProviderTypeParameter": { - "name": "externalCloudProviderType", - "in": "path", - "required": true, - "type": "string", - "enum": [ - "externalSubscriptions", - "externalBillingAccounts" - ], - "x-ms-enum": { - "name": "externalCloudProviderType", - "modelAsString": true - }, - "description": "The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account.", - "x-ms-parameter-location": "method" - }, - "externalCloudProviderIdParameter": { - "name": "externalCloudProviderId", - "in": "path", - "required": true, - "type": "string", - "description": "This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.", - "x-ms-parameter-location": "method" - }, - "alertIdParameter": { - "name": "alertId", - "in": "path", - "description": "Alert ID", - "required": true, - "type": "string", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - } - } -} From 893f24e416d44c4412fd7857226f7369cc5227eb Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Mon, 6 Jul 2020 14:52:59 +0800 Subject: [PATCH 06/17] Fix the issue of format table of Get-AzCostmanagementExportExecuteHistory --- src/CostManagement/readme.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 2d67b2d857c6..3b2c2ae143ee 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -79,6 +79,14 @@ directive: subject: ByDimensionExternalCloudProviderType|CloudForecast|DismissAlert|Forecast verb: invoke remove: true + # - where: + # subject: ExportExecutionHistory + # verb: Get + # variant: GetViaIdentity + # remove: true + - from: source-file-csharp + where: $ + transform: $ = $.replace(/\/runHistory\$/g, "$"); - where: subject: Alert|AlertExternal|Dimension|View remove: true @@ -93,6 +101,17 @@ directive: - NextLink - Column - Row + - where: + model-name: ExportExecution + set: + format-table: + properties: + - ExecutionType + - ProcessingStartTime + - ProcessingEndTime + - RunSetting + - Status + - FileName - from: swagger-document where: $.definitions.AlertProperties.properties.details.properties.resourceGroupFilter.items transform: >- From 88cfab0fa6714065c5a80c3afbba027126e9e3ac Mon Sep 17 00:00:00 2001 From: LucasYao93 <53558334+LucasYao93@users.noreply.github.com> Date: Tue, 7 Jul 2020 10:32:45 +0800 Subject: [PATCH 07/17] Add test cases and examples of CostManagement. (#12325) * Add test cases and example of CostManagement. * Modified test cases and example of CostManagement. --- src/CostManagement/docs/Az.Cost.md | 49 ++ .../docs/Get-AzCostManagementExport.md | 164 ++++++ ...-AzCostManagementExportExecutionHistory.md | 151 ++++++ .../Invoke-AzCostManagementExecuteExport.md | 189 +++++++ .../docs/Invoke-AzCostManagementUsageQuery.md | 354 +++++++++++++ .../docs/New-AzCostManagementExport.md | 449 +++++++++++++++++ .../New-AzCostManagementQueryColumnObject.md | 81 +++ ...nagementQueryComparisonExpressionObject.md | 97 ++++ .../New-AzCostManagementQueryFilterObject.md | 183 +++++++ .../docs/Remove-AzCostManagementExport.md | 189 +++++++ .../docs/Update-AzCostManagementExport.md | 470 ++++++++++++++++++ src/CostManagement/docs/readme.md | 11 + .../examples/Get-AzCostManagementExport.md | 35 ++ ...-AzCostManagementExportExecutionHistory.md | 25 + .../Invoke-AzCostManagementExecuteExport.md | 17 + .../Invoke-AzCostManagementUsageQuery.md | 12 + .../examples/New-AzCostManagementExport.md | 37 ++ .../New-AzCostManagementQueryColumnObject.md | 12 + ...nagementQueryComparisonExpressionObject.md | 11 + .../New-AzCostManagementQueryFilterObject.md | 15 + .../examples/Remove-AzCostManagementExport.md | 17 + .../examples/Update-AzCostManagementExport.md | 18 + src/CostManagement/readme.md | 2 +- .../test/Az.Cost-TestResults.xml | 110 ++++ .../Get-AzCostManagementExport.Recording.json | 166 +++++++ .../test/Get-AzCostManagementExport.Tests.ps1 | 30 ++ ...ementExportExecutionHistory.Recording.json | 125 +++++ ...ManagementExportExecutionHistory.Tests.ps1 | 25 + ...CostManagementExecuteExport.Recording.json | 205 ++++++++ ...ke-AzCostManagementExecuteExport.Tests.ps1 | 27 + ...nvoke-AzCostManagementUsageQuery.Tests.ps1 | 20 + .../New-AzCostManagementExport.Recording.json | 187 +++++++ .../test/New-AzCostManagementExport.Tests.ps1 | 103 ++++ ...zCostManagementQueryColumnObject.Tests.ps1 | 18 + ...tQueryComparisonExpressionObject.Tests.ps1 | 20 + ...zCostManagementQueryFilterObject.Tests.ps1 | 26 + ...move-AzCostManagementExport.Recording.json | 205 ++++++++ .../Remove-AzCostManagementExport.Tests.ps1 | 27 + .../Update-AzCostManagementExport.Tests.ps1 | 29 ++ .../storage-account/parameters.json | 7 + .../storage-account/template.json | 96 ++++ src/CostManagement/test/env.json | 17 + src/CostManagement/test/loadEnv.ps1 | 28 ++ src/CostManagement/test/readme.md | 17 + src/CostManagement/test/test-script.ps1 | 91 ++++ src/CostManagement/test/utils.ps1 | 93 ++++ 46 files changed, 4259 insertions(+), 1 deletion(-) create mode 100644 src/CostManagement/docs/Az.Cost.md create mode 100644 src/CostManagement/docs/Get-AzCostManagementExport.md create mode 100644 src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md create mode 100644 src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md create mode 100644 src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md create mode 100644 src/CostManagement/docs/New-AzCostManagementExport.md create mode 100644 src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md create mode 100644 src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md create mode 100644 src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md create mode 100644 src/CostManagement/docs/Remove-AzCostManagementExport.md create mode 100644 src/CostManagement/docs/Update-AzCostManagementExport.md create mode 100644 src/CostManagement/docs/readme.md create mode 100644 src/CostManagement/examples/Get-AzCostManagementExport.md create mode 100644 src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md create mode 100644 src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md create mode 100644 src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md create mode 100644 src/CostManagement/examples/New-AzCostManagementExport.md create mode 100644 src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md create mode 100644 src/CostManagement/examples/New-AzCostManagementQueryComparisonExpressionObject.md create mode 100644 src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md create mode 100644 src/CostManagement/examples/Remove-AzCostManagementExport.md create mode 100644 src/CostManagement/examples/Update-AzCostManagementExport.md create mode 100644 src/CostManagement/test/Az.Cost-TestResults.xml create mode 100644 src/CostManagement/test/Get-AzCostManagementExport.Recording.json create mode 100644 src/CostManagement/test/Get-AzCostManagementExport.Tests.ps1 create mode 100644 src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json create mode 100644 src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 create mode 100644 src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json create mode 100644 src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 create mode 100644 src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 create mode 100644 src/CostManagement/test/New-AzCostManagementExport.Recording.json create mode 100644 src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 create mode 100644 src/CostManagement/test/New-AzCostManagementQueryColumnObject.Tests.ps1 create mode 100644 src/CostManagement/test/New-AzCostManagementQueryComparisonExpressionObject.Tests.ps1 create mode 100644 src/CostManagement/test/New-AzCostManagementQueryFilterObject.Tests.ps1 create mode 100644 src/CostManagement/test/Remove-AzCostManagementExport.Recording.json create mode 100644 src/CostManagement/test/Remove-AzCostManagementExport.Tests.ps1 create mode 100644 src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 create mode 100644 src/CostManagement/test/deployment-templates/storage-account/parameters.json create mode 100644 src/CostManagement/test/deployment-templates/storage-account/template.json create mode 100644 src/CostManagement/test/env.json create mode 100644 src/CostManagement/test/loadEnv.ps1 create mode 100644 src/CostManagement/test/readme.md create mode 100644 src/CostManagement/test/test-script.ps1 create mode 100644 src/CostManagement/test/utils.ps1 diff --git a/src/CostManagement/docs/Az.Cost.md b/src/CostManagement/docs/Az.Cost.md new file mode 100644 index 000000000000..5b86051ab1b9 --- /dev/null +++ b/src/CostManagement/docs/Az.Cost.md @@ -0,0 +1,49 @@ +--- +Module Name: Az.Cost +Module Guid: e68ffeab-c2c5-4869-9306-c48c496e0cfd +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.cost +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.Cost Module +## Description +Microsoft Azure PowerShell: Cost cmdlets + +## Az.Cost Cmdlets +### [Get-AzCostManagementExport](Get-AzCostManagementExport.md) +The operation to get the export for the defined scope by export name. + +### [Get-AzCostManagementExportExecutionHistory](Get-AzCostManagementExportExecutionHistory.md) +The operation to get the execution history of an export for the defined scope by export name. + +### [Invoke-AzCostManagementExecuteExport](Invoke-AzCostManagementExecuteExport.md) +The operation to execute a export. + +### [Invoke-AzCostManagementUsageQuery](Invoke-AzCostManagementUsageQuery.md) +Query the usage data for scope defined. + +### [New-AzCostManagementExport](New-AzCostManagementExport.md) +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. + +### [New-AzCostManagementQueryColumnObject](New-AzCostManagementQueryColumnObject.md) +Create a in-memory object for QueryColumn + +### [New-AzCostManagementQueryComparisonExpressionObject](New-AzCostManagementQueryComparisonExpressionObject.md) +Create a in-memory object for QueryComparisonExpression + +### [New-AzCostManagementQueryFilterObject](New-AzCostManagementQueryFilterObject.md) +Create a in-memory object for QueryFilter + +### [Remove-AzCostManagementExport](Remove-AzCostManagementExport.md) +The operation to delete a export. + +### [Update-AzCostManagementExport](Update-AzCostManagementExport.md) +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. + diff --git a/src/CostManagement/docs/Get-AzCostManagementExport.md b/src/CostManagement/docs/Get-AzCostManagementExport.md new file mode 100644 index 000000000000..62d9443ac1da --- /dev/null +++ b/src/CostManagement/docs/Get-AzCostManagementExport.md @@ -0,0 +1,164 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostmanagementexport +schema: 2.0.0 +--- + +# Get-AzCostManagementExport + +## SYNOPSIS +The operation to get the export for the defined scope by export name. + +## SYNTAX + +### List (Default) +``` +Get-AzCostManagementExport -Scope [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzCostManagementExport -Name -Scope [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzCostManagementExport -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +The operation to get the export for the defined scope by export name. + +## EXAMPLES + +### Example 1: Get all cost management exports under a subscription +```powershell +PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" + +Name Type +---- ---- +TestExport Microsoft.CostManagement/exports +TestExport1 Microsoft.CostManagement/exports +``` + +this command gets all cost management exports under a subscription. + +### Example 2: Get a cost management export by name +```powershell +PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' + +Name Type +---- ---- +TestExport Microsoft.CostManagement/exports +``` + +This command gets a cost management export by name. + +### Example 3: Get a cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' +PS C:\> Get-AzCostManagementExport -InputObject $export + +Name Type +---- ---- +TestExport Microsoft.CostManagement/exports +``` + +This command gets a cost management export by object. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExport + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AlertId ]`: Alert ID + - `[ExportName ]`: Export Name. + - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + - `[Id ]`: Resource identity path + - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md new file mode 100644 index 000000000000..bc7a61e0105a --- /dev/null +++ b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md @@ -0,0 +1,151 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostmanagementexportexecutionhistory +schema: 2.0.0 +--- + +# Get-AzCostManagementExportExecutionHistory + +## SYNOPSIS +The operation to get the execution history of an export for the defined scope by export name. + +## SYNTAX + +### Get (Default) +``` +Get-AzCostManagementExportExecutionHistory -ExportName -Scope [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzCostManagementExportExecutionHistory -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +The operation to get the execution history of an export for the defined scope by export name. + +## EXAMPLES + +### Example 1: Get execution history of cost management export +```powershell +PS C:\> Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" + +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv +Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +``` + +This command gets execution history of cost management export. + +### Example 2: Get execution history of cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" +PS C:\> $export | Get-AzCostManagementExportExecutionHistory -InputObject $export + +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv +Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +``` + +This command gets execution history of cost management export by object. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportName +Export Name. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExportExecution + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AlertId ]`: Alert ID + - `[ExportName ]`: Export Name. + - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + - `[Id ]`: Resource identity path + - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md new file mode 100644 index 000000000000..4292ec7cd0af --- /dev/null +++ b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md @@ -0,0 +1,189 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementexecuteexport +schema: 2.0.0 +--- + +# Invoke-AzCostManagementExecuteExport + +## SYNOPSIS +The operation to execute a export. + +## SYNTAX + +### Execute (Default) +``` +Invoke-AzCostManagementExecuteExport -ExportName -Scope [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ExecuteViaIdentity +``` +Invoke-AzCostManagementExecuteExport -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The operation to execute a export. + +## EXAMPLES + +### Example 1: Invoke a cost mangement export by name +```powershell +PS C:\> Invoke-AzCostManagementExecuteExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' + +``` + +This command invokes a cost mangement export by name. + +### Example 2: Invoke a cost mangement export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' +PS C:\> Invoke-AzCostManagementExecuteExport -InputObject $export + +``` + +This command invokes a cost mangement export by object. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExportName +Export Name. + +```yaml +Type: System.String +Parameter Sets: Execute +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: ExecuteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Execute +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AlertId ]`: Alert ID + - `[ExportName ]`: Export Name. + - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + - `[Id ]`: Resource identity path + - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md b/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md new file mode 100644 index 000000000000..5d5d41a614d2 --- /dev/null +++ b/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md @@ -0,0 +1,354 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery +schema: 2.0.0 +--- + +# Invoke-AzCostManagementUsageQuery + +## SYNOPSIS +Query the usage data for scope defined. + +## SYNTAX + +### UsageExpanded (Default) +``` +Invoke-AzCostManagementUsageQuery -Scope -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] + [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UsageExpanded1 +``` +Invoke-AzCostManagementUsageQuery -ExternalCloudProviderId + -ExternalCloudProviderType -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] + [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UsageViaIdentityExpanded +``` +Invoke-AzCostManagementUsageQuery -InputObject -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] + [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UsageViaIdentityExpanded1 +``` +Invoke-AzCostManagementUsageQuery -InputObject -Timeframe -Type + [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] + [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Query the usage data for scope defined. + +## EXAMPLES + +### Example 1: Invoke query usage of the cost management export +```powershell +PS C:\> Invoke-AzCostManagementUsageQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'daily' + +NextLink Column Row +-------- ------ --- + {UsageDate, Currency} {20200701 USD, 20200702 USD, 20200703 USD, 20200704 USD…} +``` + +this command invokes query usage of the cost management export. + +## PARAMETERS + +### -ConfigurationColumn +Array of column names to be included in the query. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetAggregation +Dictionary of aggregation expression to use in the query. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetFilter +Has filter expression to use in the query. +To construct, see NOTES section for DATASETFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGranularity +The granularity of rows in the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGrouping +Array of group by expression to use in the query. +To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderId +This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + +```yaml +Type: System.String +Parameter Sets: UsageExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExternalCloudProviderType +The external cloud provider type associated with dimension/query operations. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType +Parameter Sets: UsageExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: UsageViaIdentityExpanded, UsageViaIdentityExpanded1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. + +```yaml +Type: System.String +Parameter Sets: UsageExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Timeframe +The time frame for pulling data for the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date to pull data from. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date to pull data to. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The type of the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +DATASETFILTER : Has filter expression to use in the query. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[Dimension ]`: Has comparison expression for a dimension + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + - `[Not ]`: The logical "NOT" expression. + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[Tag ]`: Has comparison expression for a tag + +DATASETGROUPING : Array of group by expression to use in the query. + - `Name `: The name of the column to group. + - `Type `: Has type of the column to group. + +INPUTOBJECT : Identity Parameter + - `[AlertId ]`: Alert ID + - `[ExportName ]`: Export Name. + - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + - `[Id ]`: Resource identity path + - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/src/CostManagement/docs/New-AzCostManagementExport.md b/src/CostManagement/docs/New-AzCostManagementExport.md new file mode 100644 index 000000000000..bd0157d8f473 --- /dev/null +++ b/src/CostManagement/docs/New-AzCostManagementExport.md @@ -0,0 +1,449 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostmanagementexport +schema: 2.0.0 +--- + +# New-AzCostManagementExport + +## SYNOPSIS +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. + +## SYNTAX + +``` +New-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] + [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] + [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. + +## EXAMPLES + +### Example 1: Create a cost management export for a subscription +```powershell +PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3388-4e19-88eb-0975f02ac87f" -Name costexport-test -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom (Get-Date).ToString() -RecurrencePeriodTo (Get-Date).AddDays(20).ToString() -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" + +Name Type +---- ---- +costexport-test Microsoft.CostManagement/exports +``` + +This command creates a cost management export for the resource group for a subscription. + +### Example 2: Create a cost management export with custom column for the resource group +```powershell +PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') + +Name Type +---- ---- +ps-customcolum-t Microsoft.CostManagement/exports +``` + +This command creates a cost management export with custom column for the resource group. + +### Example 3: Create a cost management export with custom column for the resource group +```powershell +PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') + +Name Type +---- ---- +ps-customcolum-t Microsoft.CostManagement/exports +``` + +This command creates a cost management export with custom column for the resource group. + +## PARAMETERS + +### -ConfigurationColumn +Array of column names to be included in the query. +Any valid query column name is allowed. +If not provided, then query includes all columns. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetAggregation +Dictionary of aggregation expression to use in the query. +The key of each item in the dictionary is the alias for the aggregated column. +Query can have up to 2 aggregation clauses. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetFilter +Has filter expression to use in the query. +To construct, see NOTES section for DATASETFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGranularity +The granularity of rows in the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGrouping +Array of group by expression to use in the query. +Query can have up to 2 group by clauses. +To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionTimeframe +The time frame for pulling data for the query. +If custom, then a specific time period must be provided. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionType +The type of the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationContainer +The name of the container where exports will be uploaded. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationResourceId +The resource id of the storage account where exports will be delivered. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationRootFolderPath +The name of the directory where exports will be uploaded. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Format +The format of the export being delivered. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecurrencePeriodFrom +The start date of recurrence. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecurrencePeriodTo +The end date of recurrence. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleRecurrence +The schedule recurrence. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleStatus +The status of the schedule. +Whether active or not. +If inactive, the export's scheduled execution is paused. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date to pull data from. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date to pull data to. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExport + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +DATASETFILTER : Has filter expression to use in the query. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[Dimension ]`: Has comparison expression for a dimension + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + - `[Not ]`: The logical "NOT" expression. + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[Tag ]`: Has comparison expression for a tag + +DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. + - `Name `: The name of the column to group. + - `Type `: Has type of the column to group. + +## RELATED LINKS + diff --git a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md new file mode 100644 index 000000000000..8e945d1febd0 --- /dev/null +++ b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md @@ -0,0 +1,81 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject +schema: 2.0.0 +--- + +# New-AzCostManagementQueryColumnObject + +## SYNOPSIS +Create a in-memory object for QueryColumn + +## SYNTAX + +``` +New-AzCostManagementQueryColumnObject [-Name ] [-Type ] [] +``` + +## DESCRIPTION +Create a in-memory object for QueryColumn + +## EXAMPLES + +### Example 1: Create a column object of query for cost management export +```powershell +PS C:\> New-AzCostManagementQueryColumnObject -Name 'SubscriptionGuid' -Type 'string' + +Name Type +---- ---- +SubscriptionGuid string +``` + +This command creates a column object of query for cost management export. + +## PARAMETERS + +### -Name +The name of column. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +The type of column. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md b/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md new file mode 100644 index 000000000000..8c5fdaa4dcaf --- /dev/null +++ b/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md @@ -0,0 +1,97 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject +schema: 2.0.0 +--- + +# New-AzCostManagementQueryComparisonExpressionObject + +## SYNOPSIS +Create a in-memory object for QueryComparisonExpression + +## SYNTAX + +``` +New-AzCostManagementQueryComparisonExpressionObject -Name -Operator -Value + [] +``` + +## DESCRIPTION +Create a in-memory object for QueryComparisonExpression + +## EXAMPLES + +### Example 1: Create a comparison expression object of query for cost management export +```powershell +PS C:\> New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') + +Name Operator Value +---- -------- ----- +ResourceLocation In {East US, West Europe} +``` + +This command creates a comparison expression object of query for cost management export. + +## PARAMETERS + +### -Name +The name of the column to use in comparison. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Operator +The operator to use for comparison. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Value +Array of values to use for comparison. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md new file mode 100644 index 000000000000..155f6a51c902 --- /dev/null +++ b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md @@ -0,0 +1,183 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject +schema: 2.0.0 +--- + +# New-AzCostManagementQueryFilterObject + +## SYNOPSIS +Create a in-memory object for QueryFilter + +## SYNTAX + +``` +New-AzCostManagementQueryFilterObject [-And ] [-Dimension ] + [-Not ] [-Or ] [-Tag ] [] +``` + +## DESCRIPTION +Create a in-memory object for QueryFilter + +## EXAMPLES + +### Example 1: Create a filter object of query for cost management export +```powershell +PS C:\> $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') +PS C:\> $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') +PS C:\> New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) + +And : +Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +Not : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter +Or : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter} +Tag : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +``` + +this command creates a filter object of query for cost management export. + +## PARAMETERS + +### -And +The logical "AND" expression. +Must have at least 2 items. +To construct, see NOTES section for AND properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Dimension +Has comparison expression for a dimension. +To construct, see NOTES section for DIMENSION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Not +The logical "NOT" expression. +To construct, see NOTES section for NOT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Or +The logical "OR" expression. +Must have at least 2 items. +To construct, see NOTES section for OR properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Has comparison expression for a tag. +To construct, see NOTES section for TAG properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +AND : The logical "AND" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[Dimension ]`: Has comparison expression for a dimension + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + - `[Not ]`: The logical "NOT" expression. + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[Tag ]`: Has comparison expression for a tag + +DIMENSION : Has comparison expression for a dimension. + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + +NOT : The logical "NOT" expression. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[Dimension ]`: Has comparison expression for a dimension + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + - `[Not ]`: The logical "NOT" expression. + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[Tag ]`: Has comparison expression for a tag + +OR : The logical "OR" expression. Must have at least 2 items. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[Dimension ]`: Has comparison expression for a dimension + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + - `[Not ]`: The logical "NOT" expression. + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[Tag ]`: Has comparison expression for a tag + +TAG : Has comparison expression for a tag. + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + +## RELATED LINKS + diff --git a/src/CostManagement/docs/Remove-AzCostManagementExport.md b/src/CostManagement/docs/Remove-AzCostManagementExport.md new file mode 100644 index 000000000000..4fa7d6859e00 --- /dev/null +++ b/src/CostManagement/docs/Remove-AzCostManagementExport.md @@ -0,0 +1,189 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostmanagementexport +schema: 2.0.0 +--- + +# Remove-AzCostManagementExport + +## SYNOPSIS +The operation to delete a export. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzCostManagementExport -Name -Scope [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzCostManagementExport -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +The operation to delete a export. + +## EXAMPLES + +### Example 1: Remove a cost management export by name +```powershell +PS C:\> Remove-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T01 + +``` + +This command removes a cost management export by name + +### Example 2: Remove a cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T02 +PS C:\> Remove-AzCostManagementExport -InputObject $export + +``` + +This command removes a cost management export by object + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +INPUTOBJECT : Identity Parameter + - `[AlertId ]`: Alert ID + - `[ExportName ]`: Export Name. + - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + - `[Id ]`: Resource identity path + - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/src/CostManagement/docs/Update-AzCostManagementExport.md b/src/CostManagement/docs/Update-AzCostManagementExport.md new file mode 100644 index 000000000000..a070d66d45c3 --- /dev/null +++ b/src/CostManagement/docs/Update-AzCostManagementExport.md @@ -0,0 +1,470 @@ +--- +external help file: +Module Name: Az.Cost +online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/update-azcostmanagementexport +schema: 2.0.0 +--- + +# Update-AzCostManagementExport + +## SYNOPSIS +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] + [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] + [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzCostManagementExport -InputObject [-ConfigurationColumn ] + [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] + [-DatasetGrouping ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] + [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] + [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. + +## EXAMPLES + +### Example 1: Update a cost management export by name +```powershell +PS C:\> Update-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t -RecurrencePeriodFrom (Get-Date).ToString() + +``` + +This command updates a cost management export by name. + +### Example 2: Update a cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t +PS C:\> Update-AzCostManagementExport -InputObject $export -RecurrencePeriodFrom (Get-Date).ToString() + +{{ Add output here }} +``` + +This command updates a cost management export by object. + +## PARAMETERS + +### -ConfigurationColumn +Array of column names to be included in the query. +Any valid query column name is allowed. +If not provided, then query includes all columns. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetAggregation +Dictionary of aggregation expression to use in the query. +The key of each item in the dictionary is the alias for the aggregated column. +Query can have up to 2 aggregation clauses. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetFilter +Has filter expression to use in the query. +To construct, see NOTES section for DATASETFILTER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGranularity +The granularity of rows in the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DatasetGrouping +Array of group by expression to use in the query. +Query can have up to 2 group by clauses. +To construct, see NOTES section for DATASETGROUPING properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionTimeframe +The time frame for pulling data for the query. +If custom, then a specific time period must be provided. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefinitionType +The type of the query. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationContainer +The name of the container where exports will be uploaded. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationResourceId +The resource id of the storage account where exports will be delivered. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationRootFolderPath +The name of the directory where exports will be uploaded. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Format +The format of the export being delivered. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Export Name. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: ExportName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecurrencePeriodFrom +The start date of recurrence. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RecurrencePeriodTo +The end date of recurrence. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleRecurrence +The schedule recurrence. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ScheduleStatus +The status of the schedule. +Whether active or not. +If inactive, the export's scheduled execution is paused. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +The scope associated with query and export operations. +This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodFrom +The start date to pull data from. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimePeriodTo +The end date to pull data to. + +```yaml +Type: System.DateTime +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExport + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +DATASETFILTER : Has filter expression to use in the query. + - `[And ]`: The logical "AND" expression. Must have at least 2 items. + - `[Dimension ]`: Has comparison expression for a dimension + - `Name `: The name of the column to use in comparison. + - `Operator `: The operator to use for comparison. + - `Value `: Array of values to use for comparison + - `[Not ]`: The logical "NOT" expression. + - `[Or ]`: The logical "OR" expression. Must have at least 2 items. + - `[Tag ]`: Has comparison expression for a tag + +DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. + - `Name `: The name of the column to group. + - `Type `: Has type of the column to group. + +INPUTOBJECT : Identity Parameter + - `[AlertId ]`: Alert ID + - `[ExportName ]`: Export Name. + - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + - `[Id ]`: Resource identity path + - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + - `[ViewName ]`: View name + +## RELATED LINKS + diff --git a/src/CostManagement/docs/readme.md b/src/CostManagement/docs/readme.md new file mode 100644 index 000000000000..f4b0a6692c57 --- /dev/null +++ b/src/CostManagement/docs/readme.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.Cost` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.Cost` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/src/CostManagement/examples/Get-AzCostManagementExport.md b/src/CostManagement/examples/Get-AzCostManagementExport.md new file mode 100644 index 000000000000..9284c2af98bc --- /dev/null +++ b/src/CostManagement/examples/Get-AzCostManagementExport.md @@ -0,0 +1,35 @@ +### Example 1: Get all cost management exports under a subscription +```powershell +PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" + +Name Type +---- ---- +TestExport Microsoft.CostManagement/exports +TestExport1 Microsoft.CostManagement/exports +``` + +this command gets all cost management exports under a subscription. + +### Example 2: Get a cost management export by name +```powershell +PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' + +Name Type +---- ---- +TestExport Microsoft.CostManagement/exports +``` + +This command gets a cost management export by name. + +### Example 3: Get a cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' +PS C:\> Get-AzCostManagementExport -InputObject $export + +Name Type +---- ---- +TestExport Microsoft.CostManagement/exports +``` + +This command gets a cost management export by object. + diff --git a/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md new file mode 100644 index 000000000000..ac37f614271f --- /dev/null +++ b/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md @@ -0,0 +1,25 @@ +### Example 1: Get execution history of cost management export +```powershell +PS C:\> Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" + +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv +Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +``` + +This command gets execution history of cost management export. + +### Example 2: Get execution history of cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" +PS C:\> $export | Get-AzCostManagementExportExecutionHistory -InputObject $export + +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv +Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +``` + +This command gets execution history of cost management export by object. + diff --git a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md new file mode 100644 index 000000000000..098474f3093f --- /dev/null +++ b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md @@ -0,0 +1,17 @@ +### Example 1: Invoke a cost mangement export by name +```powershell +PS C:\> Invoke-AzCostManagementExecuteExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' + +``` + +This command invokes a cost mangement export by name. + +### Example 2: Invoke a cost mangement export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' +PS C:\> Invoke-AzCostManagementExecuteExport -InputObject $export + +``` + +This command invokes a cost mangement export by object. + diff --git a/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md b/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md new file mode 100644 index 000000000000..5ec9865f3c8c --- /dev/null +++ b/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md @@ -0,0 +1,12 @@ +### Example 1: Invoke query usage of the cost management export +```powershell +PS C:\> Invoke-AzCostManagementUsageQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'daily' + +NextLink Column Row +-------- ------ --- + {UsageDate, Currency} {20200701 USD, 20200702 USD, 20200703 USD, 20200704 USD…} +``` + +this command invokes query usage of the cost management export. + + diff --git a/src/CostManagement/examples/New-AzCostManagementExport.md b/src/CostManagement/examples/New-AzCostManagementExport.md new file mode 100644 index 000000000000..17fbb44a71e2 --- /dev/null +++ b/src/CostManagement/examples/New-AzCostManagementExport.md @@ -0,0 +1,37 @@ +### Example 1: Create a cost management export for a subscription +```powershell +PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3388-4e19-88eb-0975f02ac87f" -Name costexport-test -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom (Get-Date).ToString() -RecurrencePeriodTo (Get-Date).AddDays(20).ToString() -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" + +Name Type +---- ---- +costexport-test Microsoft.CostManagement/exports +``` + +This command creates a cost management export for the resource group for a subscription. + +### Example 2: Create a cost management export with custom column for the resource group +```powershell +PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') + +Name Type +---- ---- +ps-customcolum-t Microsoft.CostManagement/exports +``` + +This command creates a cost management export with custom column for the resource group. + +### Example 3: Create a cost management export with custom column for the resource group +```powershell +PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" +PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') + +Name Type +---- ---- +ps-customcolum-t Microsoft.CostManagement/exports +``` + +This command creates a cost management export with custom column for the resource group. + + diff --git a/src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md b/src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md new file mode 100644 index 000000000000..a043890b74ba --- /dev/null +++ b/src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md @@ -0,0 +1,12 @@ +### Example 1: Create a column object of query for cost management export +```powershell +PS C:\> New-AzCostManagementQueryColumnObject -Name 'SubscriptionGuid' -Type 'string' + +Name Type +---- ---- +SubscriptionGuid string +``` + +This command creates a column object of query for cost management export. + + diff --git a/src/CostManagement/examples/New-AzCostManagementQueryComparisonExpressionObject.md b/src/CostManagement/examples/New-AzCostManagementQueryComparisonExpressionObject.md new file mode 100644 index 000000000000..89f150db32d7 --- /dev/null +++ b/src/CostManagement/examples/New-AzCostManagementQueryComparisonExpressionObject.md @@ -0,0 +1,11 @@ +### Example 1: Create a comparison expression object of query for cost management export +```powershell +PS C:\> New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') + +Name Operator Value +---- -------- ----- +ResourceLocation In {East US, West Europe} +``` + +This command creates a comparison expression object of query for cost management export. + diff --git a/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md new file mode 100644 index 000000000000..7529b75a1502 --- /dev/null +++ b/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md @@ -0,0 +1,15 @@ +### Example 1: Create a filter object of query for cost management export +```powershell +PS C:\> $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') +PS C:\> $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') +PS C:\> New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) + +And : +Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +Not : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter +Or : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter} +Tag : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +``` + +this command creates a filter object of query for cost management export. + diff --git a/src/CostManagement/examples/Remove-AzCostManagementExport.md b/src/CostManagement/examples/Remove-AzCostManagementExport.md new file mode 100644 index 000000000000..659951472332 --- /dev/null +++ b/src/CostManagement/examples/Remove-AzCostManagementExport.md @@ -0,0 +1,17 @@ +### Example 1: Remove a cost management export by name +```powershell +PS C:\> Remove-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T01 + +``` + +This command removes a cost management export by name + +### Example 2: Remove a cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T02 +PS C:\> Remove-AzCostManagementExport -InputObject $export + +``` + +This command removes a cost management export by object + diff --git a/src/CostManagement/examples/Update-AzCostManagementExport.md b/src/CostManagement/examples/Update-AzCostManagementExport.md new file mode 100644 index 000000000000..c9c388d50cb2 --- /dev/null +++ b/src/CostManagement/examples/Update-AzCostManagementExport.md @@ -0,0 +1,18 @@ +### Example 1: Update a cost management export by name +```powershell +PS C:\> Update-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t -RecurrencePeriodFrom (Get-Date).ToString() + +``` + +This command updates a cost management export by name. + +### Example 2: Update a cost management export by object +```powershell +PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t +PS C:\> Update-AzCostManagementExport -InputObject $export -RecurrencePeriodFrom (Get-Date).ToString() + +{{ Add output here }} +``` + +This command updates a cost management export by object. + diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 3b2c2ae143ee..99b8c111a0ff 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -140,4 +140,4 @@ directive: - no-inline: - QueryFilter - ReportConfigFilter -``` +``` \ No newline at end of file diff --git a/src/CostManagement/test/Az.Cost-TestResults.xml b/src/CostManagement/test/Az.Cost-TestResults.xml new file mode 100644 index 000000000000..f4779bc6f02e --- /dev/null +++ b/src/CostManagement/test/Az.Cost-TestResults.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/CostManagement/test/Get-AzCostManagementExport.Recording.json b/src/CostManagement/test/Get-AzCostManagementExport.Recording.json new file mode 100644 index 000000000000..8c587b73557f --- /dev/null +++ b/src/CostManagement/test/Get-AzCostManagementExport.Recording.json @@ -0,0 +1,166 @@ +{ + "Get-AzCostManagementExport+[NoContext]+List+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "1" ], + "x-ms-client-request-id": [ "a3d1a493-26a8-4a52-8208-0fbd285d32a1" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "7a79246a-3f52-44f2-b629-21dfcd3cac72" ], + "x-ms-request-id": [ "c1a1f8d5-2748-4024-89cf-e4736e709d25" ], + "x-ms-correlation-request-id": [ "a0cfd64c-b052-4ecf-b529-07ff98840e55" ], + "x-ms-client-request-id": [ "a3d1a493-26a8-4a52-8208-0fbd285d32a1" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091501Z:a0cfd64c-b052-4ecf-b529-07ff98840e55" ], + "Date": [ "Mon, 06 Jul 2020 09:15:00 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "23920" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport4\",\"name\":\"TestExport4\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6425d3647\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport5\",\"name\":\"TestExport5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f679d78775\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport6\",\"name\":\"TestExport6\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6b27ba29f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation\",\"name\":\"TestExportDatasetAggregation\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650e17ad92f21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}]}" + } + }, + "Get-AzCostManagementExport+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "2" ], + "x-ms-client-request-id": [ "764cecf8-d98d-4ec0-97f6-26f2ed2bebb2" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "0ed6173b-7d65-4e2d-a50b-c68b9d5c6b8a" ], + "x-ms-request-id": [ "6a46d3c5-3839-43e3-a42e-309883d8ea6b" ], + "x-ms-correlation-request-id": [ "b10cd0f3-c0b3-4d83-aed6-0af45e8b9961" ], + "x-ms-client-request-id": [ "764cecf8-d98d-4ec0-97f6-26f2ed2bebb2" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091503Z:b10cd0f3-c0b3-4d83-aed6-0af45e8b9961" ], + "Date": [ "Mon, 06 Jul 2020 09:15:02 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "709" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Get-AzCostManagementExport+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "84680f60-2b7d-411b-aae4-9259983e57a8" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "7ac3047f-40ca-4cd3-9cdc-6ffc61f15623" ], + "x-ms-request-id": [ "b3158243-14b4-4ad5-bd11-4f2f015e5859" ], + "x-ms-correlation-request-id": [ "c279ea92-0d72-4f55-af84-7ac1393d4c92" ], + "x-ms-client-request-id": [ "84680f60-2b7d-411b-aae4-9259983e57a8" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091504Z:c279ea92-0d72-4f55-af84-7ac1393d4c92" ], + "Date": [ "Mon, 06 Jul 2020 09:15:03 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "709" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Get-AzCostManagementExport+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "4" ], + "x-ms-client-request-id": [ "c9dc70b6-2123-4d49-ad74-65c31c6cfd5d" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_GetViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "14e26877-5709-4eb2-a05e-96ae71a99999" ], + "x-ms-request-id": [ "dc595b73-e14b-453b-b549-6d9a27d3e103" ], + "x-ms-correlation-request-id": [ "f3b4f70c-c7c4-4fa2-b30d-63347d4aa542" ], + "x-ms-client-request-id": [ "c9dc70b6-2123-4d49-ad74-65c31c6cfd5d" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091505Z:f3b4f70c-c7c4-4fa2-b30d-63347d4aa542" ], + "Date": [ "Mon, 06 Jul 2020 09:15:04 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "709" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + } +} \ No newline at end of file diff --git a/src/CostManagement/test/Get-AzCostManagementExport.Tests.ps1 b/src/CostManagement/test/Get-AzCostManagementExport.Tests.ps1 new file mode 100644 index 000000000000..2940b9cb4076 --- /dev/null +++ b/src/CostManagement/test/Get-AzCostManagementExport.Tests.ps1 @@ -0,0 +1,30 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostManagementExport.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzCostManagementExport' { + It 'List' { + $exportList = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" + $exportList.Count | Should -BeGreaterOrEqual 1 + } + + It 'Get' { + $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 + $export.Name | Should -Be $env.exportName01 + } + + It 'GetViaIdentity' { + $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 + $export = Get-AzCostManagementExport -InputObject $export + $export.Name | Should -Be $env.exportName01 + } +} diff --git a/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json new file mode 100644 index 000000000000..ce6954d8300c --- /dev/null +++ b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json @@ -0,0 +1,125 @@ +{ + "Get-AzCostManagementExportExecutionHistory+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "1" ], + "x-ms-client-request-id": [ "2a0a5bf2-9b76-420d-a8ea-9d9699448e89" ], + "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], + "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "f6325027-63a8-44da-bac4-eb3b1fc4edaa" ], + "x-ms-request-id": [ "e93206c3-a347-431f-baf8-a4322f8f77c4" ], + "x-ms-correlation-request-id": [ "b98e6547-5487-444d-9ffb-f603326e2313" ], + "x-ms-client-request-id": [ "2a0a5bf2-9b76-420d-a8ea-9d9699448e89" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091524Z:b98e6547-5487-444d-9ffb-f603326e2313" ], + "Date": [ "Mon, 06 Jul 2020 09:15:24 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "934" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}}]}" + } + }, + "Get-AzCostManagementExportExecutionHistory+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "2" ], + "x-ms-client-request-id": [ "d22920aa-bfa5-4531-b17e-7e6005a2fb7a" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "0709d528-7606-42af-b2d3-b17281e8b216" ], + "x-ms-request-id": [ "8c702ba6-09bc-4620-b7e0-1a602ef61a00" ], + "x-ms-correlation-request-id": [ "a37c5acd-2082-43e9-bd8c-e0dadb5dd53f" ], + "x-ms-client-request-id": [ "d22920aa-bfa5-4531-b17e-7e6005a2fb7a" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091526Z:a37c5acd-2082-43e9-bd8c-e0dadb5dd53f" ], + "Date": [ "Mon, 06 Jul 2020 09:15:26 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "709" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Get-AzCostManagementExportExecutionHistory+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "8e58532d-a286-4a8c-a0b1-b0d4c2f71b9b" ], + "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], + "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_GetViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "cb1ec8fb-ecd1-413a-b855-dcb25d7e919c" ], + "x-ms-request-id": [ "2d05bda6-0934-4177-9254-6ea7b56d8b7d" ], + "x-ms-correlation-request-id": [ "47e339ab-943c-4c5a-ac20-f3c20e8cf4d0" ], + "x-ms-client-request-id": [ "8e58532d-a286-4a8c-a0b1-b0d4c2f71b9b" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091527Z:47e339ab-943c-4c5a-ac20-f3c20e8cf4d0" ], + "Date": [ "Mon, 06 Jul 2020 09:15:26 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "934" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}}]}" + } + } +} \ No newline at end of file diff --git a/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 new file mode 100644 index 000000000000..097cf9606605 --- /dev/null +++ b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 @@ -0,0 +1,25 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzCostManagementExportExecutionHistory.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Get-AzCostManagementExportExecutionHistory' { + It 'Get' { + $exportHist = Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 + $exportHist.Count | Should -Be 1 + } + + It 'GetViaIdentity' { + $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 + $exportHist = Get-AzCostManagementExportExecutionHistory -InputObject $export + $exportHist.Count | Should -Be 1 + } +} diff --git a/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json new file mode 100644 index 000000000000..68ea94ef94e2 --- /dev/null +++ b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json @@ -0,0 +1,205 @@ +{ + "Invoke-AzCostManagementExecuteExport+[NoContext]+Execute+$POST+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01+1": { + "Request": { + "Method": "POST", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "1" ], + "x-ms-client-request-id": [ "aa5de09b-ef0e-4ea4-b4ee-f3c17259b778" ], + "CommandName": [ "Invoke-AzCostManagementExecuteExport" ], + "FullCommandName": [ "Invoke-AzCostManagementExecuteExport_Execute" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "c5cfdf23-b5cf-4d5e-a72d-be4d96d9d4c7" ], + "x-ms-request-id": [ "415a06e2-5e88-4a14-a1ea-d6e42a98ea53" ], + "x-ms-correlation-request-id": [ "3f12b48f-92bd-4e6b-9787-1115afe8a6a7" ], + "x-ms-client-request-id": [ "aa5de09b-ef0e-4ea4-b4ee-f3c17259b778" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091735Z:3f12b48f-92bd-4e6b-9787-1115afe8a6a7" ], + "Date": [ "Mon, 06 Jul 2020 09:17:35 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null + } + }, + "Invoke-AzCostManagementExecuteExport+[NoContext]+Execute+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "2" ], + "x-ms-client-request-id": [ "59339ec2-05bd-469f-b15c-252dc532c76a" ], + "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], + "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "91923384-1eb0-49df-a7ac-0eedc372ae04" ], + "x-ms-request-id": [ "a95ba8c3-de6c-4f2e-87cf-9daab33d7ebb" ], + "x-ms-correlation-request-id": [ "8a6cbf6e-b118-4c5f-8277-4814220a0163" ], + "x-ms-client-request-id": [ "59339ec2-05bd-469f-b15c-252dc532c76a" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091736Z:8a6cbf6e-b118-4c5f-8277-4814220a0163" ], + "Date": [ "Mon, 06 Jul 2020 09:17:36 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "1715" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/05d2edf7-74a0-4bf4-a28a-992fd9c7655e\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:17:34.6964397Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}}]}" + } + }, + "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "d16ab7f1-1909-405c-b707-370048ec9171" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "97c945bd-2cc2-4707-96a4-86f5060f106b" ], + "x-ms-request-id": [ "4d27ae1c-d61a-453a-973b-8563c9a1bb54" ], + "x-ms-correlation-request-id": [ "a8f035cc-80ea-4935-8fe0-dbe58b44c180" ], + "x-ms-client-request-id": [ "d16ab7f1-1909-405c-b707-370048ec9171" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091737Z:a8f035cc-80ea-4935-8fe0-dbe58b44c180" ], + "Date": [ "Mon, 06 Jul 2020 09:17:37 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "709" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$POST+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01+2": { + "Request": { + "Method": "POST", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "4" ], + "x-ms-client-request-id": [ "b98b569c-e163-4298-9790-6356cde0b285" ], + "CommandName": [ "Invoke-AzCostManagementExecuteExport" ], + "FullCommandName": [ "Invoke-AzCostManagementExecuteExport_ExecuteViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "18205cc1-ff38-4a95-9aef-c16dbbfc4988" ], + "x-ms-request-id": [ "35db35b8-a307-4e71-9ffe-5bf8301d5b8f" ], + "x-ms-correlation-request-id": [ "95da9561-b928-474a-bfd2-02a4996862b3" ], + "x-ms-client-request-id": [ "b98b569c-e163-4298-9790-6356cde0b285" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091738Z:95da9561-b928-474a-bfd2-02a4996862b3" ], + "Date": [ "Mon, 06 Jul 2020 09:17:38 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null + } + }, + "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+3": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "5" ], + "x-ms-client-request-id": [ "f221456a-8398-45e0-a566-0ef1543db998" ], + "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], + "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "a547d712-70dd-4121-8ffa-d39c2a97b2c6" ], + "x-ms-request-id": [ "0c86b83d-3d5c-412b-a5e1-6c5f51052e32" ], + "x-ms-correlation-request-id": [ "7bd97d1f-b0fe-4fba-95bf-bd1adfa3c10e" ], + "x-ms-client-request-id": [ "f221456a-8398-45e0-a566-0ef1543db998" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091739Z:7bd97d1f-b0fe-4fba-95bf-bd1adfa3c10e" ], + "Date": [ "Mon, 06 Jul 2020 09:17:38 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "2495" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/05d2edf7-74a0-4bf4-a28a-992fd9c7655e\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:17:34.6964397Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/93ffc801-3f72-4485-9dd7-a39dfa22d130\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:17:38.009024Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}}]}" + } + } +} \ No newline at end of file diff --git a/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 new file mode 100644 index 000000000000..8dac196657d4 --- /dev/null +++ b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 @@ -0,0 +1,27 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostManagementExecuteExport.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Invoke-AzCostManagementExecuteExport' { + It 'Execute' { + Invoke-AzCostManagementExecuteExport -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 + $exportHist = Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 + $exportHist.Count | Should -Be 2 + } + + It 'ExecuteViaIdentity' { + $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 + Invoke-AzCostManagementExecuteExport -InputObject $export + $exportHist = Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 + $exportHist.Count | Should -Be 3 + } +} diff --git a/src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 b/src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 new file mode 100644 index 000000000000..ff8cb625bb70 --- /dev/null +++ b/src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 @@ -0,0 +1,20 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostManagementUsageQuery.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Invoke-AzCostManagementUsageQuery' { + It 'UsageExpanded' -Skip { + # The record file not generated, Because using Invoke-AzRest when call Invoke-AzCostManagementUsageQuery. + # TODO: When Invoke-AzRest support record model. + { Invoke-AzCostManagementUsageQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'daily' } | Should -Not -Throw + } +} diff --git a/src/CostManagement/test/New-AzCostManagementExport.Recording.json b/src/CostManagement/test/New-AzCostManagementExport.Recording.json new file mode 100644 index 000000000000..72dac9c415b5 --- /dev/null +++ b/src/CostManagement/test/New-AzCostManagementExport.Recording.json @@ -0,0 +1,187 @@ +{ + "New-AzCostManagementExport+[NoContext]+CreateExpandedBySubscription+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol?api-version=2019-11-01+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol?api-version=2019-11-01", + "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"granularity\": \"Daily\"\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "700" ] + } + }, + "Response": { + "StatusCode": 201, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol?api-version=2019-11-01" ], + "session-id": [ "361a8dc7-600f-48f9-b480-814e2805b158" ], + "x-ms-request-id": [ "9b7c7f17-026c-4665-9b68-c7351118fabf" ], + "x-ms-correlation-request-id": [ "940aeece-adb9-45a5-b838-c40fbf9395fd" ], + "x-ms-client-request-id": [ "82d6e05b-9aeb-4b1e-a93d-dcad8420be2d" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11980" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092243Z:940aeece-adb9-45a5-b838-c40fbf9395fd" ], + "Date": [ "Mon, 06 Jul 2020 09:22:42 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "709" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "New-AzCostManagementExport+[NoContext]+CreateExpandedByResourceGroup+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01", + "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"granularity\": \"Daily\"\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "700" ] + } + }, + "Response": { + "StatusCode": 201, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01" ], + "session-id": [ "5b9bb6b5-cc5f-49fc-9af1-aef16afed5ec" ], + "x-ms-request-id": [ "91135221-6de8-4fbe-b4f0-7b0d6c122e40" ], + "x-ms-correlation-request-id": [ "4f2fc077-2b2f-4705-88a4-ee1329c3ea32" ], + "x-ms-client-request-id": [ "8e5a1cc5-b5af-426f-a6d6-d0bd1fd02884" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11979" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092244Z:4f2fc077-2b2f-4705-88a4-ee1329c3ea32" ], + "Date": [ "Mon, 06 Jul 2020 09:22:44 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "749" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5\",\"name\":\"export-rs3qh5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377017c569f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "New-AzCostManagementExport+[NoContext]+CreateExpandedByColumn+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01", + "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"configuration\": {\n \"columns\": [ \"SubscriptionGuid\", \"MeterId\", \"InstanceId\", \"ResourceGroup\", \"PreTaxCost\" ]\n },\n \"granularity\": \"Daily\"\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "838" ] + } + }, + "Response": { + "StatusCode": 201, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01" ], + "session-id": [ "c0a0fcfb-517c-40b0-abfd-74a6fd6f5350" ], + "x-ms-request-id": [ "960a8d4b-ac23-4895-959a-b2c77f6fd30f" ], + "x-ms-correlation-request-id": [ "cdd904bf-1506-42f0-a6e7-f373594a55f9" ], + "x-ms-client-request-id": [ "95a913d0-9eb2-44b7-a4fc-bfb725432239" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11978" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092246Z:cdd904bf-1506-42f0-a6e7-f373594a55f9" ], + "Date": [ "Mon, 06 Jul 2020 09:22:45 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "810" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2\",\"name\":\"export-ni0ar2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537702554d6a\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}}" + } + }, + "New-AzCostManagementExport+[NoContext]+CreateExpandedByGroup+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft?api-version=2019-11-01+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft?api-version=2019-11-01", + "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"granularity\": \"Daily\",\n \"grouping\": [\n {\n \"name\": \"ResourceGroup\",\n \"type\": \"Dimension\"\n }\n ]\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "826" ] + } + }, + "Response": { + "StatusCode": 201, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft?api-version=2019-11-01" ], + "session-id": [ "bbebf88b-bfaf-4862-9452-ac4c1d301006" ], + "x-ms-request-id": [ "605da652-113d-459e-9b0a-844f85d8e68f" ], + "x-ms-correlation-request-id": [ "655498cc-40ac-4af0-b979-37f07a1d8009" ], + "x-ms-client-request-id": [ "609dabb6-22f5-432c-8116-44ceff4f8782" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11977" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092248Z:655498cc-40ac-4af0-b979-37f07a1d8009" ], + "Date": [ "Mon, 06 Jul 2020 09:22:47 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "766" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}" + } + }, + "New-AzCostManagementExport+[NoContext]+CreateExpandedByGroupAggregation+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of?api-version=2019-11-01+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of?api-version=2019-11-01", + "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"aggregation\": {\n \"costsum\": {\n \"name\": \"PreTaxCost\",\n \"function\": \"sum\"\n },\n \"cost\": {\n \"name\": \"Cost\",\n \"function\": \"sum\"\n }\n },\n \"granularity\": \"Daily\",\n \"grouping\": [\n {\n \"name\": \"ResourceGroup\",\n \"type\": \"Dimension\"\n }\n ]\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "1052" ] + } + }, + "Response": { + "StatusCode": 201, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of?api-version=2019-11-01" ], + "session-id": [ "f4257420-e658-4922-8a45-5070a7a873f9" ], + "x-ms-request-id": [ "bcbee889-01b3-4622-9367-79d39cc4209e" ], + "x-ms-correlation-request-id": [ "c33b1ea7-0200-4131-ba5e-ce80b54e9f22" ], + "x-ms-client-request-id": [ "61711854-579b-4158-ac78-77280128fe03" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11976" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092249Z:c33b1ea7-0200-4131-ba5e-ce80b54e9f22" ], + "Date": [ "Mon, 06 Jul 2020 09:22:49 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "871" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}" + } + } +} \ No newline at end of file diff --git a/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 b/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 new file mode 100644 index 000000000000..767e806850c8 --- /dev/null +++ b/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 @@ -0,0 +1,103 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostManagementExport.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'New-AzCostManagementExport' { + It 'CreateExpandedBySubscription' { + # Create export cost management by subscription + $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName02 ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` + -RecurrencePeriodTo $env.toDate -Format "Csv" ` + -DestinationResourceId $env.storageAccountId ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" + + $export.ScheduleStatus | Should -Be 'Active' + } + It 'CreateExpandedByResourceGroup' { + # Create export cost management by resource group + $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)/resourceGroups/$($env.resourceGroup)" -Name $env.exportName03 ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` + -RecurrencePeriodTo $env.toDate -Format "Csv" ` + -DestinationResourceId $env.storageAccountId ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" + + $export.ScheduleStatus | Should -Be 'Active' + } + It 'CreateExpandedByColumn' { + $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName04 ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` + -RecurrencePeriodTo $env.toDate -Format "Csv" ` + -DestinationResourceId $env.storageAccountId ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" ` + -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') + + $export.ScheduleStatus | Should -Be 'Active' + } + + It 'CreateExpandedByGroup' { + $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName05 ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` + -RecurrencePeriodTo $env.toDate -Format "Csv" ` + -DestinationResourceId $env.storageAccountId ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" ` + -DatasetGrouping @(@{type='Dimension'; name='ResourceGroup'}) + + $export.ScheduleStatus | Should -Be 'Active' + } + It 'CreateExpandedByGroupAggregation' { + #Group Aggregation: Created successfully, No data generated in the storage account + $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} + $Aggregation2 = @{ name = 'Cost'; function='sum'} + $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} + + $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName06 ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` + -RecurrencePeriodTo $env.toDate -Format "Csv" ` + -DestinationResourceId $env.storageAccountId ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" ` + -DatasetGrouping @(@{type='Dimension'; name='ResourceGroup'}) ` + -DatasetAggregation $AggregationDict + + $export.ScheduleStatus | Should -Be 'Active' + } + + It 'CreateExpandedByFilter' -skip { + #Filter: Create failed, Invalid dataset filter; on a QueryFilter one and only one of and/or/not/dimension/tag can be set. Invalid dataset + # filter; on a QueryFilter one and only one of and/or/not/dimension/tag can be set. + #TODO: The issue fix. + <# + $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') + $queryOrDimension = New-AzCostManagementQueryFilterObject -Dimension $orDimension + $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') + $queryOrTag = New-AzCostManagementQueryFilterObject -Tag $orTag + $andOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) + + $dimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' + $andDimension = New-AzCostManagementQueryFilterObject -Dimension $dimension + $fileter = New-AzCostManagementQueryFilterObject -And @($andOr, $andDimension) + + New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-filter-t01" ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" ` + -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` + -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` + -DatasetGranularity "Daily" ` + -DatasetFilter $fileter + #> + } + +} diff --git a/src/CostManagement/test/New-AzCostManagementQueryColumnObject.Tests.ps1 b/src/CostManagement/test/New-AzCostManagementQueryColumnObject.Tests.ps1 new file mode 100644 index 000000000000..35a70dd55a82 --- /dev/null +++ b/src/CostManagement/test/New-AzCostManagementQueryColumnObject.Tests.ps1 @@ -0,0 +1,18 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostManagementQueryColumnObject.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'New-AzCostManagementQueryColumnObject' { + It '__AllParameterSets' { + { New-AzCostManagementQueryColumnObject -Name 'SubscriptionGuid' -Type 'string' } | Should -Not -Throw + } +} diff --git a/src/CostManagement/test/New-AzCostManagementQueryComparisonExpressionObject.Tests.ps1 b/src/CostManagement/test/New-AzCostManagementQueryComparisonExpressionObject.Tests.ps1 new file mode 100644 index 000000000000..7cf80493cdc4 --- /dev/null +++ b/src/CostManagement/test/New-AzCostManagementQueryComparisonExpressionObject.Tests.ps1 @@ -0,0 +1,20 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostManagementQueryComparisonExpressionObject.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'New-AzCostManagementQueryComparisonExpressionObject' { + It '__AllParameterSets' { + { + $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') + } | Should -Not -Throw + } +} diff --git a/src/CostManagement/test/New-AzCostManagementQueryFilterObject.Tests.ps1 b/src/CostManagement/test/New-AzCostManagementQueryFilterObject.Tests.ps1 new file mode 100644 index 000000000000..2e490b60f25b --- /dev/null +++ b/src/CostManagement/test/New-AzCostManagementQueryFilterObject.Tests.ps1 @@ -0,0 +1,26 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'New-AzCostManagementQueryFilterObject.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'New-AzCostManagementQueryFilterObject' { + It '__AllParameterSets' { + { + $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') + $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') + $andOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) + + $dimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' + $andDimension = New-AzCostManagementQueryFilterObject -Dimension $dimension + $fileter = New-AzCostManagementQueryFilterObject -And @($andOr, $andDimension) + } | Should -Not -Throw + } +} diff --git a/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json b/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json new file mode 100644 index 000000000000..76df2901aa3e --- /dev/null +++ b/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json @@ -0,0 +1,205 @@ +{ + "Remove-AzCostManagementExport+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01+1": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "1" ], + "x-ms-client-request-id": [ "535649f7-37d1-411b-9b2f-dcbf463cfdbb" ], + "CommandName": [ "Remove-AzCostManagementExport" ], + "FullCommandName": [ "Remove-AzCostManagementExport_Delete" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "f9232219-c998-4ac6-bcf9-e01d0a7305cf" ], + "x-ms-request-id": [ "449a95a0-8a08-4a14-9f3f-22b448eac6d1" ], + "x-ms-correlation-request-id": [ "6013e0f6-10b6-4e53-8f27-7239a2a1e8ef" ], + "x-ms-client-request-id": [ "535649f7-37d1-411b-9b2f-dcbf463cfdbb" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11989" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092523Z:6013e0f6-10b6-4e53-8f27-7239a2a1e8ef" ], + "Date": [ "Mon, 06 Jul 2020 09:25:22 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null + } + }, + "Remove-AzCostManagementExport+[NoContext]+Delete+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01+2": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "2" ], + "x-ms-client-request-id": [ "739c6edc-d378-45e9-8acd-1b1ddac54c8e" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "c675f856-4636-483c-8aaa-768eea00264d" ], + "x-ms-request-id": [ "ce4d168e-38f6-4461-9cd6-edbe683ad303" ], + "x-ms-correlation-request-id": [ "fe419d55-604d-43b3-b298-c88e63feee47" ], + "x-ms-client-request-id": [ "739c6edc-d378-45e9-8acd-1b1ddac54c8e" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11988" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092524Z:fe419d55-604d-43b3-b298-c88e63feee47" ], + "Date": [ "Mon, 06 Jul 2020 09:25:23 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "26269" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport4\",\"name\":\"TestExport4\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6425d3647\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport5\",\"name\":\"TestExport5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f679d78775\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport6\",\"name\":\"TestExport6\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6b27ba29f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation\",\"name\":\"TestExportDatasetAggregation\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650e17ad92f21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}]}" + } + }, + "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "6684dacb-2030-4120-b7ad-a486167d3886" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "921183df-cf9f-4104-92ee-3700f5e8aaed" ], + "x-ms-request-id": [ "4a734a96-b3e1-4b92-92e1-578039584923" ], + "x-ms-correlation-request-id": [ "01e6de87-94af-4c75-a3b9-385c9e3cf165" ], + "x-ms-client-request-id": [ "6684dacb-2030-4120-b7ad-a486167d3886" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11987" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092524Z:01e6de87-94af-4c75-a3b9-385c9e3cf165" ], + "Date": [ "Mon, 06 Jul 2020 09:25:24 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "749" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5\",\"name\":\"export-rs3qh5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377017c569f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01+2": { + "Request": { + "Method": "DELETE", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "4" ], + "x-ms-client-request-id": [ "8f26b1f2-b17c-4913-9c9f-b47b54502d30" ], + "CommandName": [ "Remove-AzCostManagementExport" ], + "FullCommandName": [ "Remove-AzCostManagementExport_DeleteViaIdentity" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "a75be8a6-2f8d-4b2e-b75e-29756e8e9e85" ], + "x-ms-request-id": [ "007defc8-ccf3-448e-b9f3-e3bb81ee6669" ], + "x-ms-correlation-request-id": [ "58d53028-e64b-4974-8365-dafd4fb3e6a0" ], + "x-ms-client-request-id": [ "8f26b1f2-b17c-4913-9c9f-b47b54502d30" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11986" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092525Z:58d53028-e64b-4974-8365-dafd4fb3e6a0" ], + "Date": [ "Mon, 06 Jul 2020 09:25:25 GMT" ] + }, + "ContentHeaders": { + "Expires": [ "-1" ], + "Content-Length": [ "0" ] + }, + "Content": null + } + }, + "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01+3": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "5" ], + "x-ms-client-request-id": [ "c3d09aa8-5731-4964-b862-f658e5146650" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_List" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "session-id": [ "dff4aa38-f47b-4de1-80db-0ead27b421e9" ], + "x-ms-request-id": [ "e4d4e2ab-31c3-4367-bef5-05faaf81dc4a" ], + "x-ms-correlation-request-id": [ "d964c677-9edf-44a7-a2fd-e1857cd728f7" ], + "x-ms-client-request-id": [ "c3d09aa8-5731-4964-b862-f658e5146650" ], + "Access-Control-Allow-Origin": [ "*" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11985" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092526Z:d964c677-9edf-44a7-a2fd-e1857cd728f7" ], + "Date": [ "Mon, 06 Jul 2020 09:25:26 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "26269" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport4\",\"name\":\"TestExport4\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6425d3647\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport5\",\"name\":\"TestExport5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f679d78775\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport6\",\"name\":\"TestExport6\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6b27ba29f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation\",\"name\":\"TestExportDatasetAggregation\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650e17ad92f21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}]}" + } + } +} \ No newline at end of file diff --git a/src/CostManagement/test/Remove-AzCostManagementExport.Tests.ps1 b/src/CostManagement/test/Remove-AzCostManagementExport.Tests.ps1 new file mode 100644 index 000000000000..ba82788c08a2 --- /dev/null +++ b/src/CostManagement/test/Remove-AzCostManagementExport.Tests.ps1 @@ -0,0 +1,27 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzCostManagementExport.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Remove-AzCostManagementExport' { + It 'Delete' { + Remove-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName04 + $exportList = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" + $exportList.Name| Should -Not -Contain $env.exportName04 + } + + It 'DeleteViaIdentity' { + $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)/resourceGroups/$($env.resourceGroup)" -Name $env.exportName03 + Remove-AzCostManagementExport -InputObject $export + $exportList = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" + $exportList.Name| Should -Not -Contain $env.exportName03 + } +} diff --git a/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 b/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 new file mode 100644 index 000000000000..7014d42d40d4 --- /dev/null +++ b/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 @@ -0,0 +1,29 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzCostManagementExport.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Update-AzCostManagementExport' { + It 'UpdateExpanded' -skip { + # Has issue on server, Parameter ResourceID is not null + # TODO: When fix issue on server + $export = Update-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 -RecurrencePeriodFrom $env.toDate + $export.RecurrencePeriodFrom | Should -Be $env.toDate + } + + It 'UpdateViaIdentityExpanded' -skip { + # Has issue on server, Parameter ResourceID is not null + # TODO: When fix issue on server + $oldExport = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 + $export = Update-AzCostManagementExport -InputObject $oldExport -RecurrencePeriodFrom $env.fromDate + $export.RecurrencePeriodFrom | Should -Be $env.fromDate + } +} diff --git a/src/CostManagement/test/deployment-templates/storage-account/parameters.json b/src/CostManagement/test/deployment-templates/storage-account/parameters.json new file mode 100644 index 000000000000..005b17d22f35 --- /dev/null +++ b/src/CostManagement/test/deployment-templates/storage-account/parameters.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "storageAccounts_name": null + } +} diff --git a/src/CostManagement/test/deployment-templates/storage-account/template.json b/src/CostManagement/test/deployment-templates/storage-account/template.json new file mode 100644 index 000000000000..1ce0851a5d9e --- /dev/null +++ b/src/CostManagement/test/deployment-templates/storage-account/template.json @@ -0,0 +1,96 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "storageAccounts_name": { + "defaultValue": "staaccountjshubiu", + "type": "String" + } + }, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2019-06-01", + "name": "[parameters('storageAccounts_name')]", + "location": "eastus", + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "kind": "StorageV2", + "properties": { + "networkAcls": { + "bypass": "AzureServices", + "virtualNetworkRules": [], + "ipRules": [], + "defaultAction": "Allow" + }, + "supportsHttpsTrafficOnly": true, + "encryption": { + "services": { + "file": { + "keyType": "Account", + "enabled": true + }, + "blob": { + "keyType": "Account", + "enabled": true + } + }, + "keySource": "Microsoft.Storage" + }, + "accessTier": "Hot" + } + }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices", + "apiVersion": "2019-06-01", + "name": "[concat(parameters('storageAccounts_name'), '/default')]", + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_name'))]" + ], + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "properties": { + "cors": { + "corsRules": [] + }, + "deleteRetentionPolicy": { + "enabled": false + } + } + }, + { + "type": "Microsoft.Storage/storageAccounts/fileServices", + "apiVersion": "2019-06-01", + "name": "[concat(parameters('storageAccounts_name'), '/default')]", + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_name'))]" + ], + "sku": { + "name": "Standard_RAGRS", + "tier": "Standard" + }, + "properties": { + "cors": { + "corsRules": [] + } + } + }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices/containers", + "apiVersion": "2019-06-01", + "name": "[concat(parameters('storageAccounts_name'), '/default/exports')]", + "dependsOn": [ + "[resourceId('Microsoft.Storage/storageAccounts/blobServices', parameters('storageAccounts_name'), 'default')]", + "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_name'))]" + ], + "properties": { + "publicAccess": "None" + } + } + ] +} \ No newline at end of file diff --git a/src/CostManagement/test/env.json b/src/CostManagement/test/env.json new file mode 100644 index 000000000000..4e7b60c28d9d --- /dev/null +++ b/src/CostManagement/test/env.json @@ -0,0 +1,17 @@ +{ + "storageAccountId": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu", + "location": "eastus", + "resourceGroup": "costmanagement-rg-5rij6b", + "exportName08": "export-93sr8e", + "exportName06": "export-j8s5of", + "Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "exportName05": "export-gq1kft", + "fromDate": "7/6/2020 9:13:02 AM", + "exportName01": "export-38we0i", + "exportName02": "export-r6xjol", + "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f", + "toDate": "7/26/2020 9:13:02 AM", + "exportName03": "export-rs3qh5", + "exportName04": "export-ni0ar2", + "exportName07": "export-ktoa73" +} diff --git a/src/CostManagement/test/loadEnv.ps1 b/src/CostManagement/test/loadEnv.ps1 new file mode 100644 index 000000000000..c4ebf2e8310c --- /dev/null +++ b/src/CostManagement/test/loadEnv.ps1 @@ -0,0 +1,28 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/src/CostManagement/test/readme.md b/src/CostManagement/test/readme.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/src/CostManagement/test/readme.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/src/CostManagement/test/test-script.ps1 b/src/CostManagement/test/test-script.ps1 new file mode 100644 index 000000000000..21a919b92419 --- /dev/null +++ b/src/CostManagement/test/test-script.ps1 @@ -0,0 +1,91 @@ +<# +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "LucasTestExport" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" ` +-RecurrencePeriodFrom "2020-06-20T20:00:00Z" ` +-RecurrencePeriodTo "2020-06-24T00:00:00Z" ` +-Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" ` +-DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" ` +#-ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') +-DatasetAggregation $AggregationDict ` +-DatasetGrouping @(@{type='Dimension'; name='SubscriptionName'}; @{type='Tag'; name='Environment'}) ` +#-DatasetFilter $fileter +#> + +<# export all info pass +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-exportall-t" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" ` +-RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` +-DatasetGranularity "Daily" +#> + +<# custom colum pass +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-customcolum-t" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" ` +-RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` +-DatasetGranularity "Daily" ` +-ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') +#> + +<# Aggregation: The data not generate in the storage account +$Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} +$Aggregation2 = @{ name = 'Cost'; function='sum'} +$AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} + +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-aggregation-t" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" ` +-RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` +-DatasetGranularity "Daily" ` +-DatasetAggregation $AggregationDict +#> + +<#Group pass +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-group-t" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T15:00:00Z" ` +-RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` +-DatasetGranularity "Daily" ` +-DatasetGrouping @(@{type='Dimension'; name='ResourceGroup'}) + #> + +<#Group Aggregation: No data generated in the storage account +$Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} +$Aggregation2 = @{ name = 'Cost'; function='sum'} +$AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} + +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-groupaggregation-t" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" ` +-RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` +-DatasetGranularity "Daily" ` +-DatasetGrouping @(@{type='Dimension'; name='ResourceGroup'}) ` +-DatasetAggregation $AggregationDict +#> +<# +$orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') +$queryOrDimension = New-AzCostManagementQueryFilterObject -Dimension $orDimension +$orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') +$queryOrTag = New-AzCostManagementQueryFilterObject -Tag $orTag +$andOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) + +$dimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' +$andDimension = New-AzCostManagementQueryFilterObject -Dimension $dimension +$fileter = New-AzCostManagementQueryFilterObject -And @($andOr, $andDimension) +#> +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-filter-t01" ` +-ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-07-05T00:00:00Z" ` +-RecurrencePeriodTo "2020-07-30T00:00:00Z" -Format "Csv" ` +-DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` +-DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` +-DatasetGranularity "Daily" ` +-DatasetFilter $fileter + diff --git a/src/CostManagement/test/utils.ps1 b/src/CostManagement/test/utils.ps1 new file mode 100644 index 000000000000..71818c954ade --- /dev/null +++ b/src/CostManagement/test/utils.ps1 @@ -0,0 +1,93 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +function getUseModules() { + $usedModule = & 'gmo' + foreach($module in $usedModule) + { + $name = $module.Name + $version = $module.Version + Write-Host -ForegroundColor Green "Using module name: $name $version" + } +} +$env = @{} +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + $env.location = 'eastus' + # For any resources you created for test, you should add it to $env here. + $exportName01 = 'export-' + (RandomString -allChars $false -len 6) + $exportName02 = 'export-' + (RandomString -allChars $false -len 6) + $exportName03 = 'export-' + (RandomString -allChars $false -len 6) + $exportName04 = 'export-' + (RandomString -allChars $false -len 6) + $exportName05 = 'export-' + (RandomString -allChars $false -len 6) + $exportName06 = 'export-' + (RandomString -allChars $false -len 6) + $exportName07 = 'export-' + (RandomString -allChars $false -len 6) + $exportName08 = 'export-' + (RandomString -allChars $false -len 6) + + $null = $env.Add('exportName01', $exportName01) + $null = $env.Add('exportName02', $exportName02) + $null = $env.Add('exportName03', $exportName03) + $null = $env.Add('exportName04', $exportName04) + $null = $env.Add('exportName05', $exportName05) + $null = $env.Add('exportName06', $exportName06) + $null = $env.Add('exportName07', $exportName07) + $null = $env.Add('exportName08', $exportName08) + + Write-Host -ForegroundColor Green "Create test group..." + $resourceGroup = 'costmanagement-rg-' + (RandomString -allChars $false -len 6) + Write-Host $resourceGroup + New-AzResourceGroup -Name $resourceGroup -Location $env.location + $null = $env.Add('resourceGroup', $resourceGroup) + Write-Host -ForegroundColor Green 'The test group create completed.' + + # Deploy storage account for test. + Write-Host -ForegroundColor Green "Deploying storage account..." + <# Cause error: The request content was invalid and could not be deserialized: 'Error converting value "staaccountuigcan" to type + 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Definitions.DeploymentParameterDefinition'. Path + 'properties.parameters.storageAccounts_wyunchistorageaccount_name', line 5, position 70.'. + + $staaccountName = 'staaccount' + (RandomString -allChars $false -len 6) + $staaccountParam = Get-Content .\test\deployment-templates\storage-account\parameters.json | ConvertFrom-Json + $staaccountParam.parameters.storageAccounts_name = $staaccountName + set-content -Path .\test\deployment-templates\storage-account\parameters.json -Value (ConvertTo-Json $staaccountParam) + #> + New-AzDeployment -Mode Incremental -TemplateFile .\test\deployment-templates\storage-account\template.json -TemplateParameterFile .\test\deployment-templates\storage-account\parameters.json -ResourceGroupName $env.resourceGroup + $staaccountName = 'staaccountjshubiu' # Value in template.json + $env.storageAccountId = "/subscriptions/$($env.SubscriptionId)/resourceGroups/$($env.resourceGroup)/providers/Microsoft.Storage/storageAccounts/$($staaccountName)" + Start-Sleep -s 60 # Waiting storage account create complete. + Write-Host -ForegroundColor Green "The storage account deployed successfully." + + Write-Host -ForegroundColor Green "Create cost management export for test..." + $env.fromDate = (Get-Date).ToString() + $env.toDate = (Get-Date).AddDays(20).ToString() + New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" ` + -RecurrencePeriodFrom $env.fromDate -RecurrencePeriodTo $env.toDate ` + -Format "Csv" ` + -DestinationResourceId $env.storageAccountId ` + -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" ` + -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" + + Invoke-AzCostManagementExecuteExport -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 + + Write-Host -ForegroundColor Green "The cost management export created successfully." + + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) + +} +function cleanupEnv() { + # Clean resources you create for testing + Remove-AzResourceGroup -Name $env.resourceGroup +} + From cf145994ddfe2613bfc4bb9cc03cbd43d9ed2956 Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Tue, 7 Jul 2020 19:24:28 +0800 Subject: [PATCH 08/17] Fix the issue of format table of Get-AzCostmanagementExportExecuteHistory --- .../Invoke-AzCostManagementUsageQuery.ps1 | 50 ++----------------- .../New-AzCostManagementQueryFilterObject.ps1 | 4 +- src/CostManagement/readme.md | 13 ++--- 3 files changed, 14 insertions(+), 53 deletions(-) diff --git a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 index 83a5532a0181..deebfff9f3f4 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 @@ -89,7 +89,7 @@ function Invoke-AzCostManagementUsageQuery { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult])] [CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The scope associated with query and export operations.")] + [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] [System.String] # The scope associated with query and export operations. @@ -110,18 +110,8 @@ param( # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. ${ExternalCloudProviderType}, - [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, ValueFromPipeline, HelpMessage="Identity Parameter")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, ValueFromPipeline, HelpMessage="Identity Parameter")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The time frame for pulling data for the query.")] [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The time frame for pulling data for the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, HelpMessage="The time frame for pulling data for the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, HelpMessage="The time frame for pulling data for the query.")] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] @@ -131,8 +121,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The type of the query.")] [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The type of the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', Mandatory, HelpMessage="The type of the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', Mandatory, HelpMessage="The type of the query.")] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType])] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] @@ -141,8 +129,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Array of column names to be included in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of column names to be included in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Array of column names to be included in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Array of column names to be included in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [System.String[]] # Array of column names to be included in the query. @@ -152,8 +138,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Dictionary of aggregation expression to use in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Dictionary of aggregation expression to use in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Dictionary of aggregation expression to use in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Dictionary of aggregation expression to use in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryDatasetAggregation]))] [System.Collections.Hashtable] @@ -164,8 +148,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Has filter expression to use in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Has filter expression to use in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Has filter expression to use in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Has filter expression to use in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter] # Has filter expression to use in the query. @@ -174,8 +156,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The granularity of rows in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The granularity of rows in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="The granularity of rows in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="The granularity of rows in the query.")] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] @@ -184,8 +164,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage='Array of group by expression to use in the query.')] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of group by expression to use in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="Array of group by expression to use in the query.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="Array of group by expression to use in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[]] # Array of group by expression to use in the query. @@ -195,8 +173,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The start date to pull data from.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The start date to pull data from.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="The start date to pull data from.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="The start date to pull data from.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [System.DateTime] # The start date to pull data from. @@ -204,8 +180,6 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The end date to pull data to.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The end date to pull data to.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded', HelpMessage="The end date to pull data to.")] - [Parameter(ParameterSetName='UsageViaIdentityExpanded1', HelpMessage="The end date to pull data to.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] [System.DateTime] # The end date to pull data to. @@ -264,26 +238,12 @@ param( $URL = '' if ($PSBoundParameters.ContainsKey('ExternalCloudProviderType')) { - $URL = [System.Uri]::New([System.Text.RegularExpressions.Regex]::Replace( - "https://management.azure.com/providers/Microsoft.CostManagement/$ExternalCloudProviderType/$ExternalCloudProviderId/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2")) + $URL = [System.Text.RegularExpressions.Regex]::Replace( + "providers/Microsoft.CostManagement/$ExternalCloudProviderType/$ExternalCloudProviderId/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2") } else { - if (-not $PSBoundParameters.ContainsKey('Scope')) { - $ResourceId = $InputObject.Id - if ($null -eq $ResourceId) { - $ErrorMessage = 'Id in input object should not be empty.' - throw [System.IO.FileNotFoundException] $ErrorMessage - } - $match = [System.Text.RegularExpressions].Regex("(?.+)/providers/Microsoft.CostManagement/query$").Match($ResourceId); - if (-not $match.Success) - { - throw [System.IO.FileNotFoundException] "Invalid identity for URI '/{scope}/providers/Microsoft.CostManagement/query'" - } - $Scope = $match.Groups["scope"].Value - } - $URL = [System.Uri]::New([System.Text.RegularExpressions.Regex]::Replace( - "https://management.azure.com/$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2")) + $URL = [System.Text.RegularExpressions.Regex]::Replace( + "$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2") } - $URL = $URL -replace "https://management.azure.com/","" $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryDefinition]::New() if ($PSBoundParameters.ContainsKey('ConfigurationColumn')) { diff --git a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 index 26ac0edcb43e..26bcd54b0c2c 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 @@ -15,9 +15,9 @@ <# .Synopsis -Create a in-memory object for QueryFilter +Create a in-memory object for QueryFilter. On a QueryFilter one and only one of and/or/not/dimension/tag can be set. .Description -Create a in-memory object for QueryFilter +Create a in-memory object for QueryFilter. On a QueryFilter one and only one of and/or/not/dimension/tag can be set. .Outputs Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 3b2c2ae143ee..9296f093685d 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -77,13 +77,14 @@ directive: hide: true - where: subject: ByDimensionExternalCloudProviderType|CloudForecast|DismissAlert|Forecast - verb: invoke + verb: Invoke remove: true - # - where: - # subject: ExportExecutionHistory - # verb: Get - # variant: GetViaIdentity - # remove: true + - where: + subject: Export|ExportExecutionHistory|ExportExecution + parameter-name: Scope + set: + parameter-name: ABC + # parameter-description: This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - from: source-file-csharp where: $ transform: $ = $.replace(/\/runHistory\$/g, "$"); From a079a6e2df1f41a95cb513669188cedc01141864 Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Mon, 13 Jul 2020 11:11:56 +0800 Subject: [PATCH 09/17] update readme --- src/CostManagement/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index c2a430cda0ef..9296f093685d 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -141,4 +141,4 @@ directive: - no-inline: - QueryFilter - ReportConfigFilter -``` \ No newline at end of file +``` From e8dc3acb61d819d0d79e5d4c23586d5a74e3158a Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Tue, 3 Nov 2020 16:08:33 +0800 Subject: [PATCH 10/17] Update api-version --- .../Invoke-AzCostManagementUsageQuery.ps1 | 72 ++++++-- .../New-AzCostManagementQueryColumnObject.ps1 | 6 +- ...agementQueryComparisonExpressionObject.ps1 | 6 +- .../New-AzCostManagementQueryFilterObject.ps1 | 16 +- src/CostManagement/docs/Az.Cost.md | 9 +- .../docs/Get-AzCostManagementExport.md | 62 +++---- ...-AzCostManagementExportExecutionHistory.md | 31 ++-- .../Invoke-AzCostManagementExecuteExport.md | 21 +-- .../docs/Invoke-AzCostManagementUsageQuery.md | 66 ++------ .../docs/New-AzCostManagementExport.md | 154 +++++------------- .../New-AzCostManagementQueryColumnObject.md | 2 +- ...nagementQueryComparisonExpressionObject.md | 2 +- .../New-AzCostManagementQueryFilterObject.md | 26 +-- .../docs/Remove-AzCostManagementExport.md | 17 +- .../docs/Update-AzCostManagementExport.md | 134 +++++---------- src/CostManagement/docs/readme.md | 4 +- .../examples/Get-AzCostManagementExport.md | 33 +--- ...-AzCostManagementExportExecutionHistory.md | 23 +-- .../Invoke-AzCostManagementExecuteExport.md | 15 +- .../Invoke-AzCostManagementUsageQuery.md | 18 +- .../examples/New-AzCostManagementExport.md | 35 +--- .../New-AzCostManagementQueryFilterObject.md | 8 +- .../examples/Remove-AzCostManagementExport.md | 15 +- .../examples/Update-AzCostManagementExport.md | 14 +- src/CostManagement/readme.md | 17 +- src/CostManagement/resources/Create.ps1 | 8 +- 26 files changed, 332 insertions(+), 482 deletions(-) diff --git a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 index deebfff9f3f4..6f6e45aa040b 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 @@ -28,11 +28,11 @@ PS C:\> {{ Add code here }} {{ Add output here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryDefinition +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryDefinition .Inputs Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult .Notes COMPLEX PARAMETER PROPERTIES @@ -86,7 +86,7 @@ PARAMETER : The definition of a query. https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery #> function Invoke-AzCostManagementUsageQuery { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult])] [CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.")] @@ -139,7 +139,7 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Dictionary of aggregation expression to use in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Dictionary of aggregation expression to use in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryDatasetAggregation]))] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryDatasetAggregation]))] [System.Collections.Hashtable] # Dictionary of aggregation expression to use in the query. # The key of each item in the dictionary is the alias for the aggregated column. @@ -149,7 +149,7 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Has filter expression to use in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Has filter expression to use in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter] # Has filter expression to use in the query. # To construct, see NOTES section for DATASETFILTER properties and create a hash table. ${DatasetFilter}, @@ -165,7 +165,7 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage='Array of group by expression to use in the query.')] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of group by expression to use in the query.")] [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[]] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryGrouping[]] # Array of group by expression to use in the query. # Query can have up to 2 group by clauses. # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. @@ -235,17 +235,16 @@ param( process { $ApiVersion = '2019-11-01' - $URL = '' if ($PSBoundParameters.ContainsKey('ExternalCloudProviderType')) { $URL = [System.Text.RegularExpressions.Regex]::Replace( "providers/Microsoft.CostManagement/$ExternalCloudProviderType/$ExternalCloudProviderId/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2") } else { $URL = [System.Text.RegularExpressions.Regex]::Replace( - "$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2") + "$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion", "\\?&*$|&*$|(\\?)&+|(&)&+","$1$2") } - $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryDefinition]::New() + $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryDefinition]::New() if ($PSBoundParameters.ContainsKey('ConfigurationColumn')) { $Request.ConfigurationColumn = $ConfigurationColumn } @@ -273,17 +272,55 @@ param( if ($PSBoundParameters.ContainsKey('Type')) { $Request.Type = $Type } - $ResponseContent = (Invoke-AzRest -Path $URL -Payload $Request.ToJsonString() -Method POST).Content | ConvertFrom-Json - if ($Null -ne $ResponseContent.Error) { - throw $ResponseContent.Error.Message + $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryResult]::New() + $SkipToken = $null + $RowList = New-Object System.Collections.Generic.List[System.Collections.Generic.List[string]] + while ($true) { + $Response = Invoke-AzCostManagementUsageQueryInternal -URL $URL -SkipToken $SkipToken -Payload $Request.ToJsonString() -Scope $Scope + $Result.Column = $Response.Column + foreach ($Row in $Response.Row) { + $RowList.Add($Row) + } + if ($null -ne $Response.NextLink -and '' -ne $Response.nextlink) + { + $SkipToken = $Response.nextLink + } else { + break + } } - $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryResult]::New() - $Result.NextLink = $ResponseContent.Properties.NextLink + $Result.Row = $RowList + return $Result + } +} - $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryColumn] +function Invoke-AzCostManagementUsageQueryInternal { + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult])] + param( + [System.String] + ${URL}, + [System.String] + ${SkipToken}, + [System.String] + ${Payload}, + [System.String] + ${Scope} + ) + process { + if ($null -ne $SkipToken -and $SkipToken -ne '') { + $URL = "$URL&$SkipToken" + } + $ResponseContent = (Invoke-AzRest -Path $URL -Payload $Payload -Method POST).Content | ConvertFrom-Json + + $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryResult]::New() + if ($null -ne $ResponseContent.Properties.NextLink) + { + $Result.NextLink = $ResponseContent.Properties.NextLink.split('&')[1] + } + + $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryColumn] foreach ($Column in $ResponseContent.Properties.Columns) { Write-Host $Column.ToString() - $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn]::New() + $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn]::New() $QueryColumn.Name = $Column.Name $QueryColumn.Type = $Column.Type $ColumnList.Add($QueryColumn) @@ -299,6 +336,7 @@ param( $RowList.Add($QueryRow) } $Result.Row = $RowList + return $Result } -} +} \ No newline at end of file diff --git a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 index f1209b40db1d..587fd453c10f 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for QueryColumn Create a in-memory object for QueryColumn .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn .Link https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject #> function New-AzCostManagementQueryColumnObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -38,7 +38,7 @@ function New-AzCostManagementQueryColumnObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn]::New() $Object.Name = $Name $Object.Type = $Type diff --git a/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 index 0e3d7f4eb685..30156bfb64c9 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for QueryComparisonExpression Create a in-memory object for QueryComparisonExpression .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression .Link https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject #> function New-AzCostManagementQueryComparisonExpressionObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -41,7 +41,7 @@ function New-AzCostManagementQueryComparisonExpressionObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression]::New() $Object.Name = $Name $Object.Operator = $Operator diff --git a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 index 26bcd54b0c2c..d07bd456a0f5 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 @@ -20,34 +20,34 @@ Create a in-memory object for QueryFilter. On a QueryFilter one and only one of Create a in-memory object for QueryFilter. On a QueryFilter one and only one of and/or/not/dimension/tag can be set. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter +Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter .Link https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject #> function New-AzCostManagementQueryFilterObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter')] [CmdletBinding(PositionalBinding=$false)] Param( [Parameter(HelpMessage="The logical `"AND`" expression. Must have at least 2 items.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[]] $And, [Parameter(HelpMessage="Has comparison expression for a dimension.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression] $Dimension, [Parameter(HelpMessage="The logical `"NOT`" expression.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter] $Not, [Parameter(HelpMessage="The logical `"OR`" expression. Must have at least 2 items.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[]] $Or, [Parameter(HelpMessage="Has comparison expression for a tag.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression] + [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression] $Tag ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter]::New() $Object.And = $And $Object.Dimension = $Dimension diff --git a/src/CostManagement/docs/Az.Cost.md b/src/CostManagement/docs/Az.Cost.md index 5b86051ab1b9..7b7a6fe59886 100644 --- a/src/CostManagement/docs/Az.Cost.md +++ b/src/CostManagement/docs/Az.Cost.md @@ -1,6 +1,6 @@ --- Module Name: Az.Cost -Module Guid: e68ffeab-c2c5-4869-9306-c48c496e0cfd +Module Guid: 3cca0b09-d91f-4cc1-aebd-6b1be566c631 Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.cost Help Version: 1.0.0.0 Locale: en-US @@ -15,10 +15,10 @@ Microsoft Azure PowerShell: Cost cmdlets The operation to get the export for the defined scope by export name. ### [Get-AzCostManagementExportExecutionHistory](Get-AzCostManagementExportExecutionHistory.md) -The operation to get the execution history of an export for the defined scope by export name. +The operation to get the execution history of an export for the defined scope and export name. ### [Invoke-AzCostManagementExecuteExport](Invoke-AzCostManagementExecuteExport.md) -The operation to execute a export. +The operation to execute an export. ### [Invoke-AzCostManagementUsageQuery](Invoke-AzCostManagementUsageQuery.md) Query the usage data for scope defined. @@ -36,7 +36,8 @@ Create a in-memory object for QueryColumn Create a in-memory object for QueryComparisonExpression ### [New-AzCostManagementQueryFilterObject](New-AzCostManagementQueryFilterObject.md) -Create a in-memory object for QueryFilter +Create a in-memory object for QueryFilter. +On a QueryFilter one and only one of and/or/not/dimension/tag can be set. ### [Remove-AzCostManagementExport](Remove-AzCostManagementExport.md) The operation to delete a export. diff --git a/src/CostManagement/docs/Get-AzCostManagementExport.md b/src/CostManagement/docs/Get-AzCostManagementExport.md index 62d9443ac1da..32bbc86e44f7 100644 --- a/src/CostManagement/docs/Get-AzCostManagementExport.md +++ b/src/CostManagement/docs/Get-AzCostManagementExport.md @@ -14,17 +14,20 @@ The operation to get the export for the defined scope by export name. ### List (Default) ``` -Get-AzCostManagementExport -Scope [-DefaultProfile ] [] +Get-AzCostManagementExport -Scope [-Expand ] [-DefaultProfile ] + [] ``` ### Get ``` -Get-AzCostManagementExport -Name -Scope [-DefaultProfile ] [] +Get-AzCostManagementExport -Name -Scope [-Expand ] [-DefaultProfile ] + [] ``` ### GetViaIdentity ``` -Get-AzCostManagementExport -InputObject [-DefaultProfile ] [] +Get-AzCostManagementExport -InputObject [-Expand ] [-DefaultProfile ] + [] ``` ## DESCRIPTION @@ -32,40 +35,23 @@ The operation to get the export for the defined scope by export name. ## EXAMPLES -### Example 1: Get all cost management exports under a subscription +### Example 1: {{ Add title here }} ```powershell -PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" +PS C:\> {{ Add code here }} -Name Type ----- ---- -TestExport Microsoft.CostManagement/exports -TestExport1 Microsoft.CostManagement/exports +{{ Add output here }} ``` -this command gets all cost management exports under a subscription. +{{ Add description here }} -### Example 2: Get a cost management export by name +### Example 2: {{ Add title here }} ```powershell -PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' +PS C:\> {{ Add code here }} -Name Type ----- ---- -TestExport Microsoft.CostManagement/exports +{{ Add output here }} ``` -This command gets a cost management export by name. - -### Example 3: Get a cost management export by object -```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' -PS C:\> Get-AzCostManagementExport -InputObject $export - -Name Type ----- ---- -TestExport Microsoft.CostManagement/exports -``` - -This command gets a cost management export by object. +{{ Add description here }} ## PARAMETERS @@ -84,6 +70,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Expand +May be used to expand the properties within an export. +Currently only 'runHistory' is supported and will return information for the last 10 executions of the export. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -InputObject Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. @@ -116,7 +118,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with query and export operations. +The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml @@ -140,7 +142,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExport +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExport ## NOTES diff --git a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md index bc7a61e0105a..7182ab91fe9f 100644 --- a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md +++ b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-AzCostManagementExportExecutionHistory ## SYNOPSIS -The operation to get the execution history of an export for the defined scope by export name. +The operation to get the execution history of an export for the defined scope and export name. ## SYNTAX @@ -25,34 +25,27 @@ Get-AzCostManagementExportExecutionHistory -InputObject [-Defaul ``` ## DESCRIPTION -The operation to get the execution history of an export for the defined scope by export name. +The operation to get the execution history of an export for the defined scope and export name. ## EXAMPLES -### Example 1: Get execution history of cost management export +### Example 1: {{ Add title here }} ```powershell -PS C:\> Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" +PS C:\> {{ Add code here }} -ExecutionType ProcessingStartTime ProcessingEndTime Status FileName -------------- ------------------- ----------------- ------ -------- -OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv -Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +{{ Add output here }} ``` -This command gets execution history of cost management export. +{{ Add description here }} -### Example 2: Get execution history of cost management export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" -PS C:\> $export | Get-AzCostManagementExportExecutionHistory -InputObject $export +PS C:\> {{ Add code here }} -ExecutionType ProcessingStartTime ProcessingEndTime Status FileName -------------- ------------------- ----------------- ------ -------- -OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv -Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +{{ Add output here }} ``` -This command gets execution history of cost management export by object. +{{ Add description here }} ## PARAMETERS @@ -103,7 +96,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with query and export operations. +The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml @@ -127,7 +120,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExportExecution +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExportExecution ## NOTES diff --git a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md index 4292ec7cd0af..18687a59f07a 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Invoke-AzCostManagementExecuteExport ## SYNOPSIS -The operation to execute a export. +The operation to execute an export. ## SYNTAX @@ -25,26 +25,27 @@ Invoke-AzCostManagementExecuteExport -InputObject [-DefaultProfi ``` ## DESCRIPTION -The operation to execute a export. +The operation to execute an export. ## EXAMPLES -### Example 1: Invoke a cost mangement export by name +### Example 1: {{ Add title here }} ```powershell -PS C:\> Invoke-AzCostManagementExecuteExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command invokes a cost mangement export by name. +{{ Add description here }} -### Example 2: Invoke a cost mangement export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' -PS C:\> Invoke-AzCostManagementExecuteExport -InputObject $export +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command invokes a cost mangement export by object. +{{ Add description here }} ## PARAMETERS @@ -110,7 +111,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with query and export operations. +The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml diff --git a/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md b/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md index 5d5d41a614d2..0049c9fd13ef 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md @@ -29,37 +29,24 @@ Invoke-AzCostManagementUsageQuery -ExternalCloudProviderId [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` -### UsageViaIdentityExpanded -``` -Invoke-AzCostManagementUsageQuery -InputObject -Timeframe -Type - [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] - [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] - [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] -``` - -### UsageViaIdentityExpanded1 -``` -Invoke-AzCostManagementUsageQuery -InputObject -Timeframe -Type - [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] - [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] - [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] -``` - ## DESCRIPTION Query the usage data for scope defined. ## EXAMPLES -### Example 1: Invoke query usage of the cost management export +### -------------------------- EXAMPLE 1 -------------------------- ```powershell -PS C:\> Invoke-AzCostManagementUsageQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'daily' +{{ Add code here }} +``` + +{{ Add output here }} -NextLink Column Row --------- ------ --- - {UsageDate, Currency} {20200701 USD, 20200702 USD, 20200703 USD, 20200704 USD…} +### -------------------------- EXAMPLE 2 -------------------------- +```powershell +{{ Add code here }} ``` -this command invokes query usage of the cost management export. +{{ Add output here }} ## PARAMETERS @@ -98,7 +85,7 @@ Has filter expression to use in the query. To construct, see NOTES section for DATASETFILTER properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter Parameter Sets: (All) Aliases: @@ -129,7 +116,7 @@ Array of group by expression to use in the query. To construct, see NOTES section for DATASETGROUPING properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[] +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryGrouping[] Parameter Sets: (All) Aliases: @@ -185,24 +172,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InputObject -Identity Parameter -To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity -Parameter Sets: UsageViaIdentityExpanded, UsageViaIdentityExpanded1 -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -Scope -The scope associated with query and export operations. +This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml Type: System.String @@ -312,11 +283,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryDefinition + ### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryResult +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult ## NOTES @@ -341,14 +314,5 @@ DATASETGROUPING : Array of group by expression to use in the q - `Name `: The name of the column to group. - `Type `: Has type of the column to group. -INPUTOBJECT : Identity Parameter - - `[AlertId ]`: Alert ID - - `[ExportName ]`: Export Name. - - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - - `[ExternalCloudProviderType ]`: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - - `[Id ]`: Resource identity path - - `[Scope ]`: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. - - `[ViewName ]`: View name - ## RELATED LINKS diff --git a/src/CostManagement/docs/New-AzCostManagementExport.md b/src/CostManagement/docs/New-AzCostManagementExport.md index bd0157d8f473..a7fa987c0133 100644 --- a/src/CostManagement/docs/New-AzCostManagementExport.md +++ b/src/CostManagement/docs/New-AzCostManagementExport.md @@ -17,10 +17,9 @@ Create operation does not require eTag. ``` New-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] - [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] - [-DatasetGrouping ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -33,48 +32,30 @@ Create operation does not require eTag. ## EXAMPLES -### Example 1: Create a cost management export for a subscription +### Example 1: {{ Add title here }} ```powershell -PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" -PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3388-4e19-88eb-0975f02ac87f" -Name costexport-test -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom (Get-Date).ToString() -RecurrencePeriodTo (Get-Date).AddDays(20).ToString() -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" +PS C:\> {{ Add code here }} -Name Type ----- ---- -costexport-test Microsoft.CostManagement/exports +{{ Add output here }} ``` -This command creates a cost management export for the resource group for a subscription. +{{ Add description here }} -### Example 2: Create a cost management export with custom column for the resource group +### Example 2: {{ Add title here }} ```powershell -PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" -PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') +PS C:\> {{ Add code here }} -Name Type ----- ---- -ps-customcolum-t Microsoft.CostManagement/exports +{{ Add output here }} ``` -This command creates a cost management export with custom column for the resource group. - -### Example 3: Create a cost management export with custom column for the resource group -```powershell -PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" -PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') - -Name Type ----- ---- -ps-customcolum-t Microsoft.CostManagement/exports -``` - -This command creates a cost management export with custom column for the resource group. +{{ Add description here }} ## PARAMETERS ### -ConfigurationColumn -Array of column names to be included in the query. -Any valid query column name is allowed. -If not provided, then query includes all columns. +Array of column names to be included in the export. +If not provided then the export will include all available columns. +The available columns can vary by customer channel (see examples). ```yaml Type: System.String[] @@ -88,41 +69,9 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DatasetAggregation -Dictionary of aggregation expression to use in the query. -The key of each item in the dictionary is the alias for the aggregated column. -Query can have up to 2 aggregation clauses. - -```yaml -Type: System.Collections.Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -DatasetFilter -Has filter expression to use in the query. -To construct, see NOTES section for DATASETFILTER properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -DatasetGranularity -The granularity of rows in the query. +### -DataSetGranularity +The granularity of rows in the export. +Currently only 'Daily' is supported. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType @@ -136,23 +85,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DatasetGrouping -Array of group by expression to use in the query. -Query can have up to 2 group by clauses. -To construct, see NOTES section for DATASETGROUPING properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -169,7 +101,7 @@ Accept wildcard characters: False ``` ### -DefinitionTimeframe -The time frame for pulling data for the query. +The time frame for pulling data for the export. If custom, then a specific time period must be provided. ```yaml @@ -185,7 +117,8 @@ Accept wildcard characters: False ``` ### -DefinitionType -The type of the query. +The type of the export. +Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType @@ -244,8 +177,25 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ETag +eTag of the resource. +To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Format The format of the export being delivered. +Currently only 'Csv' is supported. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType @@ -320,9 +270,8 @@ Accept wildcard characters: False ``` ### -ScheduleStatus -The status of the schedule. -Whether active or not. -If inactive, the export's scheduled execution is paused. +The status of the export's schedule. +If 'Inactive', the export's schedule is paused. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType @@ -337,7 +286,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with query and export operations. +The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml @@ -353,7 +302,7 @@ Accept wildcard characters: False ``` ### -TimePeriodFrom -The start date to pull data from. +The start date for export data. ```yaml Type: System.DateTime @@ -368,7 +317,7 @@ Accept wildcard characters: False ``` ### -TimePeriodTo -The end date to pull data to. +The end date for export data. ```yaml Type: System.DateTime @@ -420,30 +369,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExport +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExport ## NOTES ALIASES -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - - -DATASETFILTER : Has filter expression to use in the query. - - `[And ]`: The logical "AND" expression. Must have at least 2 items. - - `[Dimension ]`: Has comparison expression for a dimension - - `Name `: The name of the column to use in comparison. - - `Operator `: The operator to use for comparison. - - `Value `: Array of values to use for comparison - - `[Not ]`: The logical "NOT" expression. - - `[Or ]`: The logical "OR" expression. Must have at least 2 items. - - `[Tag ]`: Has comparison expression for a tag - -DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. - - `Name `: The name of the column to group. - - `Type `: Has type of the column to group. - ## RELATED LINKS diff --git a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md index 8e945d1febd0..abdd9f87adfc 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md @@ -71,7 +71,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryColumn +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn ## NOTES diff --git a/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md b/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md index 8c5fdaa4dcaf..928e1a21c50c 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md @@ -87,7 +87,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression ## NOTES diff --git a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md index 155f6a51c902..9a14f00324c3 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md @@ -8,7 +8,8 @@ schema: 2.0.0 # New-AzCostManagementQueryFilterObject ## SYNOPSIS -Create a in-memory object for QueryFilter +Create a in-memory object for QueryFilter. +On a QueryFilter one and only one of and/or/not/dimension/tag can be set. ## SYNTAX @@ -18,7 +19,8 @@ New-AzCostManagementQueryFilterObject [-And ] [-Dimension $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Envi PS C:\> New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) And : -Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression -Not : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter -Or : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter} -Tag : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression +Not : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter +Or : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter} +Tag : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression ``` this command creates a filter object of query for cost management export. @@ -45,7 +47,7 @@ Must have at least 2 items. To construct, see NOTES section for AND properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[] +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[] Parameter Sets: (All) Aliases: @@ -61,7 +63,7 @@ Has comparison expression for a dimension. To construct, see NOTES section for DIMENSION properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression Parameter Sets: (All) Aliases: @@ -77,7 +79,7 @@ The logical "NOT" expression. To construct, see NOTES section for NOT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter Parameter Sets: (All) Aliases: @@ -94,7 +96,7 @@ Must have at least 2 items. To construct, see NOTES section for OR properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter[] +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[] Parameter Sets: (All) Aliases: @@ -110,7 +112,7 @@ Has comparison expression for a tag. To construct, see NOTES section for TAG properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryComparisonExpression +Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression Parameter Sets: (All) Aliases: @@ -128,7 +130,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter ## NOTES diff --git a/src/CostManagement/docs/Remove-AzCostManagementExport.md b/src/CostManagement/docs/Remove-AzCostManagementExport.md index 4fa7d6859e00..fc23a1297789 100644 --- a/src/CostManagement/docs/Remove-AzCostManagementExport.md +++ b/src/CostManagement/docs/Remove-AzCostManagementExport.md @@ -29,22 +29,23 @@ The operation to delete a export. ## EXAMPLES -### Example 1: Remove a cost management export by name +### Example 1: {{ Add title here }} ```powershell -PS C:\> Remove-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T01 +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command removes a cost management export by name +{{ Add description here }} -### Example 2: Remove a cost management export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T02 -PS C:\> Remove-AzCostManagementExport -InputObject $export +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command removes a cost management export by object +{{ Add description here }} ## PARAMETERS @@ -110,7 +111,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with query and export operations. +The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml diff --git a/src/CostManagement/docs/Update-AzCostManagementExport.md b/src/CostManagement/docs/Update-AzCostManagementExport.md index a070d66d45c3..bc868c62bce1 100644 --- a/src/CostManagement/docs/Update-AzCostManagementExport.md +++ b/src/CostManagement/docs/Update-AzCostManagementExport.md @@ -18,10 +18,9 @@ Create operation does not require eTag. ### UpdateExpanded (Default) ``` Update-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] - [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] - [-DatasetGrouping ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -29,10 +28,9 @@ Update-AzCostManagementExport -Name -Scope [-ConfigurationColu ### UpdateViaIdentityExpanded ``` Update-AzCostManagementExport -InputObject [-ConfigurationColumn ] - [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] - [-DatasetGrouping ] [-DefinitionTimeframe ] [-DefinitionType ] + [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -45,30 +43,30 @@ Create operation does not require eTag. ## EXAMPLES -### Example 1: Update a cost management export by name +### Example 1: {{ Add title here }} ```powershell -PS C:\> Update-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t -RecurrencePeriodFrom (Get-Date).ToString() +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command updates a cost management export by name. +{{ Add description here }} -### Example 2: Update a cost management export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t -PS C:\> Update-AzCostManagementExport -InputObject $export -RecurrencePeriodFrom (Get-Date).ToString() +PS C:\> {{ Add code here }} {{ Add output here }} ``` -This command updates a cost management export by object. +{{ Add description here }} ## PARAMETERS ### -ConfigurationColumn -Array of column names to be included in the query. -Any valid query column name is allowed. -If not provided, then query includes all columns. +Array of column names to be included in the export. +If not provided then the export will include all available columns. +The available columns can vary by customer channel (see examples). ```yaml Type: System.String[] @@ -82,41 +80,9 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DatasetAggregation -Dictionary of aggregation expression to use in the query. -The key of each item in the dictionary is the alias for the aggregated column. -Query can have up to 2 aggregation clauses. - -```yaml -Type: System.Collections.Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -DatasetFilter -Has filter expression to use in the query. -To construct, see NOTES section for DATASETFILTER properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryFilter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -DatasetGranularity -The granularity of rows in the query. +### -DataSetGranularity +The granularity of rows in the export. +Currently only 'Daily' is supported. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType @@ -130,23 +96,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DatasetGrouping -Array of group by expression to use in the query. -Query can have up to 2 group by clauses. -To construct, see NOTES section for DATASETGROUPING properties and create a hash table. - -```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IQueryGrouping[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -163,7 +112,7 @@ Accept wildcard characters: False ``` ### -DefinitionTimeframe -The time frame for pulling data for the query. +The time frame for pulling data for the export. If custom, then a specific time period must be provided. ```yaml @@ -179,7 +128,8 @@ Accept wildcard characters: False ``` ### -DefinitionType -The type of the query. +The type of the export. +Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType @@ -238,8 +188,25 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ETag +eTag of the resource. +To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Format The format of the export being delivered. +Currently only 'Csv' is supported. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType @@ -330,9 +297,8 @@ Accept wildcard characters: False ``` ### -ScheduleStatus -The status of the schedule. -Whether active or not. -If inactive, the export's scheduled execution is paused. +The status of the export's schedule. +If 'Inactive', the export's schedule is paused. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType @@ -347,7 +313,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with query and export operations. +The scope associated with export operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ```yaml @@ -363,7 +329,7 @@ Accept wildcard characters: False ``` ### -TimePeriodFrom -The start date to pull data from. +The start date for export data. ```yaml Type: System.DateTime @@ -378,7 +344,7 @@ Accept wildcard characters: False ``` ### -TimePeriodTo -The end date to pull data to. +The end date for export data. ```yaml Type: System.DateTime @@ -432,7 +398,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.IExport +### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExport ## NOTES @@ -443,20 +409,6 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -DATASETFILTER : Has filter expression to use in the query. - - `[And ]`: The logical "AND" expression. Must have at least 2 items. - - `[Dimension ]`: Has comparison expression for a dimension - - `Name `: The name of the column to use in comparison. - - `Operator `: The operator to use for comparison. - - `Value `: Array of values to use for comparison - - `[Not ]`: The logical "NOT" expression. - - `[Or ]`: The logical "OR" expression. Must have at least 2 items. - - `[Tag ]`: Has comparison expression for a tag - -DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. - - `Name `: The name of the column to group. - - `Type `: Has type of the column to group. - INPUTOBJECT : Identity Parameter - `[AlertId ]`: Alert ID - `[ExportName ]`: Export Name. diff --git a/src/CostManagement/docs/readme.md b/src/CostManagement/docs/readme.md index f4b0a6692c57..98a6db4998bc 100644 --- a/src/CostManagement/docs/readme.md +++ b/src/CostManagement/docs/readme.md @@ -1,5 +1,5 @@ # Docs -This directory contains the documentation of the cmdlets for the `Az.Cost` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `../examples` folder. +This directory contains the documentation of the cmdlets for the `Az.Cost` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. ## Info - Modifiable: no @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Cost` modul - Packaged: yes ## Details -The process of documentation generation loads `Az.Cost` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.Cost` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/CostManagement/examples/Get-AzCostManagementExport.md b/src/CostManagement/examples/Get-AzCostManagementExport.md index 9284c2af98bc..093355d11d50 100644 --- a/src/CostManagement/examples/Get-AzCostManagementExport.md +++ b/src/CostManagement/examples/Get-AzCostManagementExport.md @@ -1,35 +1,18 @@ -### Example 1: Get all cost management exports under a subscription +### Example 1: {{ Add title here }} ```powershell -PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" +PS C:\> {{ Add code here }} -Name Type ----- ---- -TestExport Microsoft.CostManagement/exports -TestExport1 Microsoft.CostManagement/exports +{{ Add output here }} ``` -this command gets all cost management exports under a subscription. +{{ Add description here }} -### Example 2: Get a cost management export by name +### Example 2: {{ Add title here }} ```powershell -PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' +PS C:\> {{ Add code here }} -Name Type ----- ---- -TestExport Microsoft.CostManagement/exports +{{ Add output here }} ``` -This command gets a cost management export by name. - -### Example 3: Get a cost management export by object -```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name 'TestExport' -PS C:\> Get-AzCostManagementExport -InputObject $export - -Name Type ----- ---- -TestExport Microsoft.CostManagement/exports -``` - -This command gets a cost management export by object. +{{ Add description here }} diff --git a/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md index ac37f614271f..093355d11d50 100644 --- a/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md +++ b/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md @@ -1,25 +1,18 @@ -### Example 1: Get execution history of cost management export +### Example 1: {{ Add title here }} ```powershell -PS C:\> Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" +PS C:\> {{ Add code here }} -ExecutionType ProcessingStartTime ProcessingEndTime Status FileName -------------- ------------------- ----------------- ------ -------- -OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv -Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +{{ Add output here }} ``` -This command gets execution history of cost management export. +{{ Add description here }} -### Example 2: Get execution history of cost management export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" -PS C:\> $export | Get-AzCostManagementExportExecutionHistory -InputObject $export +PS C:\> {{ Add code here }} -ExecutionType ProcessingStartTime ProcessingEndTime Status FileName -------------- ------------------- ----------------- ------ -------- -OnDemand 6/29/2020 6:03:26 AM 6/29/2020 6:04:28 AM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_041c4d56-f25e-4e37-99fb-ab201309e07f.csv -Scheduled 6/30/2020 12:02:53 PM 6/30/2020 12:03:34 PM Completed ad-hoc/ps-customcolum-t/20200601-20200630/ps-customcolum-t_cd5bd8b1-014f-4521-b20a-69168288263d.csv +{{ Add output here }} ``` -This command gets execution history of cost management export by object. +{{ Add description here }} diff --git a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md index 098474f3093f..093355d11d50 100644 --- a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md @@ -1,17 +1,18 @@ -### Example 1: Invoke a cost mangement export by name +### Example 1: {{ Add title here }} ```powershell -PS C:\> Invoke-AzCostManagementExecuteExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command invokes a cost mangement export by name. +{{ Add description here }} -### Example 2: Invoke a cost mangement export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName 'TestExport' -PS C:\> Invoke-AzCostManagementExecuteExport -InputObject $export +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command invokes a cost mangement export by object. +{{ Add description here }} diff --git a/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md b/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md index 5ec9865f3c8c..093355d11d50 100644 --- a/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md +++ b/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md @@ -1,12 +1,18 @@ -### Example 1: Invoke query usage of the cost management export +### Example 1: {{ Add title here }} ```powershell -PS C:\> Invoke-AzCostManagementUsageQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'daily' +PS C:\> {{ Add code here }} -NextLink Column Row --------- ------ --- - {UsageDate, Currency} {20200701 USD, 20200702 USD, 20200703 USD, 20200704 USD…} +{{ Add output here }} ``` -this command invokes query usage of the cost management export. +{{ Add description here }} +### Example 2: {{ Add title here }} +```powershell +PS C:\> {{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} diff --git a/src/CostManagement/examples/New-AzCostManagementExport.md b/src/CostManagement/examples/New-AzCostManagementExport.md index 17fbb44a71e2..093355d11d50 100644 --- a/src/CostManagement/examples/New-AzCostManagementExport.md +++ b/src/CostManagement/examples/New-AzCostManagementExport.md @@ -1,37 +1,18 @@ -### Example 1: Create a cost management export for a subscription +### Example 1: {{ Add title here }} ```powershell -PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" -PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3388-4e19-88eb-0975f02ac87f" -Name costexport-test -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom (Get-Date).ToString() -RecurrencePeriodTo (Get-Date).AddDays(20).ToString() -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" +PS C:\> {{ Add code here }} -Name Type ----- ---- -costexport-test Microsoft.CostManagement/exports +{{ Add output here }} ``` -This command creates a cost management export for the resource group for a subscription. +{{ Add description here }} -### Example 2: Create a cost management export with custom column for the resource group +### Example 2: {{ Add title here }} ```powershell -PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" -PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') +PS C:\> {{ Add code here }} -Name Type ----- ---- -ps-customcolum-t Microsoft.CostManagement/exports +{{ Add output here }} ``` -This command creates a cost management export with custom column for the resource group. - -### Example 3: Create a cost management export with custom column for the resource group -```powershell -PS C:\> $storageAccount = Get-AzStorageAccount -ResourceGroupName "RG01" -Name "mystorageaccount" -PS C:\> New-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azps-rg-t" -Name "ps-customcolum-t" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" -DestinationResourceId $storageAccount.Id -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -ConfigurationColumn @('SubscriptionGuid', 'MeterId', 'InstanceId', 'ResourceGroup', 'PreTaxCost') - -Name Type ----- ---- -ps-customcolum-t Microsoft.CostManagement/exports -``` - -This command creates a cost management export with custom column for the resource group. - +{{ Add description here }} diff --git a/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md index 7529b75a1502..08f45c24370c 100644 --- a/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md +++ b/src/CostManagement/examples/New-AzCostManagementQueryFilterObject.md @@ -5,10 +5,10 @@ PS C:\> $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Envi PS C:\> New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) And : -Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression -Not : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter -Or : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryFilter} -Tag : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20191101.QueryComparisonExpression +Dimension : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression +Not : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter +Or : {Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter, Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter} +Tag : Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression ``` this command creates a filter object of query for cost management export. diff --git a/src/CostManagement/examples/Remove-AzCostManagementExport.md b/src/CostManagement/examples/Remove-AzCostManagementExport.md index 659951472332..093355d11d50 100644 --- a/src/CostManagement/examples/Remove-AzCostManagementExport.md +++ b/src/CostManagement/examples/Remove-AzCostManagementExport.md @@ -1,17 +1,18 @@ -### Example 1: Remove a cost management export by name +### Example 1: {{ Add title here }} ```powershell -PS C:\> Remove-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T01 +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command removes a cost management export by name +{{ Add description here }} -### Example 2: Remove a cost management export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name AzureExport-T02 -PS C:\> Remove-AzCostManagementExport -InputObject $export +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command removes a cost management export by object +{{ Add description here }} diff --git a/src/CostManagement/examples/Update-AzCostManagementExport.md b/src/CostManagement/examples/Update-AzCostManagementExport.md index c9c388d50cb2..093355d11d50 100644 --- a/src/CostManagement/examples/Update-AzCostManagementExport.md +++ b/src/CostManagement/examples/Update-AzCostManagementExport.md @@ -1,18 +1,18 @@ -### Example 1: Update a cost management export by name +### Example 1: {{ Add title here }} ```powershell -PS C:\> Update-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t -RecurrencePeriodFrom (Get-Date).ToString() +PS C:\> {{ Add code here }} +{{ Add output here }} ``` -This command updates a cost management export by name. +{{ Add description here }} -### Example 2: Update a cost management export by object +### Example 2: {{ Add title here }} ```powershell -PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name exportinfo-ps-t -PS C:\> Update-AzCostManagementExport -InputObject $export -RecurrencePeriodFrom (Get-Date).ToString() +PS C:\> {{ Add code here }} {{ Add output here }} ``` -This command updates a cost management export by object. +{{ Add description here }} diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 9296f093685d..41d725822db5 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -17,7 +17,7 @@ This directory contains the PowerShell module for the Cost service. This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. ## Module Requirements -- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.8.1 or greater ## Authentication AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. @@ -48,7 +48,8 @@ In this directory, run AutoRest: require: - $(this-folder)/../readme.azure.noprofile.md input-file: - - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2019-11-01/costmanagement.json + - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json + - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json # - $(this-folder)/resources/costmanagement.json title: CostManagement module-version: 0.1.0 @@ -74,16 +75,16 @@ directive: - where: subject: UsageQuery verb: invoke - hide: true + remove: true - where: subject: ByDimensionExternalCloudProviderType|CloudForecast|DismissAlert|Forecast verb: Invoke remove: true - - where: - subject: Export|ExportExecutionHistory|ExportExecution - parameter-name: Scope - set: - parameter-name: ABC + # - where: + # subject: Export|ExportExecutionHistory|ExportExecution + # parameter-name: Scope + # set: + # parameter-name: ABC # parameter-description: This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. - from: source-file-csharp where: $ diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 index 81f99779c07f..04bfb85155c2 100644 --- a/src/CostManagement/resources/Create.ps1 +++ b/src/CostManagement/resources/Create.ps1 @@ -10,11 +10,11 @@ $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} $Aggregation2 = @{ name = 'Cost'; function='sum'} $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} -New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExportDatasetAggregation" ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-07-03T20:00:00Z" ` - -RecurrencePeriodTo "2020-07-10T00:00:00Z" -Format "Csv" ` +New-AzCostManagementExport -Debug -Scope "subscriptions/6b085460-5f21-477e-ba44-1035046e9101" -Name "TestExportDatasetAggregationInfo" ` + -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-11-03T20:00:00Z" ` + -RecurrencePeriodTo "2020-11-10T00:00:00Z" -Format "Csv" ` -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" -DatasetAggregation $AggregationDict + -DatasetGranularity "Daily" -ETag "test" # -DatasetAggregation $AggregationDict # Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file From 968baaa60ac61f97d22d047de5ba9bb7fadf384c Mon Sep 17 00:00:00 2001 From: wyunchi-ms Date: Tue, 3 Nov 2020 16:29:26 +0800 Subject: [PATCH 11/17] Update api-version --- src/CostManagement/resources/Query.ps1 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/CostManagement/resources/Query.ps1 diff --git a/src/CostManagement/resources/Query.ps1 b/src/CostManagement/resources/Query.ps1 new file mode 100644 index 000000000000..39c0bc6832b1 --- /dev/null +++ b/src/CostManagement/resources/Query.ps1 @@ -0,0 +1,4 @@ +$Aggregation1 = @{ name = 'Cost' } +$AggregationDict = @{total=$aggregation1;} +$group = @{name='ResourceGroup'; type='Dimension'} +Invoke-AzCostManagementUsageQuery -Type Usage -Scope "subscriptions/6b085460-5f21-477e-ba44-1035046e9101" -DatasetGranularity 'Daily' -Debug -TimePeriodFrom "2020-08-03T20:00:00Z" -TimePeriodTo "2020-11-10T00:00:00Z" -Timeframe Custom -DatasetAggregation $AggregationDict -DatasetGrouping @($group) \ No newline at end of file From 03dca41e79af3ffd440cec6f818551bd4932afe5 Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 18 Nov 2020 16:59:14 +0800 Subject: [PATCH 12/17] Add generate code and tests for costmanagement --- src/CostManagement/.gitattributes | 1 + src/CostManagement/.gitignore | 15 + src/CostManagement/Az.CostManagement.psd1 | 24 ++ ...y.ps1 => Invoke-AzCostManagementQuery.ps1} | 86 ++--- .../custom/New-AzCostManagementExport.ps1 | 244 +++++++++++++++ .../New-AzCostManagementQueryColumnObject.ps1 | 6 +- ...agementQueryComparisonExpressionObject.ps1 | 8 +- .../New-AzCostManagementQueryFilterObject.ps1 | 16 +- .../custom/Update-AzCostManagementExport.ps1 | 294 ++++++++++++++++++ src/CostManagement/custom/readme.md | 22 +- .../docs/{Az.Cost.md => Az.CostManagement.md} | 12 +- .../docs/Get-AzCostManagementExport.md | 41 +-- ...-AzCostManagementExportExecutionHistory.md | 54 ++-- .../Invoke-AzCostManagementExecuteExport.md | 30 +- ...ery.md => Invoke-AzCostManagementQuery.md} | 50 +-- .../docs/New-AzCostManagementExport.md | 45 +-- .../New-AzCostManagementQueryColumnObject.md | 4 +- ...nagementQueryComparisonExpressionObject.md | 6 +- .../New-AzCostManagementQueryFilterObject.md | 14 +- .../docs/Remove-AzCostManagementExport.md | 34 +- .../docs/Update-AzCostManagementExport.md | 55 ++-- src/CostManagement/docs/readme.md | 4 +- .../examples/Get-AzCostManagementExport.md | 22 +- ...-AzCostManagementExportExecutionHistory.md | 23 +- .../Invoke-AzCostManagementExecuteExport.md | 13 +- .../examples/Invoke-AzCostManagementQuery.md | 21 ++ .../Invoke-AzCostManagementUsageQuery.md | 18 -- .../examples/New-AzCostManagementExport.md | 19 +- .../examples/Remove-AzCostManagementExport.md | 17 +- .../examples/Update-AzCostManagementExport.md | 21 +- src/CostManagement/how-to.md | 58 ++++ src/CostManagement/license.txt | 227 ++++++++++++++ src/CostManagement/readme.md | 28 +- src/CostManagement/resources/Create.ps1 | 4 +- src/CostManagement/resources/Query.ps1 | 2 +- .../Get-AzCostManagementExport.Recording.json | 116 +++---- ...ementExportExecutionHistory.Recording.json | 87 +++--- ...ManagementExportExecutionHistory.Tests.ps1 | 4 +- ...CostManagementExecuteExport.Recording.json | 135 ++++---- ...ke-AzCostManagementExecuteExport.Tests.ps1 | 4 +- .../Invoke-AzCostManagementQuery.Tests.ps1 | 25 ++ ...nvoke-AzCostManagementUsageQuery.Tests.ps1 | 20 -- .../New-AzCostManagementExport.Recording.json | 164 +++------- .../test/New-AzCostManagementExport.Tests.ps1 | 59 +--- ...move-AzCostManagementExport.Recording.json | 135 ++++---- ...date-AzCostManagementExport.Recording.json | 118 +++++++ .../Update-AzCostManagementExport.Tests.ps1 | 16 +- src/CostManagement/test/env.json | 22 +- src/CostManagement/test/readme.md | 2 +- src/CostManagement/test/utils.ps1 | 15 +- 50 files changed, 1675 insertions(+), 785 deletions(-) create mode 100644 src/CostManagement/.gitattributes create mode 100644 src/CostManagement/.gitignore create mode 100644 src/CostManagement/Az.CostManagement.psd1 rename src/CostManagement/custom/{Invoke-AzCostManagementUsageQuery.ps1 => Invoke-AzCostManagementQuery.ps1} (82%) create mode 100644 src/CostManagement/custom/New-AzCostManagementExport.ps1 create mode 100644 src/CostManagement/custom/Update-AzCostManagementExport.ps1 rename src/CostManagement/docs/{Az.Cost.md => Az.CostManagement.md} (88%) rename src/CostManagement/docs/{Invoke-AzCostManagementUsageQuery.md => Invoke-AzCostManagementQuery.md} (81%) create mode 100644 src/CostManagement/examples/Invoke-AzCostManagementQuery.md delete mode 100644 src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md create mode 100644 src/CostManagement/how-to.md create mode 100644 src/CostManagement/license.txt create mode 100644 src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 delete mode 100644 src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 create mode 100644 src/CostManagement/test/Update-AzCostManagementExport.Recording.json diff --git a/src/CostManagement/.gitattributes b/src/CostManagement/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/src/CostManagement/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/src/CostManagement/.gitignore b/src/CostManagement/.gitignore new file mode 100644 index 000000000000..aa1432babfa4 --- /dev/null +++ b/src/CostManagement/.gitignore @@ -0,0 +1,15 @@ +bin +obj +.vs +generated +internal +exports +tools +custom/*.psm1 +test/*-TestResults.xml +/*.ps1 +/*.ps1xml +/*.psm1 +/*.snk +/*.csproj +/*.nuspec \ No newline at end of file diff --git a/src/CostManagement/Az.CostManagement.psd1 b/src/CostManagement/Az.CostManagement.psd1 new file mode 100644 index 000000000000..2529f7f1c742 --- /dev/null +++ b/src/CostManagement/Az.CostManagement.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '4cd9af10-559e-4fb9-8dcd-d3e8eb9e03b7' + RootModule = './Az.CostManagement.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: Cost cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.CostManagement.private.dll' + FormatsToProcess = './Az.CostManagement.format.ps1xml' + FunctionsToExport = 'Get-AzCostManagementExport', 'Get-AzCostManagementExportExecutionHistory', 'Invoke-AzCostManagementExecuteExport', 'Invoke-AzCostManagementQuery', 'New-AzCostManagementExport', 'New-AzCostManagementQueryColumnObject', 'New-AzCostManagementQueryComparisonExpressionObject', 'New-AzCostManagementQueryFilterObject', 'Remove-AzCostManagementExport', 'Update-AzCostManagementExport', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Cost' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 similarity index 82% rename from src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 rename to src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 index 6f6e45aa040b..8e6e17883394 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementUsageQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 @@ -28,11 +28,11 @@ PS C:\> {{ Add code here }} {{ Add output here }} .Inputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryDefinition +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryDefinition .Inputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult .Notes COMPLEX PARAMETER PROPERTIES @@ -85,51 +85,51 @@ PARAMETER : The definition of a query. .Link https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery #> -function Invoke-AzCostManagementUsageQuery { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult])] +function Invoke-AzCostManagementQuery { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult])] [CmdletBinding(DefaultParameterSetName='UsageExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] # The scope associated with query and export operations. # This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. ${Scope}, [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] [System.String] # This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. ${ExternalCloudProviderId}, [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The external cloud provider type associated with dimension/query operations.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType])] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType] # The external cloud provider type associated with dimension/query operations. # This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. ${ExternalCloudProviderType}, [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The time frame for pulling data for the query.")] [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The time frame for pulling data for the query.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType])] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] # The time frame for pulling data for the query. # If custom, then a specific time period must be provided. ${Timeframe}, [Parameter(ParameterSetName='UsageExpanded', Mandatory, HelpMessage="The type of the query.")] [Parameter(ParameterSetName='UsageExpanded1', Mandatory, HelpMessage="The type of the query.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType])] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] # The type of the query. ${Type}, [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Array of column names to be included in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of column names to be included in the query.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.String[]] # Array of column names to be included in the query. # Any valid query column name is allowed. @@ -138,8 +138,8 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Dictionary of aggregation expression to use in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Dictionary of aggregation expression to use in the query.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryDatasetAggregation]))] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryDatasetAggregation]))] [System.Collections.Hashtable] # Dictionary of aggregation expression to use in the query. # The key of each item in the dictionary is the alias for the aggregated column. @@ -148,24 +148,24 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="Has filter expression to use in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Has filter expression to use in the query.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter] # Has filter expression to use in the query. # To construct, see NOTES section for DATASETFILTER properties and create a hash table. ${DatasetFilter}, [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The granularity of rows in the query.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The granularity of rows in the query.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType])] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] # The granularity of rows in the query. ${DatasetGranularity}, [Parameter(ParameterSetName='UsageExpanded', HelpMessage='Array of group by expression to use in the query.')] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="Array of group by expression to use in the query.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryGrouping[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryGrouping[]] # Array of group by expression to use in the query. # Query can have up to 2 group by clauses. # To construct, see NOTES section for DATASETGROUPING properties and create a hash table. @@ -173,14 +173,14 @@ param( [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The start date to pull data from.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The start date to pull data from.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The start date to pull data from. ${TimePeriodFrom}, [Parameter(ParameterSetName='UsageExpanded', HelpMessage="The end date to pull data to.")] [Parameter(ParameterSetName='UsageExpanded1', HelpMessage="The end date to pull data to.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] [System.DateTime] # The end date to pull data to. ${TimePeriodTo}, @@ -188,46 +188,46 @@ param( [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Azure')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] [System.Management.Automation.PSObject] # The credentials, account, tenant, and subscription used for communication with Azure. ${DefaultProfile}, [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Runtime.SendAsyncStep[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} @@ -244,7 +244,7 @@ param( "$Scope/providers/Microsoft.CostManagement/query?api-version=$ApiVersion", "\\?&*$|&*$|(\\?)&+|(&)&+","$1$2") } - $Request = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryDefinition]::New() + $Request = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryDefinition]::New() if ($PSBoundParameters.ContainsKey('ConfigurationColumn')) { $Request.ConfigurationColumn = $ConfigurationColumn } @@ -272,7 +272,7 @@ param( if ($PSBoundParameters.ContainsKey('Type')) { $Request.Type = $Type } - $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryResult]::New() + $Result = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryResult]::New() $SkipToken = $null $RowList = New-Object System.Collections.Generic.List[System.Collections.Generic.List[string]] while ($true) { @@ -294,7 +294,7 @@ param( } function Invoke-AzCostManagementUsageQueryInternal { - [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult])] + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult])] param( [System.String] ${URL}, @@ -311,16 +311,16 @@ function Invoke-AzCostManagementUsageQueryInternal { } $ResponseContent = (Invoke-AzRest -Path $URL -Payload $Payload -Method POST).Content | ConvertFrom-Json - $Result = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryResult]::New() + $Result = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryResult]::New() if ($null -ne $ResponseContent.Properties.NextLink) { $Result.NextLink = $ResponseContent.Properties.NextLink.split('&')[1] } - $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryColumn] + $ColumnList = New-Object System.Collections.Generic.List[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryColumn] foreach ($Column in $ResponseContent.Properties.Columns) { Write-Host $Column.ToString() - $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn]::New() + $QueryColumn = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn]::New() $QueryColumn.Name = $Column.Name $QueryColumn.Type = $Column.Type $ColumnList.Add($QueryColumn) diff --git a/src/CostManagement/custom/New-AzCostManagementExport.ps1 b/src/CostManagement/custom/New-AzCostManagementExport.ps1 new file mode 100644 index 000000000000..c7161bec1291 --- /dev/null +++ b/src/CostManagement/custom/New-AzCostManagementExport.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. +.Description +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport +.Link +https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/new-azcostmanagementexport +#> +function New-AzCostManagementExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [System.String] + # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. + ${Scope}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String[]] + # Array of column names to be included in the export. + # If not provided then the export will include all available columns. + # The available columns can vary by customer channel (see examples). + ${ConfigurationColumn}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + # The granularity of rows in the export. + # Currently only 'Daily' is supported. + ${DataSetGranularity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + # The time frame for pulling data for the export. + # If custom, then a specific time period must be provided. + ${DefinitionTimeframe}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + # The type of the export. + # Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. + ${DefinitionType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The name of the container where exports will be uploaded. + ${DestinationContainer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The resource id of the storage account where exports will be delivered. + ${DestinationResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The name of the directory where exports will be uploaded. + ${DestinationRootFolderPath}, + + # [Parameter()] + # [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + # [System.String] + # # eTag of the resource. + # # To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + # ${ETag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + # The format of the export being delivered. + # Currently only 'Csv' is supported. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The start date of recurrence. + ${RecurrencePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The end date of recurrence. + ${RecurrencePeriodTo}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + # The schedule recurrence. + ${ScheduleRecurrence}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + # The status of the export's schedule. + # If 'Inactive', the export's schedule is paused. + ${ScheduleStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The start date for export data. + ${TimePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The end date for export data. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ + CreateExpanded = 'Az.CostManagement.private\New-AzCostManagementExport_CreateExpanded'; + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end { + try { + $steppablePipeline.End() + } catch { + throw + } +} +} diff --git a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 index 587fd453c10f..a34ab560ee1a 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for QueryColumn Create a in-memory object for QueryColumn .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn .Link https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject #> function New-AzCostManagementQueryColumnObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -38,7 +38,7 @@ function New-AzCostManagementQueryColumnObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn]::New() $Object.Name = $Name $Object.Type = $Type diff --git a/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 index 30156bfb64c9..ea1030077d7f 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryComparisonExpressionObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for QueryComparisonExpression Create a in-memory object for QueryComparisonExpression .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryComparisonExpression .Link https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject #> function New-AzCostManagementQueryComparisonExpressionObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryComparisonExpression')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -33,7 +33,7 @@ function New-AzCostManagementQueryComparisonExpressionObject { [string] $Name, [Parameter(Mandatory, HelpMessage="The operator to use for comparison.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType] $Operator, [Parameter(Mandatory, HelpMessage="Array of values to use for comparison.")] [string[]] @@ -41,7 +41,7 @@ function New-AzCostManagementQueryComparisonExpressionObject { ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryComparisonExpression]::New() $Object.Name = $Name $Object.Operator = $Operator diff --git a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 index d07bd456a0f5..de1ddccc0955 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 @@ -20,34 +20,34 @@ Create a in-memory object for QueryFilter. On a QueryFilter one and only one of Create a in-memory object for QueryFilter. On a QueryFilter one and only one of and/or/not/dimension/tag can be set. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryFilter .Link https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject #> function New-AzCostManagementQueryFilterObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryFilter')] [CmdletBinding(PositionalBinding=$false)] Param( [Parameter(HelpMessage="The logical `"AND`" expression. Must have at least 2 items.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter[]] $And, [Parameter(HelpMessage="Has comparison expression for a dimension.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryComparisonExpression] $Dimension, [Parameter(HelpMessage="The logical `"NOT`" expression.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter] $Not, [Parameter(HelpMessage="The logical `"OR`" expression. Must have at least 2 items.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[]] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter[]] $Or, [Parameter(HelpMessage="Has comparison expression for a tag.")] - [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryComparisonExpression] $Tag ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryFilter]::New() $Object.And = $And $Object.Dimension = $Dimension diff --git a/src/CostManagement/custom/Update-AzCostManagementExport.ps1 b/src/CostManagement/custom/Update-AzCostManagementExport.ps1 new file mode 100644 index 000000000000..3fec2b6d7d19 --- /dev/null +++ b/src/CostManagement/custom/Update-AzCostManagementExport.ps1 @@ -0,0 +1,294 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. +.Description +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [ExportName ]: Export Name. + [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [Id ]: Resource identity path + [Scope ]: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/update-azcostmanagementexport +#> +function Update-AzCostManagementExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [System.String] + # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String[]] + # Array of column names to be included in the export. + # If not provided then the export will include all available columns. + # The available columns can vary by customer channel (see examples). + ${ConfigurationColumn}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + # The granularity of rows in the export. + # Currently only 'Daily' is supported. + ${DataSetGranularity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + # The time frame for pulling data for the export. + # If custom, then a specific time period must be provided. + ${DefinitionTimeframe}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + # The type of the export. + # Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. + ${DefinitionType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The name of the container where exports will be uploaded. + ${DestinationContainer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The resource id of the storage account where exports will be delivered. + ${DestinationResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The name of the directory where exports will be uploaded. + ${DestinationRootFolderPath}, + + # [Parameter()] + # [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + # [System.String] + # # eTag of the resource. + # # To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + # ${ETag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + # The format of the export being delivered. + # Currently only 'Csv' is supported. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The start date of recurrence. + ${RecurrencePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The end date of recurrence. + ${RecurrencePeriodTo}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + # The schedule recurrence. + ${ScheduleRecurrence}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + # The status of the export's schedule. + # If 'Inactive', the export's schedule is paused. + ${ScheduleStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The start date for export data. + ${TimePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The end date for export data. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + try { + $getExport + if($PSBoundParameters['InputObject'] -ne $null) + { + $InputExportObject = $PSBoundParameters['InputObject'] + $getExport = Get-AzCostManagementExport -InputObject $InputExportObject + }else{ + $InputExportScope = $PSBoundParameters['Scope'] + $InputExportName = $PSBoundParameters['Name'] + $getExport = Get-AzCostManagementExport -Scope $InputExportScope -Name $InputExportName + } + $null = $PSBoundParameters.Add("ETag",$getExport.Etag) + if($PSBoundParameters['DataSetGranularity'] -eq $null) + { + $null = $PSBoundParameters.Add("DataSetGranularity",$getExport.DataSetGranularity) + } + if($PSBoundParameters['DefinitionTimeframe'] -eq $null) + { + $null = $PSBoundParameters.Add("DefinitionTimeframe",$getExport.DefinitionTimeframe) + } + if($PSBoundParameters['DefinitionType'] -eq $null) + { + $null = $PSBoundParameters.Add("DefinitionType",$getExport.DefinitionType) + } + if($PSBoundParameters['DestinationContainer'] -eq $null) + { + $null = $PSBoundParameters.Add("DestinationContainer",$getExport.DestinationContainer) + } + if($PSBoundParameters['DestinationResourceId'] -eq $null) + { + $null = $PSBoundParameters.Add("DestinationResourceId",$getExport.DestinationResourceId) + } + if($PSBoundParameters['DestinationRootFolderPath'] -eq $null) + { + $null = $PSBoundParameters.Add("DestinationRootFolderPath",$getExport.DestinationRootFolderPath) + } + if($PSBoundParameters['Format'] -eq $null) + { + $null = $PSBoundParameters.Add("Format",$getExport.Format) + } + if($PSBoundParameters['RecurrencePeriodFrom'] -eq $null) + { + $null = $PSBoundParameters.Add("RecurrencePeriodFrom",$getExport.RecurrencePeriodFrom) + } + if($PSBoundParameters['RecurrencePeriodTo'] -eq $null) + { + $null = $PSBoundParameters.Add("RecurrencePeriodTo",$getExport.RecurrencePeriodTo) + } + if($PSBoundParameters['ScheduleStatus'] -eq $null) + { + $null = $PSBoundParameters.Add("ScheduleStatus",$getExport.ScheduleStatus) + } + if($PSBoundParameters['ScheduleRecurrence'] -eq $null) + { + $null = $PSBoundParameters.Add("ScheduleRecurrence",$getExport.ScheduleRecurrence) + } + Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters + } catch { + throw + } + } +} diff --git a/src/CostManagement/custom/readme.md b/src/CostManagement/custom/readme.md index 504158c62401..f488fa1a08b0 100644 --- a/src/CostManagement/custom/readme.md +++ b/src/CostManagement/custom/readme.md @@ -1,5 +1,5 @@ # Custom -This directory contains custom implementation for non-generated cmdlets for the `Az.Cost` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Cost.custom.psm1`. This file should not be modified. +This directory contains custom implementation for non-generated cmdlets for the `Az.CostManagement` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.CostManagement.custom.psm1`. This file should not be modified. ## Info - Modifiable: yes @@ -8,11 +8,11 @@ This directory contains custom implementation for non-generated cmdlets for the - Packaged: yes ## Details -For `Az.Cost` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. +For `Az.CostManagement` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. -For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.Cost.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.CostManagement.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. -For script cmdlets, these are loaded via the `Az.Cost.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. +For script cmdlets, these are loaded via the `Az.CostManagement.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. ## Purpose This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. @@ -27,15 +27,15 @@ The easiest way currently to start developing custom cmdlets is to copy an exist - ProxyCredential - ProxyUseDefaultCredentials -These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.Cost`. For C#, follow the usage seen in the `ProcessRecordAsync` method. +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.CostManagement`. For C#, follow the usage seen in the `ProcessRecordAsync` method. ### Attributes For processing the cmdlets, we've created some additional attributes: -- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.DescriptionAttribute` +- `Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DescriptionAttribute` - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. -- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.DoNotExportAttribute` - - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Cost`. -- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.InternalExportAttribute` - - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Cost`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder. -- `Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ProfileAttribute` +- `Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.CostManagement`. +- `Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.CostManagement`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ProfileAttribute` - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/CostManagement/docs/Az.Cost.md b/src/CostManagement/docs/Az.CostManagement.md similarity index 88% rename from src/CostManagement/docs/Az.Cost.md rename to src/CostManagement/docs/Az.CostManagement.md index 7b7a6fe59886..6bb0b0c6acde 100644 --- a/src/CostManagement/docs/Az.Cost.md +++ b/src/CostManagement/docs/Az.CostManagement.md @@ -1,16 +1,16 @@ --- -Module Name: Az.Cost -Module Guid: 3cca0b09-d91f-4cc1-aebd-6b1be566c631 -Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.cost +Module Name: Az.CostManagement +Module Guid: 4cd9af10-559e-4fb9-8dcd-d3e8eb9e03b7 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement Help Version: 1.0.0.0 Locale: en-US --- -# Az.Cost Module +# Az.CostManagement Module ## Description Microsoft Azure PowerShell: Cost cmdlets -## Az.Cost Cmdlets +## Az.CostManagement Cmdlets ### [Get-AzCostManagementExport](Get-AzCostManagementExport.md) The operation to get the export for the defined scope by export name. @@ -20,7 +20,7 @@ The operation to get the execution history of an export for the defined scope an ### [Invoke-AzCostManagementExecuteExport](Invoke-AzCostManagementExecuteExport.md) The operation to execute an export. -### [Invoke-AzCostManagementUsageQuery](Invoke-AzCostManagementUsageQuery.md) +### [Invoke-AzCostManagementQuery](Invoke-AzCostManagementQuery.md) Query the usage data for scope defined. ### [New-AzCostManagementExport](New-AzCostManagementExport.md) diff --git a/src/CostManagement/docs/Get-AzCostManagementExport.md b/src/CostManagement/docs/Get-AzCostManagementExport.md index 32bbc86e44f7..3848e763ac18 100644 --- a/src/CostManagement/docs/Get-AzCostManagementExport.md +++ b/src/CostManagement/docs/Get-AzCostManagementExport.md @@ -1,7 +1,7 @@ --- external help file: -Module Name: Az.Cost -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostmanagementexport +Module Name: Az.CostManagement +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/get-azcostmanagementexport schema: 2.0.0 --- @@ -26,8 +26,8 @@ Get-AzCostManagementExport -Name -Scope [-Expand ] [-D ### GetViaIdentity ``` -Get-AzCostManagementExport -InputObject [-Expand ] [-DefaultProfile ] - [] +Get-AzCostManagementExport -InputObject [-Expand ] + [-DefaultProfile ] [] ``` ## DESCRIPTION @@ -35,23 +35,29 @@ The operation to get the export for the defined scope by export name. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Get all AzCostManagementExports by scope ```powershell -PS C:\> {{ Add code here }} +PS C:\> Get-AzCostManagementExport -Scope 'subscriptions/**********' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"1d63fb46c1f5154" TestExport Microsoft.CostManagement/exports +"1d63fb4a3f75019" TestExport1 Microsoft.CostManagement/exports +"1d649f5dda56551" TestExport2 Microsoft.CostManagement/exports ``` -{{ Add description here }} +Get all AzCostManagementExports by Scope -### Example 2: {{ Add title here }} +### Example 2: Get AzCostManagementExport by Name and scope ```powershell -PS C:\> {{ Add code here }} +PS C:\> Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"1d63fb46c1f5154" TestExport Microsoft.CostManagement/exports ``` -{{ Add description here }} +Get AzCostManagementExport by Name and scope ## PARAMETERS @@ -91,7 +97,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity Parameter Sets: GetViaIdentity Aliases: @@ -118,8 +124,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with export operations. -This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. +This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ```yaml Type: System.String @@ -138,11 +143,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExport +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport ## NOTES @@ -153,7 +158,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AlertId ]`: Alert ID - `[ExportName ]`: Export Name. - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. diff --git a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md index 7182ab91fe9f..6ecc6dd77e5e 100644 --- a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md +++ b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md @@ -1,7 +1,7 @@ --- external help file: -Module Name: Az.Cost -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/get-azcostmanagementexportexecutionhistory +Module Name: Az.CostManagement +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/get-azcostmanagementexportexecutionhistory schema: 2.0.0 --- @@ -20,7 +20,7 @@ Get-AzCostManagementExportExecutionHistory -ExportName -Scope ### GetViaIdentity ``` -Get-AzCostManagementExportExecutionHistory -InputObject [-DefaultProfile ] +Get-AzCostManagementExportExecutionHistory -InputObject [-DefaultProfile ] [] ``` @@ -29,23 +29,40 @@ The operation to get the execution history of an export for the defined scope an ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Get AzCostManagementExportExecutionHistory ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +PS C:\> Get-AzCostManagementExportExecutionHistory -ExportName 'TestExport' -Scope 'subscriptions/**********' + +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_e02f95ad-584b-4b83-ba9d-41d398e855af.csv +Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/TestExport_fc41d48d-ef47-4e38-aa1e-323e286c6fcf.csv +Scheduled 2020/6/13 12:02:33 2020/6/13 12:26:33 Failed ad-hoc/TestExport/20200601-20200630/TestExport_076501ee-bf16-424b-807e-ca5c6c23293b.csv +Scheduled 2020/6/14 12:27:28 2020/6/14 12:27:50 Completed ad-hoc/TestExport/20200601-20200630/TestExport_145cb0fa-c808-4a6b-b8bb-14a11d78a0dc.csv +Scheduled 2020/6/15 12:02:34 2020/6/15 12:02:45 Completed ad-hoc/TestExport/20200601-20200630/TestExport_7d6422d0-7a46-4a89-9556-4f616941e8ae.csv +Scheduled 2020/6/16 12:07:31 2020/6/16 12:07:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_f5c68909-63bc-4278-bfa5-2fbe008d78fe.csv +Scheduled 2020/6/17 12:03:56 2020/6/17 12:04:17 Completed ad-hoc/TestExport/20200601-20200630/TestExport_eda8f8fa-7cca-4110-8cba-e64d9f1e4b10.csv ``` -{{ Add description here }} +Get AzCostManagementExportExecutionHistory By ExportName and Scope -### Example 2: {{ Add title here }} +### Example 2: Get AzCostManagementExportExecutionHistory by InputObject ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' +Get-AzCostManagementExportExecutionHistory -InputObject $getExport + +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_e02f95ad-584b-4b83-ba9d-41d398e855af.csv +Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/TestExport_fc41d48d-ef47-4e38-aa1e-323e286c6fcf.csv +Scheduled 2020/6/13 12:02:33 2020/6/13 12:26:33 Failed ad-hoc/TestExport/20200601-20200630/TestExport_076501ee-bf16-424b-807e-ca5c6c23293b.csv +Scheduled 2020/6/14 12:27:28 2020/6/14 12:27:50 Completed ad-hoc/TestExport/20200601-20200630/TestExport_145cb0fa-c808-4a6b-b8bb-14a11d78a0dc.csv +Scheduled 2020/6/15 12:02:34 2020/6/15 12:02:45 Completed ad-hoc/TestExport/20200601-20200630/TestExport_7d6422d0-7a46-4a89-9556-4f616941e8ae.csv +Scheduled 2020/6/16 12:07:31 2020/6/16 12:07:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_f5c68909-63bc-4278-bfa5-2fbe008d78fe.csv +Scheduled 2020/6/17 12:03:56 2020/6/17 12:04:17 Completed ad-hoc/TestExport/20200601-20200630/TestExport_eda8f8fa-7cca-4110-8cba-e64d9f1e4b10.csv ``` -{{ Add description here }} +Get AzCostManagementExportExecutionHistory By InputObject ## PARAMETERS @@ -84,7 +101,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity Parameter Sets: GetViaIdentity Aliases: @@ -96,8 +113,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with export operations. -This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. +This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ```yaml Type: System.String @@ -116,11 +132,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExportExecution +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExportExecution ## NOTES @@ -131,7 +147,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AlertId ]`: Alert ID - `[ExportName ]`: Export Name. - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. diff --git a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md index 18687a59f07a..ff72e35b0033 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md @@ -1,7 +1,7 @@ --- external help file: -Module Name: Az.Cost -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementexecuteexport +Module Name: Az.CostManagement +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/invoke-azcostmanagementexecuteexport schema: 2.0.0 --- @@ -20,8 +20,8 @@ Invoke-AzCostManagementExecuteExport -ExportName -Scope [-Defa ### ExecuteViaIdentity ``` -Invoke-AzCostManagementExecuteExport -InputObject [-DefaultProfile ] [-PassThru] - [-Confirm] [-WhatIf] [] +Invoke-AzCostManagementExecuteExport -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -29,23 +29,24 @@ The operation to execute an export. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Invoke Export by ExportName and Scope ```powershell -PS C:\> {{ Add code here }} +PS C:\> Invoke-AzCostManagementExecuteExport -ExportName 'TestExport' -Scope 'subscriptions/**********' {{ Add output here }} ``` -{{ Add description here }} +Invoke Export by ExportName and Scope -### Example 2: {{ Add title here }} +### Example 2: Invoke Export by InputObject ```powershell -PS C:\> {{ Add code here }} +PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' +Invoke-AzCostManagementExecuteExport -InputObject $getExport {{ Add output here }} ``` -{{ Add description here }} +Invoke Export by InputObject ## PARAMETERS @@ -84,7 +85,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity Parameter Sets: ExecuteViaIdentity Aliases: @@ -111,8 +112,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with export operations. -This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. +This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ```yaml Type: System.String @@ -162,7 +162,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity ## OUTPUTS @@ -177,7 +177,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AlertId ]`: Alert ID - `[ExportName ]`: Export Name. - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. diff --git a/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md similarity index 81% rename from src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md rename to src/CostManagement/docs/Invoke-AzCostManagementQuery.md index 0049c9fd13ef..2f1799e257b7 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementUsageQuery.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md @@ -1,11 +1,11 @@ --- external help file: -Module Name: Az.Cost +Module Name: Az.CostManagement online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery schema: 2.0.0 --- -# Invoke-AzCostManagementUsageQuery +# Invoke-AzCostManagementQuery ## SYNOPSIS Query the usage data for scope defined. @@ -14,7 +14,7 @@ Query the usage data for scope defined. ### UsageExpanded (Default) ``` -Invoke-AzCostManagementUsageQuery -Scope -Timeframe -Type +Invoke-AzCostManagementQuery -Scope -Timeframe -Type [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] @@ -22,7 +22,7 @@ Invoke-AzCostManagementUsageQuery -Scope -Timeframe -Ty ### UsageExpanded1 ``` -Invoke-AzCostManagementUsageQuery -ExternalCloudProviderId +Invoke-AzCostManagementQuery -ExternalCloudProviderId -ExternalCloudProviderType -Timeframe -Type [-ConfigurationColumn ] [-DatasetAggregation ] [-DatasetFilter ] [-DatasetGranularity ] [-DatasetGrouping ] [-TimePeriodFrom ] @@ -34,19 +34,31 @@ Query the usage data for scope defined. ## EXAMPLES -### -------------------------- EXAMPLE 1 -------------------------- +### Example 1: {{ Add title here }} ```powershell -{{ Add code here }} +PS C:\> Invoke-AzCostManagementQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage + +NextLink Column Row +-------- ------ --- + {} {} ``` -{{ Add output here }} +Invoke AzCostManagementQuery by Scope -### -------------------------- EXAMPLE 2 -------------------------- +### Example 2: {{ Add title here }} ```powershell -{{ Add code here }} -``` +PS C:\> {{ Add code here }} +$DimensionObject = new-AzCostManagementQueryComparisonExpressionObject -name 'ResourceGroup' -Operator 'In' -Value 'API' + +$FilterObject = New-AzCostManagementQueryFilterObject -Dimension $DimensionObject + +Invoke-AzCostManagementQuery -ExternalCloudProviderId 100 -ExternalCloudProviderType externalBillingAccounts -Timeframe MonthToDate -type Usage -DatasetFilter $FilterObject -DatasetGranularity Daily -debug + {{ Add output here }} +``` + +{{ Add description here }} ## PARAMETERS @@ -85,7 +97,7 @@ Has filter expression to use in the query. To construct, see NOTES section for DATASETFILTER properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter Parameter Sets: (All) Aliases: @@ -100,7 +112,7 @@ Accept wildcard characters: False The granularity of rows in the query. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType Parameter Sets: (All) Aliases: @@ -116,7 +128,7 @@ Array of group by expression to use in the query. To construct, see NOTES section for DATASETGROUPING properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryGrouping[] +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryGrouping[] Parameter Sets: (All) Aliases: @@ -161,7 +173,7 @@ Accept wildcard characters: False The external cloud provider type associated with dimension/query operations. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExternalCloudProviderType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExternalCloudProviderType Parameter Sets: UsageExpanded1 Aliases: @@ -191,7 +203,7 @@ Accept wildcard characters: False The time frame for pulling data for the query. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Parameter Sets: (All) Aliases: @@ -236,7 +248,7 @@ Accept wildcard characters: False The type of the query. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Parameter Sets: (All) Aliases: @@ -283,13 +295,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryDefinition +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryDefinition -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryResult +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult ## NOTES diff --git a/src/CostManagement/docs/New-AzCostManagementExport.md b/src/CostManagement/docs/New-AzCostManagementExport.md index a7fa987c0133..ae7677fe0d55 100644 --- a/src/CostManagement/docs/New-AzCostManagementExport.md +++ b/src/CostManagement/docs/New-AzCostManagementExport.md @@ -1,7 +1,7 @@ --- external help file: -Module Name: Az.Cost -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/new-azcostmanagementexport +Module Name: Az.CostManagement +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/new-azcostmanagementexport schema: 2.0.0 --- @@ -19,7 +19,7 @@ Create operation does not require eTag. New-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -74,7 +74,7 @@ The granularity of rows in the export. Currently only 'Daily' is supported. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType Parameter Sets: (All) Aliases: @@ -105,7 +105,7 @@ The time frame for pulling data for the export. If custom, then a specific time period must be provided. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Parameter Sets: (All) Aliases: @@ -121,7 +121,7 @@ The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Parameter Sets: (All) Aliases: @@ -177,28 +177,18 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ETag -eTag of the resource. -To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Format +[Parameter()] +[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] +[System.String] +# eTag of the resource. +# To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. +${ETag}, The format of the export being delivered. Currently only 'Csv' is supported. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType Parameter Sets: (All) Aliases: @@ -258,7 +248,7 @@ Accept wildcard characters: False The schedule recurrence. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType Parameter Sets: (All) Aliases: @@ -274,7 +264,7 @@ The status of the export's schedule. If 'Inactive', the export's schedule is paused. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType Parameter Sets: (All) Aliases: @@ -286,8 +276,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with export operations. -This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. +This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ```yaml Type: System.String @@ -369,7 +358,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExport +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport ## NOTES diff --git a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md index abdd9f87adfc..ae07ee6b0ad6 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md @@ -1,6 +1,6 @@ --- external help file: -Module Name: Az.Cost +Module Name: Az.CostManagement online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject schema: 2.0.0 --- @@ -71,7 +71,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryColumn +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn ## NOTES diff --git a/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md b/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md index 928e1a21c50c..9d238d9a8aeb 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryComparisonExpressionObject.md @@ -1,6 +1,6 @@ --- external help file: -Module Name: Az.Cost +Module Name: Az.CostManagement online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryComparisonExpressionObject schema: 2.0.0 --- @@ -54,7 +54,7 @@ Accept wildcard characters: False The operator to use for comparison. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.OperatorType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.OperatorType Parameter Sets: (All) Aliases: @@ -87,7 +87,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryComparisonExpression +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryComparisonExpression ## NOTES diff --git a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md index 9a14f00324c3..80d9e189d388 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md @@ -1,6 +1,6 @@ --- external help file: -Module Name: Az.Cost +Module Name: Az.CostManagement online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryFilterObject schema: 2.0.0 --- @@ -47,7 +47,7 @@ Must have at least 2 items. To construct, see NOTES section for AND properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[] +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter[] Parameter Sets: (All) Aliases: @@ -63,7 +63,7 @@ Has comparison expression for a dimension. To construct, see NOTES section for DIMENSION properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryComparisonExpression Parameter Sets: (All) Aliases: @@ -79,7 +79,7 @@ The logical "NOT" expression. To construct, see NOTES section for NOT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter Parameter Sets: (All) Aliases: @@ -96,7 +96,7 @@ Must have at least 2 items. To construct, see NOTES section for OR properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryFilter[] +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter[] Parameter Sets: (All) Aliases: @@ -112,7 +112,7 @@ Has comparison expression for a tag. To construct, see NOTES section for TAG properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IQueryComparisonExpression +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryComparisonExpression Parameter Sets: (All) Aliases: @@ -130,7 +130,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.QueryFilter +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryFilter ## NOTES diff --git a/src/CostManagement/docs/Remove-AzCostManagementExport.md b/src/CostManagement/docs/Remove-AzCostManagementExport.md index fc23a1297789..145b0c8a8a17 100644 --- a/src/CostManagement/docs/Remove-AzCostManagementExport.md +++ b/src/CostManagement/docs/Remove-AzCostManagementExport.md @@ -1,7 +1,7 @@ --- external help file: -Module Name: Az.Cost -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/remove-azcostmanagementexport +Module Name: Az.CostManagement +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/remove-azcostmanagementexport schema: 2.0.0 --- @@ -20,8 +20,8 @@ Remove-AzCostManagementExport -Name -Scope [-DefaultProfile

[-DefaultProfile ] [-PassThru] [-Confirm] - [-WhatIf] [] +Remove-AzCostManagementExport -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] ``` ## DESCRIPTION @@ -29,23 +29,24 @@ The operation to delete a export. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Delete the AzCostManagementExport by Scope and Name ```powershell -PS C:\> {{ Add code here }} +PS C:\> Remove-AzCostManagementExport -Scope 'subscriptions/********' -name 'TestExportDatasetAggregationInfoYouri' + -{{ Add output here }} ``` -{{ Add description here }} +Delete the AzCostManagementExport By Scope and ExportName -### Example 2: {{ Add title here }} +### Example 2: Delete the AzCostManagementExport by Export Object ```powershell -PS C:\> {{ Add code here }} +PS C:\> $getExport = Get-AzCostManagementExport -Scope 'subscriptions/*********' -name 'TestExportDatasetAggregationYouori' +Remove-AzCostManagementExport -InputObject $getExport + -{{ Add output here }} ``` -{{ Add description here }} +Delete the AzCostManagementExport By InputObject ## PARAMETERS @@ -69,7 +70,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity Parameter Sets: DeleteViaIdentity Aliases: @@ -111,8 +112,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with export operations. -This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. +This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ```yaml Type: System.String @@ -162,7 +162,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity ## OUTPUTS @@ -177,7 +177,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AlertId ]`: Alert ID - `[ExportName ]`: Export Name. - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. diff --git a/src/CostManagement/docs/Update-AzCostManagementExport.md b/src/CostManagement/docs/Update-AzCostManagementExport.md index bc868c62bce1..ae58d120207b 100644 --- a/src/CostManagement/docs/Update-AzCostManagementExport.md +++ b/src/CostManagement/docs/Update-AzCostManagementExport.md @@ -1,7 +1,7 @@ --- external help file: -Module Name: Az.Cost -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/update-azcostmanagementexport +Module Name: Az.CostManagement +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/update-azcostmanagementexport schema: 2.0.0 --- @@ -20,17 +20,17 @@ Create operation does not require eTag. Update-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` ### UpdateViaIdentityExpanded ``` -Update-AzCostManagementExport -InputObject [-ConfigurationColumn ] +Update-AzCostManagementExport -InputObject [-ConfigurationColumn ] [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -85,7 +85,7 @@ The granularity of rows in the export. Currently only 'Daily' is supported. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.GranularityType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType Parameter Sets: (All) Aliases: @@ -116,7 +116,7 @@ The time frame for pulling data for the export. If custom, then a specific time period must be provided. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.TimeframeType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType Parameter Sets: (All) Aliases: @@ -132,7 +132,7 @@ The type of the export. Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.ExportType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType Parameter Sets: (All) Aliases: @@ -188,28 +188,18 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ETag -eTag of the resource. -To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Format +[Parameter()] +[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] +[System.String] +# eTag of the resource. +# To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. +${ETag}, The format of the export being delivered. Currently only 'Csv' is supported. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.FormatType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType Parameter Sets: (All) Aliases: @@ -225,7 +215,7 @@ Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity Parameter Sets: UpdateViaIdentityExpanded Aliases: @@ -285,7 +275,7 @@ Accept wildcard characters: False The schedule recurrence. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.RecurrenceType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType Parameter Sets: (All) Aliases: @@ -301,7 +291,7 @@ The status of the export's schedule. If 'Inactive', the export's schedule is paused. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.Cost.Support.StatusType +Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType Parameter Sets: (All) Aliases: @@ -313,8 +303,7 @@ Accept wildcard characters: False ``` ### -Scope -The scope associated with export operations. -This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. +This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. ```yaml Type: System.String @@ -394,11 +383,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.ICostIdentity +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity ## OUTPUTS -### Microsoft.Azure.PowerShell.Cmdlets.Cost.Models.Api20200601.IExport +### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport ## NOTES @@ -409,7 +398,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter - `[AlertId ]`: Alert ID - `[ExportName ]`: Export Name. - `[ExternalCloudProviderId ]`: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. diff --git a/src/CostManagement/docs/readme.md b/src/CostManagement/docs/readme.md index 98a6db4998bc..b70ae768ed4f 100644 --- a/src/CostManagement/docs/readme.md +++ b/src/CostManagement/docs/readme.md @@ -1,5 +1,5 @@ # Docs -This directory contains the documentation of the cmdlets for the `Az.Cost` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. +This directory contains the documentation of the cmdlets for the `Az.CostManagement` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. ## Info - Modifiable: no @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Cost` modul - Packaged: yes ## Details -The process of documentation generation loads `Az.Cost` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.CostManagement` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/CostManagement/examples/Get-AzCostManagementExport.md b/src/CostManagement/examples/Get-AzCostManagementExport.md index 093355d11d50..fbe3ad3dac03 100644 --- a/src/CostManagement/examples/Get-AzCostManagementExport.md +++ b/src/CostManagement/examples/Get-AzCostManagementExport.md @@ -1,18 +1,24 @@ -### Example 1: {{ Add title here }} +### Example 1: Get all AzCostManagementExports by scope ```powershell -PS C:\> {{ Add code here }} +PS C:\> Get-AzCostManagementExport -Scope 'subscriptions/**********' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"************" TestExport Microsoft.CostManagement/exports +"************" TestExport1 Microsoft.CostManagement/exports +"************" TestExport2 Microsoft.CostManagement/exports ``` -{{ Add description here }} +Get all AzCostManagementExports by Scope -### Example 2: {{ Add title here }} +### Example 2: Get AzCostManagementExport by Name and scope ```powershell -PS C:\> {{ Add code here }} +PS C:\> Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"************" TestExport Microsoft.CostManagement/exports ``` -{{ Add description here }} +Get AzCostManagementExport by Name and scope diff --git a/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md index 093355d11d50..10a16ea48382 100644 --- a/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md +++ b/src/CostManagement/examples/Get-AzCostManagementExportExecutionHistory.md @@ -1,18 +1,25 @@ -### Example 1: {{ Add title here }} +### Example 1: Get AzCostManagementExportExecutionHistory ```powershell -PS C:\> {{ Add code here }} +PS C:\> Get-AzCostManagementExportExecutionHistory -ExportName 'TestExport' -Scope 'subscriptions/**********' -{{ Add output here }} +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_00000000-0000-0000-0000-000000000000.csv +Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/TestExport_00000000-0000-0000-0000-000000000000.csv ``` -{{ Add description here }} +Get AzCostManagementExportExecutionHistory By ExportName and Scope -### Example 2: {{ Add title here }} +### Example 2: Get AzCostManagementExportExecutionHistory by InputObject ```powershell -PS C:\> {{ Add code here }} +PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' +Get-AzCostManagementExportExecutionHistory -InputObject $getExport -{{ Add output here }} +ExecutionType ProcessingStartTime ProcessingEndTime Status FileName +------------- ------------------- ----------------- ------ -------- +Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_00000000-0000-0000-0000-000000000000.csv +Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/ ``` -{{ Add description here }} +Get AzCostManagementExportExecutionHistory By InputObject diff --git a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md index 093355d11d50..ef684f41758c 100644 --- a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md @@ -1,18 +1,19 @@ -### Example 1: {{ Add title here }} +### Example 1: Invoke Export by ExportName and Scope ```powershell -PS C:\> {{ Add code here }} +PS C:\> Invoke-AzCostManagementExecuteExport -ExportName 'TestExport' -Scope 'subscriptions/**********' {{ Add output here }} ``` -{{ Add description here }} +Invoke Export by ExportName and Scope -### Example 2: {{ Add title here }} +### Example 2: Invoke Export by InputObject ```powershell -PS C:\> {{ Add code here }} +PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' +Invoke-AzCostManagementExecuteExport -InputObject $getExport {{ Add output here }} ``` -{{ Add description here }} +Invoke Export by InputObject diff --git a/src/CostManagement/examples/Invoke-AzCostManagementQuery.md b/src/CostManagement/examples/Invoke-AzCostManagementQuery.md new file mode 100644 index 000000000000..612bd71187b8 --- /dev/null +++ b/src/CostManagement/examples/Invoke-AzCostManagementQuery.md @@ -0,0 +1,21 @@ +### Example 1: Invoke AzCostManagementQuery by Scope +```powershell +PS C:\> Invoke-AzCostManagementQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage +Invoke-AzCostManagementQuery -Scope "/subscriptions/***********" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' + +NextLink Column Row +-------- ------ --- + {UsageDate, Currency} {20201101 USD, 20201102 USD, 20201103 USD, 20201104 USD…} +``` + +Invoke AzCostManagementQuery by Scope + +### Example 2: {{ Add title here }} +```powershell +PS C:\> {{ Add code here }} + + +{{ Add output here }} +``` + +{{ Add description here }} \ No newline at end of file diff --git a/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md b/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md deleted file mode 100644 index 093355d11d50..000000000000 --- a/src/CostManagement/examples/Invoke-AzCostManagementUsageQuery.md +++ /dev/null @@ -1,18 +0,0 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} - diff --git a/src/CostManagement/examples/New-AzCostManagementExport.md b/src/CostManagement/examples/New-AzCostManagementExport.md index 093355d11d50..b93092c35902 100644 --- a/src/CostManagement/examples/New-AzCostManagementExport.md +++ b/src/CostManagement/examples/New-AzCostManagementExport.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} +### Example 1: Create an AzCostManagementExport ```powershell -PS C:\> {{ Add code here }} +PS C:\> New-AzCostManagementExport -Scope "subscriptions/***********" -Name "CostManagementExportTest" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-10-31T20:00:00Z" -RecurrencePeriodTo "2020-11-30T00:00:00Z" -Format "Csv" -DestinationResourceId "/subscriptions/*************/resourceGroups/ResourceGroupTest/providers/Microsoft.Storage/storageAccounts/storageAccountTest" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfosagdhaghj Microsoft.CostManagement/exports ``` -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} +Create an AzCostManagementExport diff --git a/src/CostManagement/examples/Remove-AzCostManagementExport.md b/src/CostManagement/examples/Remove-AzCostManagementExport.md index 093355d11d50..b913c3e4c876 100644 --- a/src/CostManagement/examples/Remove-AzCostManagementExport.md +++ b/src/CostManagement/examples/Remove-AzCostManagementExport.md @@ -1,18 +1,19 @@ -### Example 1: {{ Add title here }} +### Example 1: Delete the AzCostManagementExport by Scope and Name ```powershell -PS C:\> {{ Add code here }} +PS C:\> Remove-AzCostManagementExport -Scope 'subscriptions/********' -name 'TestExportDatasetAggregationInfoYouri' + -{{ Add output here }} ``` -{{ Add description here }} +Delete the AzCostManagementExport By Scope and ExportName -### Example 2: {{ Add title here }} +### Example 2: Delete the AzCostManagementExport by Export Object ```powershell -PS C:\> {{ Add code here }} +PS C:\> $getExport = Get-AzCostManagementExport -Scope 'subscriptions/*********' -name 'TestExportDatasetAggregationYouori' +Remove-AzCostManagementExport -InputObject $getExport + -{{ Add output here }} ``` -{{ Add description here }} +Delete the AzCostManagementExport By InputObject diff --git a/src/CostManagement/examples/Update-AzCostManagementExport.md b/src/CostManagement/examples/Update-AzCostManagementExport.md index 093355d11d50..274808b94cc4 100644 --- a/src/CostManagement/examples/Update-AzCostManagementExport.md +++ b/src/CostManagement/examples/Update-AzCostManagementExport.md @@ -1,18 +1,23 @@ -### Example 1: {{ Add title here }} +### Example 1: Update AzCostManagementExport by scope and name ```powershell -PS C:\> {{ Add code here }} +PS C:\>Update-AzCostManagementExport -Scope "subscriptions//*********" -Name "TestExport" -ScheduleRecurrence 'Weekly' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports ``` -{{ Add description here }} +Update AzCostManagementExport by Scope and name -### Example 2: {{ Add title here }} +### Example 2: Update AzCostManagementExport by InputObject ```powershell -PS C:\> {{ Add code here }} +PS C:\>$oldExport = Get-AzCostManagementExport -Scope "subscriptions/*********" -Name "TestExport" +Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekly' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports ``` -{{ Add description here }} +Update AzCostManagementExport by InputObject diff --git a/src/CostManagement/how-to.md b/src/CostManagement/how-to.md new file mode 100644 index 000000000000..8ac954c6b92a --- /dev/null +++ b/src/CostManagement/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.CostManagement`. + +## Building `Az.CostManagement` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [readme.md](exports/readme.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [readme.md](custom/readme.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](examples/readme.md) in the `examples` folder. To read more about documentation, look at the [readme.md](docs/readme.md) in the `docs` folder. + +## Testing `Az.CostManagement` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [readme.md](examples/readme.md) in the `examples` folder. + +## Packing `Az.CostManagement` +To pack `Az.CostManagement` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/en-us/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.CostManagement`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.CostManagement.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.CostManagement.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.CostManagement`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.CostManagement` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/src/CostManagement/license.txt b/src/CostManagement/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/src/CostManagement/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 41d725822db5..d25fe2015f9a 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -1,10 +1,10 @@ -# Az.Cost +# Az.CostManagement This directory contains the PowerShell module for the Cost service. --- ## Status -[![Az.Cost](https://img.shields.io/powershellgallery/v/Az.Cost.svg?style=flat-square&label=Az.Cost "Az.Cost")](https://www.powershellgallery.com/packages/Az.Cost/) +[![Az.CostManagement](https://img.shields.io/powershellgallery/v/Az.CostManagement.svg?style=flat-square&label=Az.CostManagement "Az.CostManagement")](https://www.powershellgallery.com/packages/Az.CostManagement/) ## Info - Modifiable: yes @@ -23,7 +23,7 @@ This module was primarily generated via [AutoRest](https://github.com/Azure/auto AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. ## Development -For information on how to develop for `Az.Cost`, see [how-to.md](how-to.md). +For information on how to develop for `Az.CostManagement`, see [how-to.md](how-to.md). --- @@ -54,7 +54,7 @@ input-file: title: CostManagement module-version: 0.1.0 -subject-prefix: 'CostManagement' +service-name: CostManagement identity-correction-for-post: true @@ -80,12 +80,20 @@ directive: subject: ByDimensionExternalCloudProviderType|CloudForecast|DismissAlert|Forecast verb: Invoke remove: true - # - where: - # subject: Export|ExportExecutionHistory|ExportExecution - # parameter-name: Scope - # set: - # parameter-name: ABC - # parameter-description: This includes 'subscriptions/{subscriptionId}/' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. + - where: + subject: Export|ExportExecutionHistory|ExportExecution + parameter-name: Scope + set: + parameter-name: Scope + parameter-description: This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. + - where: + subject: Export + verb: Update + hide: true + - where: + subject: Export + verb: New + hide: true - from: source-file-csharp where: $ transform: $ = $.replace(/\/runHistory\$/g, "$"); diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 index 04bfb85155c2..361e5f4d7dae 100644 --- a/src/CostManagement/resources/Create.ps1 +++ b/src/CostManagement/resources/Create.ps1 @@ -10,11 +10,11 @@ $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} $Aggregation2 = @{ name = 'Cost'; function='sum'} $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} -New-AzCostManagementExport -Debug -Scope "subscriptions/6b085460-5f21-477e-ba44-1035046e9101" -Name "TestExportDatasetAggregationInfo" ` +New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExportDatasetAggregationInfo" ` -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-11-03T20:00:00Z" ` -RecurrencePeriodTo "2020-11-10T00:00:00Z" -Format "Csv" ` -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" -ETag "test" # -DatasetAggregation $AggregationDict + -DatasetGranularity "Daily" -ETag "test" # Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file diff --git a/src/CostManagement/resources/Query.ps1 b/src/CostManagement/resources/Query.ps1 index 39c0bc6832b1..40ff8898878b 100644 --- a/src/CostManagement/resources/Query.ps1 +++ b/src/CostManagement/resources/Query.ps1 @@ -1,4 +1,4 @@ $Aggregation1 = @{ name = 'Cost' } $AggregationDict = @{total=$aggregation1;} $group = @{name='ResourceGroup'; type='Dimension'} -Invoke-AzCostManagementUsageQuery -Type Usage -Scope "subscriptions/6b085460-5f21-477e-ba44-1035046e9101" -DatasetGranularity 'Daily' -Debug -TimePeriodFrom "2020-08-03T20:00:00Z" -TimePeriodTo "2020-11-10T00:00:00Z" -Timeframe Custom -DatasetAggregation $AggregationDict -DatasetGrouping @($group) \ No newline at end of file +Invoke-AzCostManagementQuery -Type Usage -Scope "subscriptions/6b085460-5f21-477e-ba44-1035046e9101" -DatasetGranularity 'Daily' -Debug -TimePeriodFrom "2020-08-03T20:00:00Z" -TimePeriodTo "2020-11-10T00:00:00Z" -Timeframe Custom -DatasetAggregation $AggregationDict -DatasetGrouping @($group) \ No newline at end of file diff --git a/src/CostManagement/test/Get-AzCostManagementExport.Recording.json b/src/CostManagement/test/Get-AzCostManagementExport.Recording.json index 8c587b73557f..18018b228439 100644 --- a/src/CostManagement/test/Get-AzCostManagementExport.Recording.json +++ b/src/CostManagement/test/Get-AzCostManagementExport.Recording.json @@ -1,12 +1,12 @@ { - "Get-AzCostManagementExport+[NoContext]+List+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01+1": { + "Get-AzCostManagementExport+[NoContext]+List+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "1" ], - "x-ms-client-request-id": [ "a3d1a493-26a8-4a52-8208-0fbd285d32a1" ], + "x-ms-client-request-id": [ "019f78ea-6d5d-4526-96b6-759794f5b56e" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_List" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -21,33 +21,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "7a79246a-3f52-44f2-b629-21dfcd3cac72" ], - "x-ms-request-id": [ "c1a1f8d5-2748-4024-89cf-e4736e709d25" ], - "x-ms-correlation-request-id": [ "a0cfd64c-b052-4ecf-b529-07ff98840e55" ], - "x-ms-client-request-id": [ "a3d1a493-26a8-4a52-8208-0fbd285d32a1" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "7c853323-98ff-444b-8cf2-ff9e08faef47" ], + "x-ms-request-id": [ "1d220c16-222c-493d-ba84-78097dee9e30" ], + "x-ms-correlation-request-id": [ "e86dfb49-a45f-4671-9088-43db287b2aa2" ], + "x-ms-client-request-id": [ "019f78ea-6d5d-4526-96b6-759794f5b56e" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11997" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T070127Z:e86dfb49-a45f-4671-9088-43db287b2aa2" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091501Z:a0cfd64c-b052-4ecf-b529-07ff98840e55" ], - "Date": [ "Mon, 06 Jul 2020 09:15:00 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:01:26 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "23920" ], + "Content-Length": [ "30290" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport4\",\"name\":\"TestExport4\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6425d3647\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport5\",\"name\":\"TestExport5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f679d78775\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport6\",\"name\":\"TestExport6\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6b27ba29f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation\",\"name\":\"TestExportDatasetAggregation\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650e17ad92f21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation123\",\"name\":\"TestExportDatasetAggregation123\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b19fb5559127\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-03T20:00:00+00:00\",\"to\":\"2020-11-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfoyouri\",\"name\":\"TestExportDatasetAggregationInfoyouri\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b33c18099a67\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-05T20:00:00+00:00\",\"to\":\"2020-11-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestUpdate1\",\"name\":\"TestUpdate1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b6451f8f6d83\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-09T20:00:00+00:00\",\"to\":\"2020-11-20T00:00:00+00:00\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:26.9366552Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfoYouri\",\"name\":\"TestExportDatasetAggregationInfoYouri\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b738f9459e9e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-13T20:00:00Z\",\"to\":\"2020-11-17T00:00:00Z\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"adhoctest\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationYouriTest\",\"name\":\"TestExportDatasetAggregationYouriTest\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b7120d0af53a\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-10T20:00:00+00:00\",\"to\":\"2020-11-15T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"adhoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfo1118\",\"name\":\"TestExportDatasetAggregationInfo1118\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd716961a536\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T20:00:00Z\",\"to\":\"2020-11-20T00:00:00Z\"}},\"nextRunTimeEstimate\":\"2020-11-18T20:00:00Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/youri-costmanagement/providers/Microsoft.Storage/storageAccounts/youristorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd74b260689e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:26.9366552Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-x9d0hl\",\"name\":\"export-x9d0hl\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd787c7e5e56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:26.9366552Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod\",\"name\":\"export-9pcvod\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd787f0fd3c0\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:26.9366552Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}}]}" } }, - "Get-AzCostManagementExport+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Get-AzCostManagementExport+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "764cecf8-d98d-4ec0-97f6-26f2ed2bebb2" ], + "x-ms-client-request-id": [ "284728a8-bc91-4a3a-8713-f71c14f4756f" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -62,33 +63,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "0ed6173b-7d65-4e2d-a50b-c68b9d5c6b8a" ], - "x-ms-request-id": [ "6a46d3c5-3839-43e3-a42e-309883d8ea6b" ], - "x-ms-correlation-request-id": [ "b10cd0f3-c0b3-4d83-aed6-0af45e8b9961" ], - "x-ms-client-request-id": [ "764cecf8-d98d-4ec0-97f6-26f2ed2bebb2" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "0e2f0ad0-a2c2-4128-bf1e-790e4a6b93c9" ], + "x-ms-request-id": [ "c3b28262-7f15-4fb0-b212-893bcda8d57d" ], + "x-ms-correlation-request-id": [ "1f4c0526-984b-47b4-849d-0dc455f20959" ], + "x-ms-client-request-id": [ "284728a8-bc91-4a3a-8713-f71c14f4756f" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11996" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T070127Z:1f4c0526-984b-47b4-849d-0dc455f20959" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091503Z:b10cd0f3-c0b3-4d83-aed6-0af45e8b9961" ], - "Date": [ "Mon, 06 Jul 2020 09:15:02 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:01:27 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "709" ], + "Content-Length": [ "762" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd74b260689e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:27.7260468Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "Get-AzCostManagementExport+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Get-AzCostManagementExport+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "84680f60-2b7d-411b-aae4-9259983e57a8" ], + "x-ms-client-request-id": [ "dd33ad9d-1784-4051-b058-dc7f19937624" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -103,33 +105,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "7ac3047f-40ca-4cd3-9cdc-6ffc61f15623" ], - "x-ms-request-id": [ "b3158243-14b4-4ad5-bd11-4f2f015e5859" ], - "x-ms-correlation-request-id": [ "c279ea92-0d72-4f55-af84-7ac1393d4c92" ], - "x-ms-client-request-id": [ "84680f60-2b7d-411b-aae4-9259983e57a8" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "694c1cdd-5000-4a20-a214-06f160bb22a4" ], + "x-ms-request-id": [ "abbabf4c-1d8a-4caf-bcce-c41d246a3cf7" ], + "x-ms-correlation-request-id": [ "5ff3f209-9582-4551-94da-8a039ea7bb9a" ], + "x-ms-client-request-id": [ "dd33ad9d-1784-4051-b058-dc7f19937624" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11995" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T070128Z:5ff3f209-9582-4551-94da-8a039ea7bb9a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091504Z:c279ea92-0d72-4f55-af84-7ac1393d4c92" ], - "Date": [ "Mon, 06 Jul 2020 09:15:03 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:01:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "709" ], + "Content-Length": [ "762" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd74b260689e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:28.3543878Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "Get-AzCostManagementExport+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+2": { + "Get-AzCostManagementExport+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "4" ], - "x-ms-client-request-id": [ "c9dc70b6-2123-4d49-ad74-65c31c6cfd5d" ], + "x-ms-client-request-id": [ "9aa28b62-5456-4ae9-84cf-3998beb992fd" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_GetViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -144,23 +147,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "14e26877-5709-4eb2-a05e-96ae71a99999" ], - "x-ms-request-id": [ "dc595b73-e14b-453b-b549-6d9a27d3e103" ], - "x-ms-correlation-request-id": [ "f3b4f70c-c7c4-4fa2-b30d-63347d4aa542" ], - "x-ms-client-request-id": [ "c9dc70b6-2123-4d49-ad74-65c31c6cfd5d" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "f2825f60-8a64-4405-a1e5-9603815df2c7" ], + "x-ms-request-id": [ "66093be2-1093-45ca-9b47-7170ddb604d0" ], + "x-ms-correlation-request-id": [ "73507b6e-2ae5-462a-95c6-921ff56f9532" ], + "x-ms-client-request-id": [ "9aa28b62-5456-4ae9-84cf-3998beb992fd" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T070129Z:73507b6e-2ae5-462a-95c6-921ff56f9532" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091505Z:f3b4f70c-c7c4-4fa2-b30d-63347d4aa542" ], - "Date": [ "Mon, 06 Jul 2020 09:15:04 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:01:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "709" ], + "Content-Length": [ "762" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd74b260689e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:01:28.9611203Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } } } \ No newline at end of file diff --git a/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json index ce6954d8300c..498de3ec2549 100644 --- a/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json +++ b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Recording.json @@ -1,12 +1,12 @@ { - "Get-AzCostManagementExportExecutionHistory+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+1": { + "Get-AzCostManagementExportExecutionHistory+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "1" ], - "x-ms-client-request-id": [ "2a0a5bf2-9b76-420d-a8ea-9d9699448e89" ], + "x-ms-client-request-id": [ "23f11f1f-f46b-4cc0-911e-8f4ec0cdfead" ], "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -21,33 +21,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "f6325027-63a8-44da-bac4-eb3b1fc4edaa" ], - "x-ms-request-id": [ "e93206c3-a347-431f-baf8-a4322f8f77c4" ], - "x-ms-correlation-request-id": [ "b98e6547-5487-444d-9ffb-f603326e2313" ], - "x-ms-client-request-id": [ "2a0a5bf2-9b76-420d-a8ea-9d9699448e89" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "a6606686-60eb-4a95-8652-8541b8a9878e" ], + "x-ms-request-id": [ "4cec0d72-ab40-4629-aba4-55028d98a4ca" ], + "x-ms-correlation-request-id": [ "e71587b4-1863-4b23-849e-346466f86590" ], + "x-ms-client-request-id": [ "23f11f1f-f46b-4cc0-911e-8f4ec0cdfead" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072513Z:e71587b4-1863-4b23-849e-346466f86590" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091524Z:b98e6547-5487-444d-9ffb-f603326e2313" ], - "Date": [ "Mon, 06 Jul 2020 09:15:24 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:25:12 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "934" ], + "Content-Length": [ "1856" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/46fcbcd5-e265-4d3d-b64d-29730797d629\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:47.826442Z\",\"processingStartTime\":\"2020-11-18T07:23:49.9336163Z\",\"processingEndTime\":\"2020-11-18T07:24:34.1615162Z\",\"fileName\":\"ad-hoc/export-oenfxg/20201101-20201130/export-oenfxg_46fcbcd5-e265-4d3d-b64d-29730797d629.csv\"}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/7bc55aa1-73c7-4817-a792-a5d18f16c30b\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:51.0272403Z\",\"processingStartTime\":\"2020-11-18T07:23:53.0245821Z\",\"processingEndTime\":\"2020-11-18T07:24:25.01233Z\",\"fileName\":\"ad-hoc/export-oenfxg/20201101-20201130/export-oenfxg_7bc55aa1-73c7-4817-a792-a5d18f16c30b.csv\"}}]}" } }, - "Get-AzCostManagementExportExecutionHistory+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Get-AzCostManagementExportExecutionHistory+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "d22920aa-bfa5-4531-b17e-7e6005a2fb7a" ], + "x-ms-client-request-id": [ "73a50aa7-ed60-4a71-ab9e-3db97e2355e2" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -62,33 +63,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "0709d528-7606-42af-b2d3-b17281e8b216" ], - "x-ms-request-id": [ "8c702ba6-09bc-4620-b7e0-1a602ef61a00" ], - "x-ms-correlation-request-id": [ "a37c5acd-2082-43e9-bd8c-e0dadb5dd53f" ], - "x-ms-client-request-id": [ "d22920aa-bfa5-4531-b17e-7e6005a2fb7a" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "b9a804c4-5c5e-4270-bdd9-7ee7b70bbdcf" ], + "x-ms-request-id": [ "2ab7588d-c1dc-41c0-a957-75c6c3797d85" ], + "x-ms-correlation-request-id": [ "9900b0be-b85b-4772-a73d-ff9336d142ec" ], + "x-ms-client-request-id": [ "73a50aa7-ed60-4a71-ab9e-3db97e2355e2" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072513Z:9900b0be-b85b-4772-a73d-ff9336d142ec" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091526Z:a37c5acd-2082-43e9-bd8c-e0dadb5dd53f" ], - "Date": [ "Mon, 06 Jul 2020 09:15:26 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:25:12 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "709" ], + "Content-Length": [ "762" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7bacc71476\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:25:13.5620095Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "Get-AzCostManagementExportExecutionHistory+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+2": { + "Get-AzCostManagementExportExecutionHistory+[NoContext]+GetViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "8e58532d-a286-4a8c-a0b1-b0d4c2f71b9b" ], + "x-ms-client-request-id": [ "29fa47d9-86e7-466f-b5f0-0dcf1901cf4e" ], "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_GetViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -103,23 +105,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "cb1ec8fb-ecd1-413a-b855-dcb25d7e919c" ], - "x-ms-request-id": [ "2d05bda6-0934-4177-9254-6ea7b56d8b7d" ], - "x-ms-correlation-request-id": [ "47e339ab-943c-4c5a-ac20-f3c20e8cf4d0" ], - "x-ms-client-request-id": [ "8e58532d-a286-4a8c-a0b1-b0d4c2f71b9b" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "8ecb35b7-2d7b-4c0a-bd8d-8cf0a0752340" ], + "x-ms-request-id": [ "ba2e7d02-8d12-4551-b694-5311269b1512" ], + "x-ms-correlation-request-id": [ "dd87d05f-f740-4a4a-b4b2-8768f03ace3b" ], + "x-ms-client-request-id": [ "29fa47d9-86e7-466f-b5f0-0dcf1901cf4e" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11989" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072514Z:dd87d05f-f740-4a4a-b4b2-8768f03ace3b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091527Z:47e339ab-943c-4c5a-ac20-f3c20e8cf4d0" ], - "Date": [ "Mon, 06 Jul 2020 09:15:26 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:25:13 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "934" ], + "Content-Length": [ "1856" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/46fcbcd5-e265-4d3d-b64d-29730797d629\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:47.826442Z\",\"processingStartTime\":\"2020-11-18T07:23:49.9336163Z\",\"processingEndTime\":\"2020-11-18T07:24:34.1615162Z\",\"fileName\":\"ad-hoc/export-oenfxg/20201101-20201130/export-oenfxg_46fcbcd5-e265-4d3d-b64d-29730797d629.csv\"}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/7bc55aa1-73c7-4817-a792-a5d18f16c30b\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:51.0272403Z\",\"processingStartTime\":\"2020-11-18T07:23:53.0245821Z\",\"processingEndTime\":\"2020-11-18T07:24:25.01233Z\",\"fileName\":\"ad-hoc/export-oenfxg/20201101-20201130/export-oenfxg_7bc55aa1-73c7-4817-a792-a5d18f16c30b.csv\"}}]}" } } } \ No newline at end of file diff --git a/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 index 097cf9606605..a1372bb46ed9 100644 --- a/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 +++ b/src/CostManagement/test/Get-AzCostManagementExportExecutionHistory.Tests.ps1 @@ -14,12 +14,12 @@ while(-not $mockingPath) { Describe 'Get-AzCostManagementExportExecutionHistory' { It 'Get' { $exportHist = Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 - $exportHist.Count | Should -Be 1 + $exportHist.Count | Should -Be 2 } It 'GetViaIdentity' { $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 $exportHist = Get-AzCostManagementExportExecutionHistory -InputObject $export - $exportHist.Count | Should -Be 1 + $exportHist.Count | Should -Be 2 } } diff --git a/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json index 68ea94ef94e2..bd7c5dfe8da8 100644 --- a/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json +++ b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Recording.json @@ -1,12 +1,12 @@ { - "Invoke-AzCostManagementExecuteExport+[NoContext]+Execute+$POST+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01+1": { + "Invoke-AzCostManagementExecuteExport+[NoContext]+Execute+$POST+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/run?api-version=2020-06-01+1": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/run?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "1" ], - "x-ms-client-request-id": [ "aa5de09b-ef0e-4ea4-b4ee-f3c17259b778" ], + "x-ms-client-request-id": [ "15e9cb13-90d9-4709-9bf8-cc6424b3fadf" ], "CommandName": [ "Invoke-AzCostManagementExecuteExport" ], "FullCommandName": [ "Invoke-AzCostManagementExecuteExport_Execute" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -21,16 +21,16 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "c5cfdf23-b5cf-4d5e-a72d-be4d96d9d4c7" ], - "x-ms-request-id": [ "415a06e2-5e88-4a14-a1ea-d6e42a98ea53" ], - "x-ms-correlation-request-id": [ "3f12b48f-92bd-4e6b-9787-1115afe8a6a7" ], - "x-ms-client-request-id": [ "aa5de09b-ef0e-4ea4-b4ee-f3c17259b778" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "session-id": [ "18bb1119-00da-487a-a5f9-258893d7546a" ], + "x-ms-request-id": [ "cd99ca74-4db5-492d-b7f6-d80d0b9a3c58" ], + "x-ms-correlation-request-id": [ "9cc9ce6b-f352-4366-a410-bf9f9584ed74" ], + "x-ms-client-request-id": [ "15e9cb13-90d9-4709-9bf8-cc6424b3fadf" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11996" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072349Z:9cc9ce6b-f352-4366-a410-bf9f9584ed74" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091735Z:3f12b48f-92bd-4e6b-9787-1115afe8a6a7" ], - "Date": [ "Mon, 06 Jul 2020 09:17:35 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:23:49 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], @@ -39,14 +39,14 @@ "Content": null } }, - "Invoke-AzCostManagementExecuteExport+[NoContext]+Execute+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+2": { + "Invoke-AzCostManagementExecuteExport+[NoContext]+Execute+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "59339ec2-05bd-469f-b15c-252dc532c76a" ], + "x-ms-client-request-id": [ "7a53a0f6-4051-4e48-a4ba-57d93a2e2f58" ], "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -61,33 +61,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "91923384-1eb0-49df-a7ac-0eedc372ae04" ], - "x-ms-request-id": [ "a95ba8c3-de6c-4f2e-87cf-9daab33d7ebb" ], - "x-ms-correlation-request-id": [ "8a6cbf6e-b118-4c5f-8277-4814220a0163" ], - "x-ms-client-request-id": [ "59339ec2-05bd-469f-b15c-252dc532c76a" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "c9c9317e-b541-4389-8544-723601ab9332" ], + "x-ms-request-id": [ "ece4d240-3a16-45a4-9307-e42063bc0e4c" ], + "x-ms-correlation-request-id": [ "d059e713-a14e-4436-8cd8-e79cc17e76b2" ], + "x-ms-client-request-id": [ "7a53a0f6-4051-4e48-a4ba-57d93a2e2f58" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11995" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072350Z:d059e713-a14e-4436-8cd8-e79cc17e76b2" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091736Z:8a6cbf6e-b118-4c5f-8277-4814220a0163" ], - "Date": [ "Mon, 06 Jul 2020 09:17:36 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:23:49 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1715" ], + "Content-Length": [ "792" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/05d2edf7-74a0-4bf4-a28a-992fd9c7655e\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:17:34.6964397Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/46fcbcd5-e265-4d3d-b64d-29730797d629\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:47.826442Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}}]}" } }, - "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01+1": { + "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "d16ab7f1-1909-405c-b707-370048ec9171" ], + "x-ms-client-request-id": [ "ce57afeb-eac4-49cd-b790-634e2673251c" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -102,33 +103,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "97c945bd-2cc2-4707-96a4-86f5060f106b" ], - "x-ms-request-id": [ "4d27ae1c-d61a-453a-973b-8563c9a1bb54" ], - "x-ms-correlation-request-id": [ "a8f035cc-80ea-4935-8fe0-dbe58b44c180" ], - "x-ms-client-request-id": [ "d16ab7f1-1909-405c-b707-370048ec9171" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "671aad90-703f-4db9-8b30-0526507ab6b0" ], + "x-ms-request-id": [ "107d74b6-4d7f-4511-bb72-4720738bad95" ], + "x-ms-correlation-request-id": [ "909eb4c7-2f3b-44db-88b8-5b01e8a20325" ], + "x-ms-client-request-id": [ "ce57afeb-eac4-49cd-b790-634e2673251c" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11994" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072350Z:909eb4c7-2f3b-44db-88b8-5b01e8a20325" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091737Z:a8f035cc-80ea-4935-8fe0-dbe58b44c180" ], - "Date": [ "Mon, 06 Jul 2020 09:17:37 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:23:50 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "709" ], + "Content-Length": [ "762" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7bacc71476\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:23:50.5429086Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$POST+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01+2": { + "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$POST+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/run?api-version=2020-06-01+2": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/run?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/run?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "4" ], - "x-ms-client-request-id": [ "b98b569c-e163-4298-9790-6356cde0b285" ], + "x-ms-client-request-id": [ "f7c1b42e-c314-4937-be4a-799dd5264710" ], "CommandName": [ "Invoke-AzCostManagementExecuteExport" ], "FullCommandName": [ "Invoke-AzCostManagementExecuteExport_ExecuteViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -143,16 +145,16 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "18205cc1-ff38-4a95-9aef-c16dbbfc4988" ], - "x-ms-request-id": [ "35db35b8-a307-4e71-9ffe-5bf8301d5b8f" ], - "x-ms-correlation-request-id": [ "95da9561-b928-474a-bfd2-02a4996862b3" ], - "x-ms-client-request-id": [ "b98b569c-e163-4298-9790-6356cde0b285" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "session-id": [ "ba6dab3b-0775-4f70-9021-191d85b545d5" ], + "x-ms-request-id": [ "3d1f28d9-7c93-4ec9-ab82-e8a57f635bc2" ], + "x-ms-correlation-request-id": [ "70513666-265d-488e-a505-fd31c0ba4a75" ], + "x-ms-client-request-id": [ "f7c1b42e-c314-4937-be4a-799dd5264710" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072352Z:70513666-265d-488e-a505-fd31c0ba4a75" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091738Z:95da9561-b928-474a-bfd2-02a4996862b3" ], - "Date": [ "Mon, 06 Jul 2020 09:17:38 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:23:52 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], @@ -161,14 +163,14 @@ "Content": null } }, - "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01+3": { + "Invoke-AzCostManagementExecuteExport+[NoContext]+ExecuteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/runHistory?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/runHistory?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "5" ], - "x-ms-client-request-id": [ "f221456a-8398-45e0-a566-0ef1543db998" ], + "x-ms-client-request-id": [ "035e700a-9b02-413e-9ebb-8d2e63725211" ], "CommandName": [ "Get-AzCostManagementExportExecutionHistory" ], "FullCommandName": [ "Get-AzCostManagementExportExecutionHistory_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -183,23 +185,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "a547d712-70dd-4121-8ffa-d39c2a97b2c6" ], - "x-ms-request-id": [ "0c86b83d-3d5c-412b-a5e1-6c5f51052e32" ], - "x-ms-correlation-request-id": [ "7bd97d1f-b0fe-4fba-95bf-bd1adfa3c10e" ], - "x-ms-client-request-id": [ "f221456a-8398-45e0-a566-0ef1543db998" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "11ce37cf-b54f-4c7f-b528-5f1cd891bc42" ], + "x-ms-request-id": [ "c0e28c10-573a-4570-873c-8e1f2ebf5ca3" ], + "x-ms-correlation-request-id": [ "f4e04a41-f1c7-447e-8203-999c70d91ba0" ], + "x-ms-client-request-id": [ "035e700a-9b02-413e-9ebb-8d2e63725211" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11992" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072353Z:f4e04a41-f1c7-447e-8203-999c70d91ba0" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T091739Z:7bd97d1f-b0fe-4fba-95bf-bd1adfa3c10e" ], - "Date": [ "Mon, 06 Jul 2020 09:17:38 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:23:52 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "2495" ], + "Content-Length": [ "1574" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/359a6e8b-abcf-45e3-aecf-b9ff3d4fc760\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"Completed\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:13:09.3467006Z\",\"processingStartTime\":\"2020-07-06T09:13:11.7355631Z\",\"processingEndTime\":\"2020-07-06T09:14:13.9746936Z\",\"fileName\":\"ad-hoc/export-38we0i/20200701-20200731/export-38we0i_359a6e8b-abcf-45e3-aecf-b9ff3d4fc760.csv\"}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/05d2edf7-74a0-4bf4-a28a-992fd9c7655e\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:17:34.6964397Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i/Run/93ffc801-3f72-4485-9dd7-a39dfa22d130\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-diya@microsoft.com\",\"submittedTime\":\"2020-07-06T09:17:38.009024Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/46fcbcd5-e265-4d3d-b64d-29730797d629\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:47.826442Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg/Run/7bc55aa1-73c7-4817-a792-a5d18f16c30b\",\"name\":null,\"type\":null,\"eTag\":null,\"properties\":{\"runSettings\":{\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}},\"executionType\":\"OnDemand\",\"status\":\"InProgress\",\"submittedBy\":\"v-lipyo@microsoft.com\",\"submittedTime\":\"2020-11-18T07:23:51.0272403Z\",\"processingStartTime\":null,\"processingEndTime\":null,\"fileName\":null}}]}" } } } \ No newline at end of file diff --git a/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 index 8dac196657d4..7c61a505d6d4 100644 --- a/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 +++ b/src/CostManagement/test/Invoke-AzCostManagementExecuteExport.Tests.ps1 @@ -15,13 +15,13 @@ Describe 'Invoke-AzCostManagementExecuteExport' { It 'Execute' { Invoke-AzCostManagementExecuteExport -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 $exportHist = Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 - $exportHist.Count | Should -Be 2 + $exportHist.Count | Should -Be 1 } It 'ExecuteViaIdentity' { $export = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 Invoke-AzCostManagementExecuteExport -InputObject $export $exportHist = Get-AzCostManagementExportExecutionHistory -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 - $exportHist.Count | Should -Be 3 + $exportHist.Count | Should -Be 2 } } diff --git a/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 b/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 new file mode 100644 index 000000000000..b23cdf81a944 --- /dev/null +++ b/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 @@ -0,0 +1,25 @@ +$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' +if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' +} +. ($loadEnvPath) +$TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostManagementQuery.Recording.json' +$currentPath = $PSScriptRoot +while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent +} +. ($mockingPath | Select-Object -First 1).FullName + +Describe 'Invoke-AzCostManagementQuery' { + It 'UsageExpanded' { + $invbokeQueryResult = Invoke-AzCostManagementQuery -Scope "/subscriptions/$($env.SubscriptionId)" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' + $invbokeQueryResult.Column.Name.Contains('UsageDate') + } + + It 'UsageExpanded1' -skip { + #$DimensionObject = new-AzCostManagementQueryComparisonExpressionObject -name 'ResourceGroup' -Operator 'In' -Value 'API' + #$FilterObject = New-AzCostManagementQueryFilterObject -Dimension $DimensionObject + #Invoke-AzCostManagementQuery -ExternalCloudProviderId 100 -ExternalCloudProviderType externalBillingAccounts -Timeframe MonthToDate -type Usage -DatasetFilter $FilterObject -DatasetGranularity Daily -debug + } +} diff --git a/src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 b/src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 deleted file mode 100644 index ff8cb625bb70..000000000000 --- a/src/CostManagement/test/Invoke-AzCostManagementUsageQuery.Tests.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -$loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' -if (-Not (Test-Path -Path $loadEnvPath)) { - $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' -} -. ($loadEnvPath) -$TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzCostManagementUsageQuery.Recording.json' -$currentPath = $PSScriptRoot -while(-not $mockingPath) { - $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File - $currentPath = Split-Path -Path $currentPath -Parent -} -. ($mockingPath | Select-Object -First 1).FullName - -Describe 'Invoke-AzCostManagementUsageQuery' { - It 'UsageExpanded' -Skip { - # The record file not generated, Because using Invoke-AzRest when call Invoke-AzCostManagementUsageQuery. - # TODO: When Invoke-AzRest support record model. - { Invoke-AzCostManagementUsageQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'daily' } | Should -Not -Throw - } -} diff --git a/src/CostManagement/test/New-AzCostManagementExport.Recording.json b/src/CostManagement/test/New-AzCostManagementExport.Recording.json index 72dac9c415b5..7344ac5256fe 100644 --- a/src/CostManagement/test/New-AzCostManagementExport.Recording.json +++ b/src/CostManagement/test/New-AzCostManagementExport.Recording.json @@ -1,14 +1,14 @@ { - "New-AzCostManagementExport+[NoContext]+CreateExpandedBySubscription+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol?api-version=2019-11-01+1": { + "New-AzCostManagementExport+[NoContext]+CreateExpandedBySubscription+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-x9d0hl?api-version=2020-06-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol?api-version=2019-11-01", - "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"granularity\": \"Daily\"\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-x9d0hl?api-version=2020-06-01", + "Content": "{\r\n \"properties\": {\r\n \"definition\": {\r\n \"dataSet\": {\r\n \"granularity\": \"Daily\"\r\n },\r\n \"type\": \"Usage\",\r\n \"timeframe\": \"MonthToDate\"\r\n },\r\n \"deliveryInfo\": {\r\n \"destination\": {\r\n \"container\": \"exports\",\r\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\r\n \"rootFolderPath\": \"ad-hoc\"\r\n }\r\n },\r\n \"format\": \"Csv\",\r\n \"schedule\": {\r\n \"recurrencePeriod\": {\r\n \"from\": \"2020-11-18T14:33:13.0000000\",\r\n \"to\": \"2020-12-08T14:33:13.0000000\"\r\n },\r\n \"recurrence\": \"Daily\",\r\n \"status\": \"Active\"\r\n }\r\n }\r\n}", "Headers": { }, "ContentHeaders": { "Content-Type": [ "application/json" ], - "Content-Length": [ "700" ] + "Content-Length": [ "726" ] } }, "Response": { @@ -16,36 +16,36 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol?api-version=2019-11-01" ], - "session-id": [ "361a8dc7-600f-48f9-b480-814e2805b158" ], - "x-ms-request-id": [ "9b7c7f17-026c-4665-9b68-c7351118fabf" ], - "x-ms-correlation-request-id": [ "940aeece-adb9-45a5-b838-c40fbf9395fd" ], - "x-ms-client-request-id": [ "82d6e05b-9aeb-4b1e-a93d-dcad8420be2d" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Location": [ "https://costmanagement.trafficmanager.net/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-x9d0hl?api-version=2020-06-01" ], + "session-id": [ "7fcf2ee1-0f52-454b-b52b-c9035a39628e" ], + "x-ms-request-id": [ "a0551e42-d111-48c0-998f-a6aa754c5b30" ], + "x-ms-correlation-request-id": [ "5b87b8d1-a9dd-45e0-ba16-357f8ace82e8" ], + "x-ms-client-request-id": [ "9d4cf527-ae8c-4766-ae7c-d4e152715595" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T071141Z:5b87b8d1-a9dd-45e0-ba16-357f8ace82e8" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11980" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092243Z:940aeece-adb9-45a5-b838-c40fbf9395fd" ], - "Date": [ "Mon, 06 Jul 2020 09:22:42 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:11:40 GMT" ] }, "ContentHeaders": { "Content-Length": [ "709" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-x9d0hl\",\"name\":\"export-x9d0hl\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7a0ff53443\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "New-AzCostManagementExport+[NoContext]+CreateExpandedByResourceGroup+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01+1": { + "New-AzCostManagementExport+[NoContext]+CreateExpandedByResourceGroup+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01", - "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"granularity\": \"Daily\"\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01", + "Content": "{\r\n \"properties\": {\r\n \"definition\": {\r\n \"dataSet\": {\r\n \"granularity\": \"Daily\"\r\n },\r\n \"type\": \"Usage\",\r\n \"timeframe\": \"MonthToDate\"\r\n },\r\n \"deliveryInfo\": {\r\n \"destination\": {\r\n \"container\": \"exports\",\r\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\r\n \"rootFolderPath\": \"ad-hoc\"\r\n }\r\n },\r\n \"format\": \"Csv\",\r\n \"schedule\": {\r\n \"recurrencePeriod\": {\r\n \"from\": \"2020-11-18T14:33:13.0000000\",\r\n \"to\": \"2020-12-08T14:33:13.0000000\"\r\n },\r\n \"recurrence\": \"Daily\",\r\n \"status\": \"Active\"\r\n }\r\n }\r\n}", "Headers": { }, "ContentHeaders": { "Content-Type": [ "application/json" ], - "Content-Length": [ "700" ] + "Content-Length": [ "726" ] } }, "Response": { @@ -53,73 +53,36 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01" ], - "session-id": [ "5b9bb6b5-cc5f-49fc-9af1-aef16afed5ec" ], - "x-ms-request-id": [ "91135221-6de8-4fbe-b4f0-7b0d6c122e40" ], - "x-ms-correlation-request-id": [ "4f2fc077-2b2f-4705-88a4-ee1329c3ea32" ], - "x-ms-client-request-id": [ "8e5a1cc5-b5af-426f-a6d6-d0bd1fd02884" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Location": [ "https://costmanagement.trafficmanager.net/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01" ], + "session-id": [ "c227ef88-20fa-4121-a349-3d15e333a802" ], + "x-ms-request-id": [ "31026004-c411-488d-9b5c-520f6ea480c4" ], + "x-ms-correlation-request-id": [ "7d35ff32-a6b6-41a1-9e8f-d596601c6f87" ], + "x-ms-client-request-id": [ "65950298-7073-4406-985e-bfd3f4f6222b" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11989" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T071142Z:7d35ff32-a6b6-41a1-9e8f-d596601c6f87" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11979" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092244Z:4f2fc077-2b2f-4705-88a4-ee1329c3ea32" ], - "Date": [ "Mon, 06 Jul 2020 09:22:44 GMT" ] - }, - "ContentHeaders": { - "Content-Length": [ "749" ], - "Content-Type": [ "application/json; charset=utf-8" ], - "Expires": [ "-1" ] - }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5\",\"name\":\"export-rs3qh5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377017c569f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" - } - }, - "New-AzCostManagementExport+[NoContext]+CreateExpandedByColumn+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01+1": { - "Request": { - "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01", - "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"configuration\": {\n \"columns\": [ \"SubscriptionGuid\", \"MeterId\", \"InstanceId\", \"ResourceGroup\", \"PreTaxCost\" ]\n },\n \"granularity\": \"Daily\"\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", - "Headers": { - }, - "ContentHeaders": { - "Content-Type": [ "application/json" ], - "Content-Length": [ "838" ] - } - }, - "Response": { - "StatusCode": 201, - "Headers": { - "Cache-Control": [ "no-cache" ], - "Pragma": [ "no-cache" ], - "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01" ], - "session-id": [ "c0a0fcfb-517c-40b0-abfd-74a6fd6f5350" ], - "x-ms-request-id": [ "960a8d4b-ac23-4895-959a-b2c77f6fd30f" ], - "x-ms-correlation-request-id": [ "cdd904bf-1506-42f0-a6e7-f373594a55f9" ], - "x-ms-client-request-id": [ "95a913d0-9eb2-44b7-a4fc-bfb725432239" ], - "Access-Control-Allow-Origin": [ "*" ], "X-Content-Type-Options": [ "nosniff" ], - "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11978" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092246Z:cdd904bf-1506-42f0-a6e7-f373594a55f9" ], - "Date": [ "Mon, 06 Jul 2020 09:22:45 GMT" ] + "Date": [ "Wed, 18 Nov 2020 07:11:42 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "810" ], + "Content-Length": [ "749" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2\",\"name\":\"export-ni0ar2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537702554d6a\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx\",\"name\":\"export-d9y6fx\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7a10dd6183\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "New-AzCostManagementExport+[NoContext]+CreateExpandedByGroup+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft?api-version=2019-11-01+1": { + "New-AzCostManagementExport+[NoContext]+CreateExpandedByColumn+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod?api-version=2020-06-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft?api-version=2019-11-01", - "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"granularity\": \"Daily\",\n \"grouping\": [\n {\n \"name\": \"ResourceGroup\",\n \"type\": \"Dimension\"\n }\n ]\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod?api-version=2020-06-01", + "Content": "{\r\n \"properties\": {\r\n \"definition\": {\r\n \"dataSet\": {\r\n \"configuration\": {\r\n \"columns\": [ \"SubscriptionGuid\", \"MeterId\", \"InstanceId\", \"ResourceGroup\", \"PreTaxCost\" ]\r\n },\r\n \"granularity\": \"Daily\"\r\n },\r\n \"type\": \"Usage\",\r\n \"timeframe\": \"MonthToDate\"\r\n },\r\n \"deliveryInfo\": {\r\n \"destination\": {\r\n \"container\": \"exports\",\r\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\r\n \"rootFolderPath\": \"ad-hoc\"\r\n }\r\n },\r\n \"format\": \"Csv\",\r\n \"schedule\": {\r\n \"recurrencePeriod\": {\r\n \"from\": \"2020-11-18T14:33:13.0000000\",\r\n \"to\": \"2020-12-08T14:33:13.0000000\"\r\n },\r\n \"recurrence\": \"Daily\",\r\n \"status\": \"Active\"\r\n }\r\n }\r\n}", "Headers": { }, "ContentHeaders": { "Content-Type": [ "application/json" ], - "Content-Length": [ "826" ] + "Content-Length": [ "867" ] } }, "Response": { @@ -127,61 +90,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft?api-version=2019-11-01" ], - "session-id": [ "bbebf88b-bfaf-4862-9452-ac4c1d301006" ], - "x-ms-request-id": [ "605da652-113d-459e-9b0a-844f85d8e68f" ], - "x-ms-correlation-request-id": [ "655498cc-40ac-4af0-b979-37f07a1d8009" ], - "x-ms-client-request-id": [ "609dabb6-22f5-432c-8116-44ceff4f8782" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Location": [ "https://costmanagement.trafficmanager.net/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod?api-version=2020-06-01" ], + "session-id": [ "660240c4-6608-4f6e-ac0c-a0d78f49ae3b" ], + "x-ms-request-id": [ "84d4cc5c-9777-48a8-a6fe-6db8e5dce8f4" ], + "x-ms-correlation-request-id": [ "fe40597b-cc97-4013-9e8b-95cd37deb749" ], + "x-ms-client-request-id": [ "fe5b590a-e8af-418d-8232-64a0cb4296dc" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11988" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T071144Z:fe40597b-cc97-4013-9e8b-95cd37deb749" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11977" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092248Z:655498cc-40ac-4af0-b979-37f07a1d8009" ], - "Date": [ "Mon, 06 Jul 2020 09:22:47 GMT" ] - }, - "ContentHeaders": { - "Content-Length": [ "766" ], - "Content-Type": [ "application/json; charset=utf-8" ], - "Expires": [ "-1" ] - }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}" - } - }, - "New-AzCostManagementExport+[NoContext]+CreateExpandedByGroupAggregation+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of?api-version=2019-11-01+1": { - "Request": { - "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of?api-version=2019-11-01", - "Content": "{\n \"properties\": {\n \"definition\": {\n \"dataset\": {\n \"aggregation\": {\n \"costsum\": {\n \"name\": \"PreTaxCost\",\n \"function\": \"sum\"\n },\n \"cost\": {\n \"name\": \"Cost\",\n \"function\": \"sum\"\n }\n },\n \"granularity\": \"Daily\",\n \"grouping\": [\n {\n \"name\": \"ResourceGroup\",\n \"type\": \"Dimension\"\n }\n ]\n },\n \"type\": \"Usage\",\n \"timeframe\": \"MonthToDate\"\n },\n \"deliveryInfo\": {\n \"destination\": {\n \"container\": \"exports\",\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\n \"rootFolderPath\": \"ad-hoc\"\n }\n },\n \"format\": \"Csv\",\n \"schedule\": {\n \"recurrencePeriod\": {\n \"from\": \"2020-07-06T09:13:02.0000000\",\n \"to\": \"2020-07-26T09:13:02.0000000\"\n },\n \"recurrence\": \"Daily\",\n \"status\": \"Active\"\n }\n }\n}", - "Headers": { - }, - "ContentHeaders": { - "Content-Type": [ "application/json" ], - "Content-Length": [ "1052" ] - } - }, - "Response": { - "StatusCode": 201, - "Headers": { - "Cache-Control": [ "no-cache" ], - "Pragma": [ "no-cache" ], - "Location": [ "https://consumption.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of?api-version=2019-11-01" ], - "session-id": [ "f4257420-e658-4922-8a45-5070a7a873f9" ], - "x-ms-request-id": [ "bcbee889-01b3-4622-9367-79d39cc4209e" ], - "x-ms-correlation-request-id": [ "c33b1ea7-0200-4131-ba5e-ce80b54e9f22" ], - "x-ms-client-request-id": [ "61711854-579b-4158-ac78-77280128fe03" ], - "Access-Control-Allow-Origin": [ "*" ], "X-Content-Type-Options": [ "nosniff" ], - "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11976" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092249Z:c33b1ea7-0200-4131-ba5e-ce80b54e9f22" ], - "Date": [ "Mon, 06 Jul 2020 09:22:49 GMT" ] + "Date": [ "Wed, 18 Nov 2020 07:11:44 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "871" ], + "Content-Length": [ "810" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod\",\"name\":\"export-9pcvod\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7a11bbd2e1\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}}" } } } \ No newline at end of file diff --git a/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 b/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 index 767e806850c8..0639a66da637 100644 --- a/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 +++ b/src/CostManagement/test/New-AzCostManagementExport.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'New-AzCostManagementExport' { -RecurrencePeriodTo $env.toDate -Format "Csv" ` -DestinationResourceId $env.storageAccountId ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" + -DatasetGranularity "Daily" $export.ScheduleStatus | Should -Be 'Active' } @@ -30,7 +30,7 @@ Describe 'New-AzCostManagementExport' { -RecurrencePeriodTo $env.toDate -Format "Csv" ` -DestinationResourceId $env.storageAccountId ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" + -DatasetGranularity "Daily" $export.ScheduleStatus | Should -Be 'Active' } @@ -45,59 +45,4 @@ Describe 'New-AzCostManagementExport' { $export.ScheduleStatus | Should -Be 'Active' } - - It 'CreateExpandedByGroup' { - $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName05 ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` - -RecurrencePeriodTo $env.toDate -Format "Csv" ` - -DestinationResourceId $env.storageAccountId ` - -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" ` - -DatasetGrouping @(@{type='Dimension'; name='ResourceGroup'}) - - $export.ScheduleStatus | Should -Be 'Active' - } - It 'CreateExpandedByGroupAggregation' { - #Group Aggregation: Created successfully, No data generated in the storage account - $Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} - $Aggregation2 = @{ name = 'Cost'; function='sum'} - $AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} - - $export = New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName06 ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom $env.fromDate ` - -RecurrencePeriodTo $env.toDate -Format "Csv" ` - -DestinationResourceId $env.storageAccountId ` - -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" ` - -DatasetGrouping @(@{type='Dimension'; name='ResourceGroup'}) ` - -DatasetAggregation $AggregationDict - - $export.ScheduleStatus | Should -Be 'Active' - } - - It 'CreateExpandedByFilter' -skip { - #Filter: Create failed, Invalid dataset filter; on a QueryFilter one and only one of and/or/not/dimension/tag can be set. Invalid dataset - # filter; on a QueryFilter one and only one of and/or/not/dimension/tag can be set. - #TODO: The issue fix. - <# - $orDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') - $queryOrDimension = New-AzCostManagementQueryFilterObject -Dimension $orDimension - $orTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') - $queryOrTag = New-AzCostManagementQueryFilterObject -Tag $orTag - $andOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $orDimension), (New-AzCostManagementQueryFilterObject -Tag $orTag)) - - $dimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' - $andDimension = New-AzCostManagementQueryFilterObject -Dimension $dimension - $fileter = New-AzCostManagementQueryFilterObject -And @($andOr, $andDimension) - - New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "ps-filter-t01" ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-06-29T13:00:00Z" ` - -RecurrencePeriodTo "2020-07-01T00:00:00Z" -Format "Csv" ` - -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount" ` - -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" ` - -DatasetFilter $fileter - #> - } - } diff --git a/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json b/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json index 76df2901aa3e..e09c6f0a7d8d 100644 --- a/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json +++ b/src/CostManagement/test/Remove-AzCostManagementExport.Recording.json @@ -1,12 +1,12 @@ { - "Remove-AzCostManagementExport+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01+1": { + "Remove-AzCostManagementExport+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod?api-version=2020-06-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-ni0ar2?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-9pcvod?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "1" ], - "x-ms-client-request-id": [ "535649f7-37d1-411b-9b2f-dcbf463cfdbb" ], + "x-ms-client-request-id": [ "6097a897-2c94-429f-8141-37ae62564a81" ], "CommandName": [ "Remove-AzCostManagementExport" ], "FullCommandName": [ "Remove-AzCostManagementExport_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -21,16 +21,16 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "f9232219-c998-4ac6-bcf9-e01d0a7305cf" ], - "x-ms-request-id": [ "449a95a0-8a08-4a14-9f3f-22b448eac6d1" ], - "x-ms-correlation-request-id": [ "6013e0f6-10b6-4e53-8f27-7239a2a1e8ef" ], - "x-ms-client-request-id": [ "535649f7-37d1-411b-9b2f-dcbf463cfdbb" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "session-id": [ "99243537-446c-4223-9978-a16597ccc6d1" ], + "x-ms-request-id": [ "adc0e498-627d-4c73-838a-058a536b1dda" ], + "x-ms-correlation-request-id": [ "23aabe0d-4966-4ba4-9fa3-3923e00db19b" ], + "x-ms-client-request-id": [ "6097a897-2c94-429f-8141-37ae62564a81" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11975" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T073529Z:23aabe0d-4966-4ba4-9fa3-3923e00db19b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11989" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092523Z:6013e0f6-10b6-4e53-8f27-7239a2a1e8ef" ], - "Date": [ "Mon, 06 Jul 2020 09:25:22 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:35:29 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], @@ -39,14 +39,14 @@ "Content": null } }, - "Remove-AzCostManagementExport+[NoContext]+Delete+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01+2": { + "Remove-AzCostManagementExport+[NoContext]+Delete+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2020-06-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "739c6edc-d378-45e9-8acd-1b1ddac54c8e" ], + "x-ms-client-request-id": [ "b6609d7f-cc26-46f8-acc3-706cf8c14f75" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_List" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -61,33 +61,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "c675f856-4636-483c-8aaa-768eea00264d" ], - "x-ms-request-id": [ "ce4d168e-38f6-4461-9cd6-edbe683ad303" ], - "x-ms-correlation-request-id": [ "fe419d55-604d-43b3-b298-c88e63feee47" ], - "x-ms-client-request-id": [ "739c6edc-d378-45e9-8acd-1b1ddac54c8e" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "2603e8e7-9c1f-45dd-8187-52fd56799721" ], + "x-ms-request-id": [ "4a915377-e40e-4eae-b685-7cac25c37ae0" ], + "x-ms-correlation-request-id": [ "569bbca1-8fbb-477c-a491-3f8030fcf711" ], + "x-ms-client-request-id": [ "b6609d7f-cc26-46f8-acc3-706cf8c14f75" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11974" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T073530Z:569bbca1-8fbb-477c-a491-3f8030fcf711" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11988" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092524Z:fe419d55-604d-43b3-b298-c88e63feee47" ], - "Date": [ "Mon, 06 Jul 2020 09:25:23 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:35:29 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "26269" ], + "Content-Length": [ "28664" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport4\",\"name\":\"TestExport4\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6425d3647\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport5\",\"name\":\"TestExport5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f679d78775\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport6\",\"name\":\"TestExport6\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6b27ba29f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation\",\"name\":\"TestExportDatasetAggregation\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650e17ad92f21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation123\",\"name\":\"TestExportDatasetAggregation123\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b19fb5559127\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-03T20:00:00+00:00\",\"to\":\"2020-11-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfoyouri\",\"name\":\"TestExportDatasetAggregationInfoyouri\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b33c18099a67\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-05T20:00:00+00:00\",\"to\":\"2020-11-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestUpdate1\",\"name\":\"TestUpdate1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b6451f8f6d83\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-09T20:00:00+00:00\",\"to\":\"2020-11-20T00:00:00+00:00\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:35:30.5064286Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfoYouri\",\"name\":\"TestExportDatasetAggregationInfoYouri\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b738f9459e9e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-13T20:00:00Z\",\"to\":\"2020-11-17T00:00:00Z\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"adhoctest\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationYouriTest\",\"name\":\"TestExportDatasetAggregationYouriTest\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b7120d0af53a\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-10T20:00:00+00:00\",\"to\":\"2020-11-15T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"adhoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfo1118\",\"name\":\"TestExportDatasetAggregationInfo1118\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd716961a536\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T20:00:00Z\",\"to\":\"2020-11-20T00:00:00Z\"}},\"nextRunTimeEstimate\":\"2020-11-18T20:00:00Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/youri-costmanagement/providers/Microsoft.Storage/storageAccounts/youristorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7c8581cbbf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:35:30.5220541Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}]}" } }, - "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01+1": { + "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "6684dacb-2030-4120-b7ad-a486167d3886" ], + "x-ms-client-request-id": [ "10b92aec-4d02-4c03-af0a-8852b2fef666" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_Get" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -102,33 +103,34 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "921183df-cf9f-4104-92ee-3700f5e8aaed" ], - "x-ms-request-id": [ "4a734a96-b3e1-4b92-92e1-578039584923" ], - "x-ms-correlation-request-id": [ "01e6de87-94af-4c75-a3b9-385c9e3cf165" ], - "x-ms-client-request-id": [ "6684dacb-2030-4120-b7ad-a486167d3886" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "deabb3f6-02e7-4184-bbe7-7fc205c6281d" ], + "x-ms-request-id": [ "3467ee37-b4f1-4604-bcbf-72ab1497be1f" ], + "x-ms-correlation-request-id": [ "e4a855da-7c4d-4858-89ad-55ad09bc6263" ], + "x-ms-client-request-id": [ "10b92aec-4d02-4c03-af0a-8852b2fef666" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11973" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T073531Z:e4a855da-7c4d-4858-89ad-55ad09bc6263" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11987" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092524Z:01e6de87-94af-4c75-a3b9-385c9e3cf165" ], - "Date": [ "Mon, 06 Jul 2020 09:25:24 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:35:30 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "749" ], + "Content-Length": [ "802" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5\",\"name\":\"export-rs3qh5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377017c569f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx\",\"name\":\"export-d9y6fx\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7a10dd6183\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-18T14:33:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:35:31.3085144Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" } }, - "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01+2": { + "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01+2": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.CostManagement/exports/export-rs3qh5?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.CostManagement/exports/export-d9y6fx?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "4" ], - "x-ms-client-request-id": [ "8f26b1f2-b17c-4913-9c9f-b47b54502d30" ], + "x-ms-client-request-id": [ "cd8e6c2d-1fb8-4bd1-b055-e389684293f3" ], "CommandName": [ "Remove-AzCostManagementExport" ], "FullCommandName": [ "Remove-AzCostManagementExport_DeleteViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -143,16 +145,16 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "a75be8a6-2f8d-4b2e-b75e-29756e8e9e85" ], - "x-ms-request-id": [ "007defc8-ccf3-448e-b9f3-e3bb81ee6669" ], - "x-ms-correlation-request-id": [ "58d53028-e64b-4974-8365-dafd4fb3e6a0" ], - "x-ms-client-request-id": [ "8f26b1f2-b17c-4913-9c9f-b47b54502d30" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "session-id": [ "3eb9af18-dfff-4861-b606-939129db2f00" ], + "x-ms-request-id": [ "1f69fc51-e1b8-43b5-a7b4-388189b4ae20" ], + "x-ms-correlation-request-id": [ "9e8153c4-0d85-4985-9bac-09254669d89f" ], + "x-ms-client-request-id": [ "cd8e6c2d-1fb8-4bd1-b055-e389684293f3" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11972" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T073532Z:9e8153c4-0d85-4985-9bac-09254669d89f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11986" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092525Z:58d53028-e64b-4974-8365-dafd4fb3e6a0" ], - "Date": [ "Mon, 06 Jul 2020 09:25:25 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:35:31 GMT" ] }, "ContentHeaders": { "Expires": [ "-1" ], @@ -161,14 +163,14 @@ "Content": null } }, - "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01+3": { + "Remove-AzCostManagementExport+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2020-06-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2019-11-01", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports?api-version=2020-06-01", "Content": null, "Headers": { "x-ms-unique-id": [ "5" ], - "x-ms-client-request-id": [ "c3d09aa8-5731-4964-b862-f658e5146650" ], + "x-ms-client-request-id": [ "9cc2bac3-42f9-4cd5-9936-046b57c87b48" ], "CommandName": [ "Get-AzCostManagementExport" ], "FullCommandName": [ "Get-AzCostManagementExport_List" ], "ParameterSetName": [ "__AllParameterSets" ], @@ -183,23 +185,24 @@ "Headers": { "Cache-Control": [ "no-cache" ], "Pragma": [ "no-cache" ], - "session-id": [ "dff4aa38-f47b-4de1-80db-0ead27b421e9" ], - "x-ms-request-id": [ "e4d4e2ab-31c3-4367-bef5-05faaf81dc4a" ], - "x-ms-correlation-request-id": [ "d964c677-9edf-44a7-a2fd-e1857cd728f7" ], - "x-ms-client-request-id": [ "c3d09aa8-5731-4964-b862-f658e5146650" ], - "Access-Control-Allow-Origin": [ "*" ], - "X-Content-Type-Options": [ "nosniff" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "b52ad8b7-3728-4f34-bfab-4d8a2c02409a" ], + "x-ms-request-id": [ "063076f8-77ac-43b8-9e38-d2fd07c1c346" ], + "x-ms-correlation-request-id": [ "eb6279ca-18d3-431c-91e4-0bca44a68271" ], + "x-ms-client-request-id": [ "9cc2bac3-42f9-4cd5-9936-046b57c87b48" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11971" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T073533Z:eb6279ca-18d3-431c-91e4-0bca44a68271" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "x-ms-ratelimit-remaining-subscription-reads": [ "11985" ], - "x-ms-routing-request-id": [ "SOUTHEASTASIA:20200706T092526Z:d964c677-9edf-44a7-a2fd-e1857cd728f7" ], - "Date": [ "Mon, 06 Jul 2020 09:25:26 GMT" ] + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:35:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "26269" ], + "Content-Length": [ "28664" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" ] }, - "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport4\",\"name\":\"TestExport4\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6425d3647\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport5\",\"name\":\"TestExport5\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f679d78775\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\"}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport6\",\"name\":\"TestExport6\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6b27ba29f\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation\",\"name\":\"TestExportDatasetAggregation\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650e17ad92f21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}}]}" + "Content": "{\"value\":[{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport\",\"name\":\"TestExport\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb46c1f5154\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T00:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport1\",\"name\":\"TestExport1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d63fb4a3f75019\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-11T20:00:00+00:00\",\"to\":\"2020-06-20T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport2\",\"name\":\"TestExport2\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f5dda56551\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport3\",\"name\":\"TestExport3\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f6069c44bb\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T02\",\"name\":\"LucasExport-T02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f8ec7b1149\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExport-T03\",\"name\":\"LucasExport-T03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f918708873\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-25T20:00:00+00:00\",\"to\":\"2020-06-29T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/LucasExportT06\",\"name\":\"LucasExportT06\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649f9d2f5df21\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-27T20:00:00+00:00\",\"to\":\"2020-06-28T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t01\",\"name\":\"ps-costext-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d649ff52ae2bb7\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-24T00:00:00+00:00\",\"to\":\"2020-06-26T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t02\",\"name\":\"ps-costext-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d16faa5d7b4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T00:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-costext-t03\",\"name\":\"ps-costext-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1be92e19a4\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:45:28\",\"to\":\"2020-07-18T07:15:28\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/azureps-manual-test/providers/Microsoft.Storage/storageAccounts/lucascostmanagement\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportws5qlv\",\"name\":\"exportws5qlv\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64d1d1164c9ac\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-28T07:53:46\",\"to\":\"2020-07-18T07:23:46\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmkjhje\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t01\",\"name\":\"manual-export-t01\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd725acbcdf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T20:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/manual-export-t02\",\"name\":\"manual-export-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dd8071bf283\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/exportinfo-ps-t\",\"name\":\"exportinfo-ps-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda275a663c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t\",\"name\":\"ps-exportall-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dda37395609\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-customcolum-t\",\"name\":\"ps-customcolum-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddad337a774\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-aggregation-t\",\"name\":\"ps-aggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddb7d30c57d\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}}}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-group-t\",\"name\":\"ps-group-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64ddd2f00c7aa\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-groupaggregation-t\",\"name\":\"ps-groupaggregation-t\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d64dde4850e487\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-06-29T13:00:00+00:00\",\"to\":\"2020-07-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"},\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport10\",\"name\":\"TestExport10\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d650dd9b8ab46b\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T20:00:00+00:00\",\"to\":\"2020-07-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t02\",\"name\":\"ps-exportall-t02\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d651104357293e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/ps-exportall-t03\",\"name\":\"ps-exportall-t03\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65110a073dc56\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-03T08:00:00+00:00\",\"to\":\"2020-08-01T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/lucasstorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9yfan\",\"name\":\"export-u9yfan\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b1674994fd\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-u9sfcn\",\"name\":\"export-u9sfcn\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16952d046\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-cf6scg\",\"name\":\"export-cf6scg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d652b16a169690\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-05T07:41:32\",\"to\":\"2020-07-21T07:41:32\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/lucas-manual-test/providers/Microsoft.Storage/storageAccounts/staaccountmhot0q\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-38we0i\",\"name\":\"export-38we0i\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65375a9692caf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-r6xjol\",\"name\":\"export-r6xjol\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377005b37c6\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-gq1kft\",\"name\":\"export-gq1kft\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6537703972b88\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-j8s5of\",\"name\":\"export-j8s5of\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d65377046dbf7c\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-07-06T09:13:02\",\"to\":\"2020-07-26T09:13:02\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\",\"aggregation\":{\"costsum\":{\"name\":\"PreTaxCost\",\"function\":\"Sum\"},\"cost\":{\"name\":\"Cost\",\"function\":\"Sum\"}},\"grouping\":[{\"type\":\"Dimension\",\"name\":\"ResourceGroup\"}]}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregation123\",\"name\":\"TestExportDatasetAggregation123\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b19fb5559127\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-03T20:00:00+00:00\",\"to\":\"2020-11-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfoyouri\",\"name\":\"TestExportDatasetAggregationInfoyouri\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b33c18099a67\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-05T20:00:00+00:00\",\"to\":\"2020-11-10T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"configuration\":{\"columns\":[\"SubscriptionGuid\",\"MeterId\",\"InstanceId\",\"ResourceGroup\",\"PreTaxCost\"]},\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestUpdate1\",\"name\":\"TestUpdate1\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b6451f8f6d83\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-09T20:00:00+00:00\",\"to\":\"2020-11-20T00:00:00+00:00\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:35:32.9300902Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfoYouri\",\"name\":\"TestExportDatasetAggregationInfoYouri\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b738f9459e9e\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-13T20:00:00Z\",\"to\":\"2020-11-17T00:00:00Z\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"adhoctest\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationYouriTest\",\"name\":\"TestExportDatasetAggregationYouriTest\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6b7120d0af53a\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Daily\",\"recurrencePeriod\":{\"from\":\"2020-11-10T20:00:00+00:00\",\"to\":\"2020-11-15T00:00:00+00:00\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"adhoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExportDatasetAggregationInfo1118\",\"name\":\"TestExportDatasetAggregationInfo1118\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd716961a536\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T20:00:00Z\",\"to\":\"2020-11-20T00:00:00Z\"}},\"nextRunTimeEstimate\":\"2020-11-18T20:00:00Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/youri-costmanagement/providers/Microsoft.Storage/storageAccounts/youristorageaccount\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}},{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7c8581cbbf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:35:32.9300902Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}]}" } } } \ No newline at end of file diff --git a/src/CostManagement/test/Update-AzCostManagementExport.Recording.json b/src/CostManagement/test/Update-AzCostManagementExport.Recording.json new file mode 100644 index 000000000000..6a9283b3031f --- /dev/null +++ b/src/CostManagement/test/Update-AzCostManagementExport.Recording.json @@ -0,0 +1,118 @@ +{ + "Update-AzCostManagementExport+[NoContext]+UpdateExpanded+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+1": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", + "Content": "{\r\n \"eTag\": \"\\\"1d6bd7c6fb60904\\\"\",\r\n \"properties\": {\r\n \"definition\": {\r\n \"dataSet\": {\r\n \"granularity\": \"Daily\"\r\n },\r\n \"type\": \"Usage\",\r\n \"timeframe\": \"MonthToDate\"\r\n },\r\n \"deliveryInfo\": {\r\n \"destination\": {\r\n \"container\": \"exports\",\r\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\r\n \"rootFolderPath\": \"ad-hoc\"\r\n }\r\n },\r\n \"format\": \"Csv\",\r\n \"schedule\": {\r\n \"recurrencePeriod\": {\r\n \"from\": \"2020-11-18T15:18:13.0000000\",\r\n \"to\": \"2020-12-08T14:33:13.0000000\"\r\n },\r\n \"recurrence\": \"Weekly\",\r\n \"status\": \"Active\"\r\n }\r\n }\r\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "761" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "116036c7-5f25-4e8e-98ac-3ba7e661fdc4" ], + "x-ms-request-id": [ "a5913571-3cb3-46f3-a505-cf72a401720b" ], + "x-ms-correlation-request-id": [ "163c4040-64b6-475d-9caf-48f600889e60" ], + "x-ms-client-request-id": [ "d2d4120a-6b1d-4266-819b-7c1dc1c025dd" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11991" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072914Z:163c4040-64b6-475d-9caf-48f600889e60" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:29:14 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "710" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7c83a38ed5\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Update-AzCostManagementExport+[NoContext]+UpdateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", + "Content": null, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "0443d1b0-ce55-4ad5-9dd9-50f92cfe3abf" ], + "CommandName": [ "Get-AzCostManagementExport" ], + "FullCommandName": [ "Get-AzCostManagementExport_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/Az4.0.0-preview" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "761b8792-51a0-44aa-95a9-a79a1a0173c8" ], + "x-ms-request-id": [ "94adf3d4-cda2-47d6-ab6d-30c068dde8c3" ], + "x-ms-correlation-request-id": [ "3ac7c6e2-d839-4eff-9913-13c7dd8698ee" ], + "x-ms-client-request-id": [ "0443d1b0-ce55-4ad5-9dd9-50f92cfe3abf" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11990" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072915Z:3ac7c6e2-d839-4eff-9913-13c7dd8698ee" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:29:14 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "763" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7c83a38ed5\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"nextRunTimeEstimate\":\"2020-11-18T19:29:15.0750135Z\",\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + }, + "Update-AzCostManagementExport+[NoContext]+UpdateViaIdentityExpanded+$PUT+https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01+2": { + "Request": { + "Method": "PUT", + "RequestUri": "https://management.azure.com/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg?api-version=2020-06-01", + "Content": "{\r\n \"eTag\": \"\\\"1d6bd7c83a38ed5\\\"\",\r\n \"properties\": {\r\n \"definition\": {\r\n \"dataSet\": {\r\n \"granularity\": \"Daily\"\r\n },\r\n \"type\": \"Usage\",\r\n \"timeframe\": \"MonthToDate\"\r\n },\r\n \"deliveryInfo\": {\r\n \"destination\": {\r\n \"container\": \"exports\",\r\n \"resourceId\": \"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\r\n \"rootFolderPath\": \"ad-hoc\"\r\n }\r\n },\r\n \"format\": \"Csv\",\r\n \"schedule\": {\r\n \"recurrencePeriod\": {\r\n \"from\": \"2020-11-18T15:18:13.0000000\",\r\n \"to\": \"2020-12-08T14:33:13.0000000\"\r\n },\r\n \"recurrence\": \"Weekly\",\r\n \"status\": \"Active\"\r\n }\r\n }\r\n}", + "Headers": { + }, + "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "761" ] + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "Vary": [ "Accept-Encoding" ], + "session-id": [ "85a03a0d-e76d-403a-b051-36de6304db05" ], + "x-ms-request-id": [ "ecf0b256-3026-49ce-80f4-3a955e62465a" ], + "x-ms-correlation-request-id": [ "cefe2cf0-cc0e-40d8-bc11-138b5bd10a1a" ], + "x-ms-client-request-id": [ "1bcc7462-a6cf-407a-a6d6-65cb3c0020bf" ], + "X-Powered-By": [ "ASP.NET" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11988" ], + "x-ms-routing-request-id": [ "SOUTHEASTASIA:20201118T072917Z:cefe2cf0-cc0e-40d8-bc11-138b5bd10a1a" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "X-Content-Type-Options": [ "nosniff" ], + "Date": [ "Wed, 18 Nov 2020 07:29:17 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "710" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/export-oenfxg\",\"name\":\"export-oenfxg\",\"type\":\"Microsoft.CostManagement/exports\",\"eTag\":\"\\\"1d6bd7c8581cbbf\\\"\",\"properties\":{\"schedule\":{\"status\":\"Active\",\"recurrence\":\"Weekly\",\"recurrencePeriod\":{\"from\":\"2020-11-18T15:18:13\",\"to\":\"2020-12-08T14:33:13\"}},\"format\":\"Csv\",\"deliveryInfo\":{\"destination\":{\"resourceId\":\"/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu\",\"container\":\"exports\",\"rootFolderPath\":\"ad-hoc\"}},\"definition\":{\"type\":\"Usage\",\"timeframe\":\"MonthToDate\",\"dataSet\":{\"granularity\":\"Daily\"}}}}" + } + } +} \ No newline at end of file diff --git a/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 b/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 index 7014d42d40d4..22a037e9d0f3 100644 --- a/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 +++ b/src/CostManagement/test/Update-AzCostManagementExport.Tests.ps1 @@ -12,18 +12,14 @@ while(-not $mockingPath) { . ($mockingPath | Select-Object -First 1).FullName Describe 'Update-AzCostManagementExport' { - It 'UpdateExpanded' -skip { - # Has issue on server, Parameter ResourceID is not null - # TODO: When fix issue on server - $export = Update-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 -RecurrencePeriodFrom $env.toDate - $export.RecurrencePeriodFrom | Should -Be $env.toDate + It 'UpdateExpanded' { + $export = Update-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 -ScheduleRecurrence 'Weekly' + $export.property.ScheduleRecurrence | Should -Be 'Weekly' } - It 'UpdateViaIdentityExpanded' -skip { - # Has issue on server, Parameter ResourceID is not null - # TODO: When fix issue on server + It 'UpdateViaIdentityExpanded' { $oldExport = Get-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 - $export = Update-AzCostManagementExport -InputObject $oldExport -RecurrencePeriodFrom $env.fromDate - $export.RecurrencePeriodFrom | Should -Be $env.fromDate + $export = Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekly' + $export.property.ScheduleRecurrence | Should -Be 'Weekly' } } diff --git a/src/CostManagement/test/env.json b/src/CostManagement/test/env.json index 4e7b60c28d9d..d1f91363faa7 100644 --- a/src/CostManagement/test/env.json +++ b/src/CostManagement/test/env.json @@ -1,17 +1,13 @@ { - "storageAccountId": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-5rij6b/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu", - "location": "eastus", - "resourceGroup": "costmanagement-rg-5rij6b", - "exportName08": "export-93sr8e", - "exportName06": "export-j8s5of", + "exportName03": "export-d9y6fx", + "storageAccountId": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/costmanagement-rg-gali06/providers/Microsoft.Storage/storageAccounts/staaccountjshubiu", "Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "exportName05": "export-gq1kft", - "fromDate": "7/6/2020 9:13:02 AM", - "exportName01": "export-38we0i", - "exportName02": "export-r6xjol", + "exportName04": "export-9pcvod", + "fromDate": "2020/11/18 14:33:13", + "resourceGroup": "costmanagement-rg-gali06", + "toDate": "2020/12/8 14:33:13", "SubscriptionId": "9e223dbe-3399-4e19-88eb-0975f02ac87f", - "toDate": "7/26/2020 9:13:02 AM", - "exportName03": "export-rs3qh5", - "exportName04": "export-ni0ar2", - "exportName07": "export-ktoa73" + "exportName02": "export-x9d0hl", + "location": "eastus", + "exportName01": "export-oenfxg" } diff --git a/src/CostManagement/test/readme.md b/src/CostManagement/test/readme.md index 1969200c6a09..7c752b4c8c43 100644 --- a/src/CostManagement/test/readme.md +++ b/src/CostManagement/test/readme.md @@ -1,5 +1,5 @@ # Test -This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. ## Info - Modifiable: yes diff --git a/src/CostManagement/test/utils.ps1 b/src/CostManagement/test/utils.ps1 index 71818c954ade..9af824ea60d7 100644 --- a/src/CostManagement/test/utils.ps1 +++ b/src/CostManagement/test/utils.ps1 @@ -26,19 +26,11 @@ function setupEnv() { $exportName02 = 'export-' + (RandomString -allChars $false -len 6) $exportName03 = 'export-' + (RandomString -allChars $false -len 6) $exportName04 = 'export-' + (RandomString -allChars $false -len 6) - $exportName05 = 'export-' + (RandomString -allChars $false -len 6) - $exportName06 = 'export-' + (RandomString -allChars $false -len 6) - $exportName07 = 'export-' + (RandomString -allChars $false -len 6) - $exportName08 = 'export-' + (RandomString -allChars $false -len 6) - + $null = $env.Add('exportName01', $exportName01) $null = $env.Add('exportName02', $exportName02) $null = $env.Add('exportName03', $exportName03) $null = $env.Add('exportName04', $exportName04) - $null = $env.Add('exportName05', $exportName05) - $null = $env.Add('exportName06', $exportName06) - $null = $env.Add('exportName07', $exportName07) - $null = $env.Add('exportName08', $exportName08) Write-Host -ForegroundColor Green "Create test group..." $resourceGroup = 'costmanagement-rg-' + (RandomString -allChars $false -len 6) @@ -57,7 +49,7 @@ function setupEnv() { $staaccountParam = Get-Content .\test\deployment-templates\storage-account\parameters.json | ConvertFrom-Json $staaccountParam.parameters.storageAccounts_name = $staaccountName set-content -Path .\test\deployment-templates\storage-account\parameters.json -Value (ConvertTo-Json $staaccountParam) - #> + #> New-AzDeployment -Mode Incremental -TemplateFile .\test\deployment-templates\storage-account\template.json -TemplateParameterFile .\test\deployment-templates\storage-account\parameters.json -ResourceGroupName $env.resourceGroup $staaccountName = 'staaccountjshubiu' # Value in template.json $env.storageAccountId = "/subscriptions/$($env.SubscriptionId)/resourceGroups/$($env.resourceGroup)/providers/Microsoft.Storage/storageAccounts/$($staaccountName)" @@ -67,6 +59,7 @@ function setupEnv() { Write-Host -ForegroundColor Green "Create cost management export for test..." $env.fromDate = (Get-Date).ToString() $env.toDate = (Get-Date).AddDays(20).ToString() + #Create One CostManagementExport New-AzCostManagementExport -Scope "subscriptions/$($env.SubscriptionId)" -Name $env.exportName01 ` -ScheduleStatus "Active" -ScheduleRecurrence "Daily" ` -RecurrencePeriodFrom $env.fromDate -RecurrencePeriodTo $env.toDate ` @@ -75,7 +68,7 @@ function setupEnv() { -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" ` -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" - Invoke-AzCostManagementExecuteExport -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 + # Invoke-AzCostManagementExecuteExport -Scope "subscriptions/$($env.SubscriptionId)" -ExportName $env.exportName01 Write-Host -ForegroundColor Green "The cost management export created successfully." From f2d1c54ec0a07d7844fff5926a3efa3b5a1557ef Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 25 Nov 2020 15:38:50 +0800 Subject: [PATCH 13/17] update some json files --- .../New-AzCostManagementQueryFilterObject.ps1 | 6 +- .../custom/Update-AzCostManagementExport.ps1 | 294 ------------------ .../docs/Get-AzCostManagementExport.md | 8 +- ...-AzCostManagementExportExecutionHistory.md | 18 +- .../docs/Invoke-AzCostManagementQuery.md | 16 +- .../docs/New-AzCostManagementExport.md | 19 +- .../New-AzCostManagementQueryFilterObject.md | 16 +- .../docs/Update-AzCostManagementExport.md | 26 +- .../examples/Update-AzCostManagementExport.md | 21 +- src/CostManagement/examples/readme.md | 11 + src/CostManagement/readme.md | 11 +- src/CostManagement/resources/Create.ps1 | 2 +- 12 files changed, 76 insertions(+), 372 deletions(-) delete mode 100644 src/CostManagement/custom/Update-AzCostManagementExport.ps1 create mode 100644 src/CostManagement/examples/readme.md diff --git a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 index de1ddccc0955..788ac7dd2b96 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 @@ -32,9 +32,9 @@ function New-AzCostManagementQueryFilterObject { [Parameter(HelpMessage="The logical `"AND`" expression. Must have at least 2 items.")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter[]] $And, - [Parameter(HelpMessage="Has comparison expression for a dimension.")] + [Parameter(HelpMessage="Has comparison expression for a dimensions.")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryComparisonExpression] - $Dimension, + $Dimensions, [Parameter(HelpMessage="The logical `"NOT`" expression.")] [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryFilter] $Not, @@ -50,7 +50,7 @@ function New-AzCostManagementQueryFilterObject { $Object = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryFilter]::New() $Object.And = $And - $Object.Dimension = $Dimension + $Object.Dimensions = $Dimensions $Object.Not = $Not $Object.Or = $Or $Object.Tag = $Tag diff --git a/src/CostManagement/custom/Update-AzCostManagementExport.ps1 b/src/CostManagement/custom/Update-AzCostManagementExport.ps1 deleted file mode 100644 index 3fec2b6d7d19..000000000000 --- a/src/CostManagement/custom/Update-AzCostManagementExport.ps1 +++ /dev/null @@ -1,294 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -The operation to create or update a export. -Update operation requires latest eTag to be set in the request. -You may obtain the latest eTag by performing a get operation. -Create operation does not require eTag. -.Description -The operation to create or update a export. -Update operation requires latest eTag to be set in the request. -You may obtain the latest eTag by performing a get operation. -Create operation does not require eTag. -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [AlertId ]: Alert ID - [ExportName ]: Export Name. - [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - [Id ]: Resource identity path - [Scope ]: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. - [ViewName ]: View name -.Link -https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/update-azcostmanagementexport -#> -function Update-AzCostManagementExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Alias('ExportName')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] - [System.String] - # Export Name. - ${Name}, - - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] - [System.String] - # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. - ${Scope}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.String[]] - # Array of column names to be included in the export. - # If not provided then the export will include all available columns. - # The available columns can vary by customer channel (see examples). - ${ConfigurationColumn}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] - # The granularity of rows in the export. - # Currently only 'Daily' is supported. - ${DataSetGranularity}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] - # The time frame for pulling data for the export. - # If custom, then a specific time period must be provided. - ${DefinitionTimeframe}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] - # The type of the export. - # Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. - ${DefinitionType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.String] - # The name of the container where exports will be uploaded. - ${DestinationContainer}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.String] - # The resource id of the storage account where exports will be delivered. - ${DestinationResourceId}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.String] - # The name of the directory where exports will be uploaded. - ${DestinationRootFolderPath}, - - # [Parameter()] - # [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - # [System.String] - # # eTag of the resource. - # # To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. - # ${ETag}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] - # The format of the export being delivered. - # Currently only 'Csv' is supported. - ${Format}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.DateTime] - # The start date of recurrence. - ${RecurrencePeriodFrom}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.DateTime] - # The end date of recurrence. - ${RecurrencePeriodTo}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] - # The schedule recurrence. - ${ScheduleRecurrence}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] - # The status of the export's schedule. - # If 'Inactive', the export's schedule is paused. - ${ScheduleStatus}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.DateTime] - # The start date for export data. - ${TimePeriodFrom}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] - [System.DateTime] - # The end date for export data. - ${TimePeriodTo}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] - [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} - ) - - process { - try { - $getExport - if($PSBoundParameters['InputObject'] -ne $null) - { - $InputExportObject = $PSBoundParameters['InputObject'] - $getExport = Get-AzCostManagementExport -InputObject $InputExportObject - }else{ - $InputExportScope = $PSBoundParameters['Scope'] - $InputExportName = $PSBoundParameters['Name'] - $getExport = Get-AzCostManagementExport -Scope $InputExportScope -Name $InputExportName - } - $null = $PSBoundParameters.Add("ETag",$getExport.Etag) - if($PSBoundParameters['DataSetGranularity'] -eq $null) - { - $null = $PSBoundParameters.Add("DataSetGranularity",$getExport.DataSetGranularity) - } - if($PSBoundParameters['DefinitionTimeframe'] -eq $null) - { - $null = $PSBoundParameters.Add("DefinitionTimeframe",$getExport.DefinitionTimeframe) - } - if($PSBoundParameters['DefinitionType'] -eq $null) - { - $null = $PSBoundParameters.Add("DefinitionType",$getExport.DefinitionType) - } - if($PSBoundParameters['DestinationContainer'] -eq $null) - { - $null = $PSBoundParameters.Add("DestinationContainer",$getExport.DestinationContainer) - } - if($PSBoundParameters['DestinationResourceId'] -eq $null) - { - $null = $PSBoundParameters.Add("DestinationResourceId",$getExport.DestinationResourceId) - } - if($PSBoundParameters['DestinationRootFolderPath'] -eq $null) - { - $null = $PSBoundParameters.Add("DestinationRootFolderPath",$getExport.DestinationRootFolderPath) - } - if($PSBoundParameters['Format'] -eq $null) - { - $null = $PSBoundParameters.Add("Format",$getExport.Format) - } - if($PSBoundParameters['RecurrencePeriodFrom'] -eq $null) - { - $null = $PSBoundParameters.Add("RecurrencePeriodFrom",$getExport.RecurrencePeriodFrom) - } - if($PSBoundParameters['RecurrencePeriodTo'] -eq $null) - { - $null = $PSBoundParameters.Add("RecurrencePeriodTo",$getExport.RecurrencePeriodTo) - } - if($PSBoundParameters['ScheduleStatus'] -eq $null) - { - $null = $PSBoundParameters.Add("ScheduleStatus",$getExport.ScheduleStatus) - } - if($PSBoundParameters['ScheduleRecurrence'] -eq $null) - { - $null = $PSBoundParameters.Add("ScheduleRecurrence",$getExport.ScheduleRecurrence) - } - Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters - } catch { - throw - } - } -} diff --git a/src/CostManagement/docs/Get-AzCostManagementExport.md b/src/CostManagement/docs/Get-AzCostManagementExport.md index 3848e763ac18..0e448b2a32fe 100644 --- a/src/CostManagement/docs/Get-AzCostManagementExport.md +++ b/src/CostManagement/docs/Get-AzCostManagementExport.md @@ -41,9 +41,9 @@ PS C:\> Get-AzCostManagementExport -Scope 'subscriptions/**********' ETag Name Type ---- ---- ---- -"1d63fb46c1f5154" TestExport Microsoft.CostManagement/exports -"1d63fb4a3f75019" TestExport1 Microsoft.CostManagement/exports -"1d649f5dda56551" TestExport2 Microsoft.CostManagement/exports +"************" TestExport Microsoft.CostManagement/exports +"************" TestExport1 Microsoft.CostManagement/exports +"************" TestExport2 Microsoft.CostManagement/exports ``` Get all AzCostManagementExports by Scope @@ -54,7 +54,7 @@ PS C:\> Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**** ETag Name Type ---- ---- ---- -"1d63fb46c1f5154" TestExport Microsoft.CostManagement/exports +"************" TestExport Microsoft.CostManagement/exports ``` Get AzCostManagementExport by Name and scope diff --git a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md index 6ecc6dd77e5e..ffafcc7d5381 100644 --- a/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md +++ b/src/CostManagement/docs/Get-AzCostManagementExportExecutionHistory.md @@ -35,13 +35,8 @@ PS C:\> Get-AzCostManagementExportExecutionHistory -ExportName 'TestExport' -Sco ExecutionType ProcessingStartTime ProcessingEndTime Status FileName ------------- ------------------- ----------------- ------ -------- -Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_e02f95ad-584b-4b83-ba9d-41d398e855af.csv -Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/TestExport_fc41d48d-ef47-4e38-aa1e-323e286c6fcf.csv -Scheduled 2020/6/13 12:02:33 2020/6/13 12:26:33 Failed ad-hoc/TestExport/20200601-20200630/TestExport_076501ee-bf16-424b-807e-ca5c6c23293b.csv -Scheduled 2020/6/14 12:27:28 2020/6/14 12:27:50 Completed ad-hoc/TestExport/20200601-20200630/TestExport_145cb0fa-c808-4a6b-b8bb-14a11d78a0dc.csv -Scheduled 2020/6/15 12:02:34 2020/6/15 12:02:45 Completed ad-hoc/TestExport/20200601-20200630/TestExport_7d6422d0-7a46-4a89-9556-4f616941e8ae.csv -Scheduled 2020/6/16 12:07:31 2020/6/16 12:07:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_f5c68909-63bc-4278-bfa5-2fbe008d78fe.csv -Scheduled 2020/6/17 12:03:56 2020/6/17 12:04:17 Completed ad-hoc/TestExport/20200601-20200630/TestExport_eda8f8fa-7cca-4110-8cba-e64d9f1e4b10.csv +Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_00000000-0000-0000-0000-000000000000.csv +Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/TestExport_00000000-0000-0000-0000-000000000000.csv ``` Get AzCostManagementExportExecutionHistory By ExportName and Scope @@ -53,13 +48,8 @@ Get-AzCostManagementExportExecutionHistory -InputObject $getExport ExecutionType ProcessingStartTime ProcessingEndTime Status FileName ------------- ------------------- ----------------- ------ -------- -Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_e02f95ad-584b-4b83-ba9d-41d398e855af.csv -Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/TestExport_fc41d48d-ef47-4e38-aa1e-323e286c6fcf.csv -Scheduled 2020/6/13 12:02:33 2020/6/13 12:26:33 Failed ad-hoc/TestExport/20200601-20200630/TestExport_076501ee-bf16-424b-807e-ca5c6c23293b.csv -Scheduled 2020/6/14 12:27:28 2020/6/14 12:27:50 Completed ad-hoc/TestExport/20200601-20200630/TestExport_145cb0fa-c808-4a6b-b8bb-14a11d78a0dc.csv -Scheduled 2020/6/15 12:02:34 2020/6/15 12:02:45 Completed ad-hoc/TestExport/20200601-20200630/TestExport_7d6422d0-7a46-4a89-9556-4f616941e8ae.csv -Scheduled 2020/6/16 12:07:31 2020/6/16 12:07:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_f5c68909-63bc-4278-bfa5-2fbe008d78fe.csv -Scheduled 2020/6/17 12:03:56 2020/6/17 12:04:17 Completed ad-hoc/TestExport/20200601-20200630/TestExport_eda8f8fa-7cca-4110-8cba-e64d9f1e4b10.csv +Scheduled 2020/6/11 12:03:20 2020/6/11 12:03:43 Completed ad-hoc/TestExport/20200601-20200630/TestExport_00000000-0000-0000-0000-000000000000.csv +Scheduled 2020/6/12 12:03:37 2020/6/12 12:03:48 Completed ad-hoc/TestExport/20200601-20200630/ ``` Get AzCostManagementExportExecutionHistory By InputObject diff --git a/src/CostManagement/docs/Invoke-AzCostManagementQuery.md b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md index 2f1799e257b7..9ac2c505b1c3 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementQuery.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md @@ -34,13 +34,14 @@ Query the usage data for scope defined. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Invoke AzCostManagementQuery by Scope ```powershell PS C:\> Invoke-AzCostManagementQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage +Invoke-AzCostManagementQuery -Scope "/subscriptions/***********" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' -NextLink Column Row --------- ------ --- - {} {} +NextLink Column Row +-------- ------ --- + {UsageDate, Currency} {20201101 USD, 20201102 USD, 20201103 USD, 20201104 USD…} ``` Invoke AzCostManagementQuery by Scope @@ -48,11 +49,6 @@ Invoke AzCostManagementQuery by Scope ### Example 2: {{ Add title here }} ```powershell PS C:\> {{ Add code here }} -$DimensionObject = new-AzCostManagementQueryComparisonExpressionObject -name 'ResourceGroup' -Operator 'In' -Value 'API' - -$FilterObject = New-AzCostManagementQueryFilterObject -Dimension $DimensionObject - -Invoke-AzCostManagementQuery -ExternalCloudProviderId 100 -ExternalCloudProviderType externalBillingAccounts -Timeframe MonthToDate -type Usage -DatasetFilter $FilterObject -DatasetGranularity Daily -debug {{ Add output here }} @@ -314,7 +310,7 @@ To create the parameters described below, construct a hash table containing the DATASETFILTER : Has filter expression to use in the query. - `[And ]`: The logical "AND" expression. Must have at least 2 items. - - `[Dimension ]`: Has comparison expression for a dimension + - `[Dimensions ]`: Has comparison expression for a dimension - `Name `: The name of the column to use in comparison. - `Operator `: The operator to use for comparison. - `Value `: Array of values to use for comparison diff --git a/src/CostManagement/docs/New-AzCostManagementExport.md b/src/CostManagement/docs/New-AzCostManagementExport.md index ae7677fe0d55..7e575be45fc5 100644 --- a/src/CostManagement/docs/New-AzCostManagementExport.md +++ b/src/CostManagement/docs/New-AzCostManagementExport.md @@ -32,23 +32,16 @@ Create operation does not require eTag. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Create an AzCostManagementExport ```powershell -PS C:\> {{ Add code here }} +PS C:\> New-AzCostManagementExport -Scope "subscriptions/***********" -Name "CostManagementExportTest" -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-10-31T20:00:00Z" -RecurrencePeriodTo "2020-11-30T00:00:00Z" -Format "Csv" -DestinationResourceId "/subscriptions/*************/resourceGroups/ResourceGroupTest/providers/Microsoft.Storage/storageAccounts/storageAccountTest" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" -DatasetGranularity "Daily" -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfosagdhaghj Microsoft.CostManagement/exports ``` -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} +Create an AzCostManagementExport ## PARAMETERS diff --git a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md index 80d9e189d388..6eb30121f73b 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md @@ -14,7 +14,7 @@ On a QueryFilter one and only one of and/or/not/dimension/tag can be set. ## SYNTAX ``` -New-AzCostManagementQueryFilterObject [-And ] [-Dimension ] +New-AzCostManagementQueryFilterObject [-And ] [-Dimensions ] [-Not ] [-Or ] [-Tag ] [] ``` @@ -58,9 +58,9 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Dimension -Has comparison expression for a dimension. -To construct, see NOTES section for DIMENSION properties and create a hash table. +### -Dimensions +Has comparison expression for a dimensions. +To construct, see NOTES section for DIMENSIONS properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryComparisonExpression @@ -143,7 +143,7 @@ To create the parameters described below, construct a hash table containing the AND : The logical "AND" expression. Must have at least 2 items. - `[And ]`: The logical "AND" expression. Must have at least 2 items. - - `[Dimension ]`: Has comparison expression for a dimension + - `[Dimensions ]`: Has comparison expression for a dimension - `Name `: The name of the column to use in comparison. - `Operator `: The operator to use for comparison. - `Value `: Array of values to use for comparison @@ -151,14 +151,14 @@ AND : The logical "AND" expression. Must have at least 2 items. - `[Or ]`: The logical "OR" expression. Must have at least 2 items. - `[Tag ]`: Has comparison expression for a tag -DIMENSION : Has comparison expression for a dimension. +DIMENSIONS : Has comparison expression for a dimensions. - `Name `: The name of the column to use in comparison. - `Operator `: The operator to use for comparison. - `Value `: Array of values to use for comparison NOT : The logical "NOT" expression. - `[And ]`: The logical "AND" expression. Must have at least 2 items. - - `[Dimension ]`: Has comparison expression for a dimension + - `[Dimensions ]`: Has comparison expression for a dimension - `Name `: The name of the column to use in comparison. - `Operator `: The operator to use for comparison. - `Value `: Array of values to use for comparison @@ -168,7 +168,7 @@ NOT : The logical "NOT" expression. OR : The logical "OR" expression. Must have at least 2 items. - `[And ]`: The logical "AND" expression. Must have at least 2 items. - - `[Dimension ]`: Has comparison expression for a dimension + - `[Dimensions ]`: Has comparison expression for a dimension - `Name `: The name of the column to use in comparison. - `Operator `: The operator to use for comparison. - `Value `: Array of values to use for comparison diff --git a/src/CostManagement/docs/Update-AzCostManagementExport.md b/src/CostManagement/docs/Update-AzCostManagementExport.md index ae58d120207b..5c18d1be7835 100644 --- a/src/CostManagement/docs/Update-AzCostManagementExport.md +++ b/src/CostManagement/docs/Update-AzCostManagementExport.md @@ -20,7 +20,7 @@ Create operation does not require eTag. Update-AzCostManagementExport -Name -Scope [-ConfigurationColumn ] [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -30,7 +30,7 @@ Update-AzCostManagementExport -Name -Scope [-ConfigurationColu Update-AzCostManagementExport -InputObject [-ConfigurationColumn ] [-DataSetGranularity ] [-DefinitionTimeframe ] [-DefinitionType ] [-DestinationContainer ] [-DestinationResourceId ] [-DestinationRootFolderPath ] - [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] + [-ETag ] [-Format ] [-RecurrencePeriodFrom ] [-RecurrencePeriodTo ] [-ScheduleRecurrence ] [-ScheduleStatus ] [-TimePeriodFrom ] [-TimePeriodTo ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] ``` @@ -188,13 +188,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ETag +eTag of the resource. +To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Format -[Parameter()] -[Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] -[System.String] -# eTag of the resource. -# To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. -${ETag}, The format of the export being delivered. Currently only 'Csv' is supported. diff --git a/src/CostManagement/examples/Update-AzCostManagementExport.md b/src/CostManagement/examples/Update-AzCostManagementExport.md index 274808b94cc4..093355d11d50 100644 --- a/src/CostManagement/examples/Update-AzCostManagementExport.md +++ b/src/CostManagement/examples/Update-AzCostManagementExport.md @@ -1,23 +1,18 @@ -### Example 1: Update AzCostManagementExport by scope and name +### Example 1: {{ Add title here }} ```powershell -PS C:\>Update-AzCostManagementExport -Scope "subscriptions//*********" -Name "TestExport" -ScheduleRecurrence 'Weekly' +PS C:\> {{ Add code here }} -ETag Name Type ----- ---- ---- -"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports +{{ Add output here }} ``` -Update AzCostManagementExport by Scope and name +{{ Add description here }} -### Example 2: Update AzCostManagementExport by InputObject +### Example 2: {{ Add title here }} ```powershell -PS C:\>$oldExport = Get-AzCostManagementExport -Scope "subscriptions/*********" -Name "TestExport" -Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekly' +PS C:\> {{ Add code here }} -ETag Name Type ----- ---- ---- -"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports +{{ Add output here }} ``` -Update AzCostManagementExport by InputObject +{{ Add description here }} diff --git a/src/CostManagement/examples/readme.md b/src/CostManagement/examples/readme.md new file mode 100644 index 000000000000..ac871d71fc72 --- /dev/null +++ b/src/CostManagement/examples/readme.md @@ -0,0 +1,11 @@ +# Examples +This directory contains examples from the exported cmdlets of the module. When `build-module.ps1` is ran, example stub files will be generated here. If your module support Azure Profiles, the example stubs will be in individual profile folders. These example stubs should be updated to show how the cmdlet is used. The examples are imported into the documentation when `generate-help.ps1` is ran. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Purpose +This separates the example documentation details from the generated documentation information provided directly from the generated cmdlets. Since the cmdlets don't have examples from the REST spec, this provides a means to add examples easily. The example stubs provide the markdown format that is required. The 3 core elements are: the name of the example, the code information of the example, and the description of the example. That information, if the markdown format is followed, will be available to documentation generation and be part of the documents in the `..\docs` folder. \ No newline at end of file diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index d25fe2015f9a..dafa4564aeee 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -87,9 +87,10 @@ directive: parameter-name: Scope parameter-description: This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. - where: - subject: Export - verb: Update - hide: true + model-name: QueryFilter + property-name: Dimension + set: + property-name: Dimensions - where: subject: Export verb: New @@ -146,7 +147,9 @@ directive: return { "type": "string" } - + # - from: swagger-document + # where: $.definitions.QueryFilter.properties + # transform: $ = $.replace('dimension','dimensions'); - no-inline: - QueryFilter - ReportConfigFilter diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 index 361e5f4d7dae..007730e4954c 100644 --- a/src/CostManagement/resources/Create.ps1 +++ b/src/CostManagement/resources/Create.ps1 @@ -15,6 +15,6 @@ New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb- -RecurrencePeriodTo "2020-11-10T00:00:00Z" -Format "Csv" ` -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" -ETag "test" + -DatasetGranularity "Daily" # Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file From 06879f2a7a2de2c0ef3cf1975fe19903df0af8ee Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 2 Dec 2020 14:00:34 +0800 Subject: [PATCH 14/17] Improve code quality --- src/CostManagement/Az.CostManagement.psd1 | 2 +- .../custom/Invoke-AzCostManagementQuery.ps1 | 8 - .../New-AzCostManagementQueryColumnObject.ps1 | 48 --- .../New-AzCostManagementQueryFilterObject.ps1 | 4 +- .../custom/Update-AzCostManagementExport.ps1 | 294 ++++++++++++++++++ src/CostManagement/docs/Az.CostManagement.md | 6 +- .../Invoke-AzCostManagementExecuteExport.md | 2 - .../docs/Invoke-AzCostManagementQuery.md | 21 +- .../New-AzCostManagementQueryColumnObject.md | 81 ----- .../New-AzCostManagementQueryFilterObject.md | 6 +- .../examples/Invoke-AzCostManagementQuery.md | 21 +- .../New-AzCostManagementQueryColumnObject.md | 12 - src/CostManagement/examples/readme.md | 11 - src/CostManagement/readme.md | 57 +++- .../Invoke-AzCostManagementQuery.Tests.ps1 | 14 +- 15 files changed, 380 insertions(+), 207 deletions(-) delete mode 100644 src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 create mode 100644 src/CostManagement/custom/Update-AzCostManagementExport.ps1 delete mode 100644 src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md delete mode 100644 src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md delete mode 100644 src/CostManagement/examples/readme.md diff --git a/src/CostManagement/Az.CostManagement.psd1 b/src/CostManagement/Az.CostManagement.psd1 index 2529f7f1c742..bc15b18ea981 100644 --- a/src/CostManagement/Az.CostManagement.psd1 +++ b/src/CostManagement/Az.CostManagement.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.CostManagement.private.dll' FormatsToProcess = './Az.CostManagement.format.ps1xml' - FunctionsToExport = 'Get-AzCostManagementExport', 'Get-AzCostManagementExportExecutionHistory', 'Invoke-AzCostManagementExecuteExport', 'Invoke-AzCostManagementQuery', 'New-AzCostManagementExport', 'New-AzCostManagementQueryColumnObject', 'New-AzCostManagementQueryComparisonExpressionObject', 'New-AzCostManagementQueryFilterObject', 'Remove-AzCostManagementExport', 'Update-AzCostManagementExport', '*' + FunctionsToExport = 'Get-AzCostManagementExport', 'Get-AzCostManagementExportExecutionHistory', 'Invoke-AzCostManagementExecuteExport', 'Invoke-AzCostManagementQuery', 'New-AzCostManagementExport', 'New-AzCostManagementQueryComparisonExpressionObject', 'New-AzCostManagementQueryFilterObject', 'Remove-AzCostManagementExport', 'Update-AzCostManagementExport', '*' AliasesToExport = '*' PrivateData = @{ PSData = @{ diff --git a/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 index 8e6e17883394..4189b45f48fb 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 @@ -18,14 +18,6 @@ Query the usage data for scope defined. .Description Query the usage data for scope defined. -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} .Inputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryDefinition diff --git a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 deleted file mode 100644 index a34ab560ee1a..000000000000 --- a/src/CostManagement/custom/New-AzCostManagementQueryColumnObject.ps1 +++ /dev/null @@ -1,48 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# Licensed under the Apache License, Version 2.0 (the \"License\"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an \"AS IS\" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---------------------------------------------------------------------------------- - -<# -.Synopsis -Create a in-memory object for QueryColumn -.Description -Create a in-memory object for QueryColumn - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn -.Link -https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject -#> -function New-AzCostManagementQueryColumnObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn')] - [CmdletBinding(PositionalBinding=$false)] - Param( - - [Parameter(HelpMessage="The name of column.")] - [string] - $Name, - [Parameter(HelpMessage="The type of column.")] - [string] - $Type - ) - - process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn]::New() - - $Object.Name = $Name - $Object.Type = $Type - return $Object - } -} - diff --git a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 index 788ac7dd2b96..946aedfa598c 100644 --- a/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementQueryFilterObject.ps1 @@ -15,9 +15,9 @@ <# .Synopsis -Create a in-memory object for QueryFilter. On a QueryFilter one and only one of and/or/not/dimension/tag can be set. +Create a in-memory object for QueryFilter .Description -Create a in-memory object for QueryFilter. On a QueryFilter one and only one of and/or/not/dimension/tag can be set. +Create a in-memory object for QueryFilter .Outputs Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryFilter diff --git a/src/CostManagement/custom/Update-AzCostManagementExport.ps1 b/src/CostManagement/custom/Update-AzCostManagementExport.ps1 new file mode 100644 index 000000000000..3ecf17df8afb --- /dev/null +++ b/src/CostManagement/custom/Update-AzCostManagementExport.ps1 @@ -0,0 +1,294 @@ + +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. +.Description +The operation to create or update a export. +Update operation requires latest eTag to be set in the request. +You may obtain the latest eTag by performing a get operation. +Create operation does not require eTag. +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} +.Example +PS C:\> {{ Add code here }} + +{{ Add output here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AlertId ]: Alert ID + [ExportName ]: Export Name. + [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. + [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. + [Id ]: Resource identity path + [Scope ]: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. + [ViewName ]: View name +.Link +https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/update-azcostmanagementexport +#> +function Update-AzCostManagementExport { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('ExportName')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [System.String] + # Export Name. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [System.String] + # This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostManagementIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String[]] + # Array of column names to be included in the export. + # If not provided then the export will include all available columns. + # The available columns can vary by customer channel (see examples). + ${ConfigurationColumn}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.GranularityType] + # The granularity of rows in the export. + # Currently only 'Daily' is supported. + ${DataSetGranularity}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.TimeframeType] + # The time frame for pulling data for the export. + # If custom, then a specific time period must be provided. + ${DefinitionTimeframe}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.ExportType] + # The type of the export. + # Note that 'Usage' is equivalent to 'ActualCost' and is applicable to exports that do not yet provide data for charges or amortization for service reservations. + ${DefinitionType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The name of the container where exports will be uploaded. + ${DestinationContainer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The resource id of the storage account where exports will be delivered. + ${DestinationResourceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # The name of the directory where exports will be uploaded. + ${DestinationRootFolderPath}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.String] + # eTag of the resource. + # To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. + ${ETag}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.FormatType] + # The format of the export being delivered. + # Currently only 'Csv' is supported. + ${Format}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The start date of recurrence. + ${RecurrencePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The end date of recurrence. + ${RecurrencePeriodTo}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.RecurrenceType] + # The schedule recurrence. + ${ScheduleRecurrence}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType])] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Support.StatusType] + # The status of the export's schedule. + # If 'Inactive', the export's schedule is paused. + ${ScheduleStatus}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The start date for export data. + ${TimePeriodFrom}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Body')] + [System.DateTime] + # The end date for export data. + ${TimePeriodTo}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} + ) + + process { + try { + $getExport + if($PSBoundParameters['InputObject'] -ne $null) + { + $InputExportObject = $PSBoundParameters['InputObject'] + $getExport = Get-AzCostManagementExport -InputObject $InputExportObject + }else{ + $InputExportScope = $PSBoundParameters['Scope'] + $InputExportName = $PSBoundParameters['Name'] + $getExport = Get-AzCostManagementExport -Scope $InputExportScope -Name $InputExportName + } + $null = $PSBoundParameters.Add("ETag",$getExport.Etag) + if($PSBoundParameters['DataSetGranularity'] -eq $null) + { + $null = $PSBoundParameters.Add("DataSetGranularity",$getExport.DataSetGranularity) + } + if($PSBoundParameters['DefinitionTimeframe'] -eq $null) + { + $null = $PSBoundParameters.Add("DefinitionTimeframe",$getExport.DefinitionTimeframe) + } + if($PSBoundParameters['DefinitionType'] -eq $null) + { + $null = $PSBoundParameters.Add("DefinitionType",$getExport.DefinitionType) + } + if($PSBoundParameters['DestinationContainer'] -eq $null) + { + $null = $PSBoundParameters.Add("DestinationContainer",$getExport.DestinationContainer) + } + if($PSBoundParameters['DestinationResourceId'] -eq $null) + { + $null = $PSBoundParameters.Add("DestinationResourceId",$getExport.DestinationResourceId) + } + if($PSBoundParameters['DestinationRootFolderPath'] -eq $null) + { + $null = $PSBoundParameters.Add("DestinationRootFolderPath",$getExport.DestinationRootFolderPath) + } + if($PSBoundParameters['Format'] -eq $null) + { + $null = $PSBoundParameters.Add("Format",$getExport.Format) + } + if($PSBoundParameters['RecurrencePeriodFrom'] -eq $null) + { + $null = $PSBoundParameters.Add("RecurrencePeriodFrom",$getExport.RecurrencePeriodFrom) + } + if($PSBoundParameters['RecurrencePeriodTo'] -eq $null) + { + $null = $PSBoundParameters.Add("RecurrencePeriodTo",$getExport.RecurrencePeriodTo) + } + if($PSBoundParameters['ScheduleStatus'] -eq $null) + { + $null = $PSBoundParameters.Add("ScheduleStatus",$getExport.ScheduleStatus) + } + if($PSBoundParameters['ScheduleRecurrence'] -eq $null) + { + $null = $PSBoundParameters.Add("ScheduleRecurrence",$getExport.ScheduleRecurrence) + } + Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters + } catch { + throw + } + } +} \ No newline at end of file diff --git a/src/CostManagement/docs/Az.CostManagement.md b/src/CostManagement/docs/Az.CostManagement.md index 6bb0b0c6acde..517827181467 100644 --- a/src/CostManagement/docs/Az.CostManagement.md +++ b/src/CostManagement/docs/Az.CostManagement.md @@ -29,15 +29,11 @@ Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -### [New-AzCostManagementQueryColumnObject](New-AzCostManagementQueryColumnObject.md) -Create a in-memory object for QueryColumn - ### [New-AzCostManagementQueryComparisonExpressionObject](New-AzCostManagementQueryComparisonExpressionObject.md) Create a in-memory object for QueryComparisonExpression ### [New-AzCostManagementQueryFilterObject](New-AzCostManagementQueryFilterObject.md) -Create a in-memory object for QueryFilter. -On a QueryFilter one and only one of and/or/not/dimension/tag can be set. +Create a in-memory object for QueryFilter ### [Remove-AzCostManagementExport](Remove-AzCostManagementExport.md) The operation to delete a export. diff --git a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md index ff72e35b0033..f9c775b6ec69 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md @@ -33,7 +33,6 @@ The operation to execute an export. ```powershell PS C:\> Invoke-AzCostManagementExecuteExport -ExportName 'TestExport' -Scope 'subscriptions/**********' -{{ Add output here }} ``` Invoke Export by ExportName and Scope @@ -43,7 +42,6 @@ Invoke Export by ExportName and Scope PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' Invoke-AzCostManagementExecuteExport -InputObject $getExport -{{ Add output here }} ``` Invoke Export by InputObject diff --git a/src/CostManagement/docs/Invoke-AzCostManagementQuery.md b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md index 9ac2c505b1c3..fdac56b591f7 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementQuery.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md @@ -36,25 +36,28 @@ Query the usage data for scope defined. ### Example 1: Invoke AzCostManagementQuery by Scope ```powershell -PS C:\> Invoke-AzCostManagementQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -Invoke-AzCostManagementQuery -Scope "/subscriptions/***********" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' +PS C:\> Invoke-AzCostManagementQuery -Scope "/subscriptions/***********" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' -NextLink Column Row --------- ------ --- - {UsageDate, Currency} {20201101 USD, 20201102 USD, 20201103 USD, 20201104 USD…} +Column Row +------ --- +{UsageDate, Currency} {20201101 USD, 20201102 USD, 20201103 USD, 20201104 USD…} ``` Invoke AzCostManagementQuery by Scope -### Example 2: {{ Add title here }} +### Example 2: Invoke AzCostManagementQuery by Scope with Dimensions ```powershell -PS C:\> {{ Add code here }} +PS C:\> $dimensions = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator 'In' -Value 'API' +$filter = New-AzCostManagementQueryFilterObject -Dimensions $dimensions +Invoke-AzCostManagementQuery -Type Usage -Scope "subscriptions/***********" -DatasetGranularity 'Monthly' -DatasetFilter $filter -Timeframe MonthToDate -Debug -{{ Add output here }} +Column Row +------ --- +{BillingMonth, Currency} {} ``` -{{ Add description here }} +Invoke AzCostManagementQuery by Scope with Dimensions ## PARAMETERS diff --git a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md b/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md deleted file mode 100644 index ae07ee6b0ad6..000000000000 --- a/src/CostManagement/docs/New-AzCostManagementQueryColumnObject.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -external help file: -Module Name: Az.CostManagement -online version: https://docs.microsoft.com/en-us/powershell/module/az.CostManagement/new-AzCostManagementQueryColumnObject -schema: 2.0.0 ---- - -# New-AzCostManagementQueryColumnObject - -## SYNOPSIS -Create a in-memory object for QueryColumn - -## SYNTAX - -``` -New-AzCostManagementQueryColumnObject [-Name ] [-Type ] [] -``` - -## DESCRIPTION -Create a in-memory object for QueryColumn - -## EXAMPLES - -### Example 1: Create a column object of query for cost management export -```powershell -PS C:\> New-AzCostManagementQueryColumnObject -Name 'SubscriptionGuid' -Type 'string' - -Name Type ----- ---- -SubscriptionGuid string -``` - -This command creates a column object of query for cost management export. - -## PARAMETERS - -### -Name -The name of column. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Type -The type of column. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -### Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.QueryColumn - -## NOTES - -ALIASES - -## RELATED LINKS - diff --git a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md index 6eb30121f73b..12170474f4ce 100644 --- a/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md +++ b/src/CostManagement/docs/New-AzCostManagementQueryFilterObject.md @@ -8,8 +8,7 @@ schema: 2.0.0 # New-AzCostManagementQueryFilterObject ## SYNOPSIS -Create a in-memory object for QueryFilter. -On a QueryFilter one and only one of and/or/not/dimension/tag can be set. +Create a in-memory object for QueryFilter ## SYNTAX @@ -19,8 +18,7 @@ New-AzCostManagementQueryFilterObject [-And ] [-Dimensions Invoke-AzCostManagementQuery -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe MonthToDate -Type Usage -Invoke-AzCostManagementQuery -Scope "/subscriptions/***********" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' +PS C:\> Invoke-AzCostManagementQuery -Scope "/subscriptions/***********" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' -NextLink Column Row --------- ------ --- - {UsageDate, Currency} {20201101 USD, 20201102 USD, 20201103 USD, 20201104 USD…} +Column Row +------ --- +{UsageDate, Currency} {20201101 USD, 20201102 USD, 20201103 USD, 20201104 USD…} ``` Invoke AzCostManagementQuery by Scope -### Example 2: {{ Add title here }} +### Example 2: Invoke AzCostManagementQuery by Scope with Dimensions ```powershell -PS C:\> {{ Add code here }} +PS C:\> $dimensions = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator 'In' -Value 'API' +$filter = New-AzCostManagementQueryFilterObject -Dimensions $dimensions +Invoke-AzCostManagementQuery -Type Usage -Scope "subscriptions/***********" -DatasetGranularity 'Monthly' -DatasetFilter $filter -Timeframe MonthToDate -Debug -{{ Add output here }} +Column Row +------ --- +{BillingMonth, Currency} {} ``` -{{ Add description here }} \ No newline at end of file +Invoke AzCostManagementQuery by Scope with Dimensions \ No newline at end of file diff --git a/src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md b/src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md deleted file mode 100644 index a043890b74ba..000000000000 --- a/src/CostManagement/examples/New-AzCostManagementQueryColumnObject.md +++ /dev/null @@ -1,12 +0,0 @@ -### Example 1: Create a column object of query for cost management export -```powershell -PS C:\> New-AzCostManagementQueryColumnObject -Name 'SubscriptionGuid' -Type 'string' - -Name Type ----- ---- -SubscriptionGuid string -``` - -This command creates a column object of query for cost management export. - - diff --git a/src/CostManagement/examples/readme.md b/src/CostManagement/examples/readme.md deleted file mode 100644 index ac871d71fc72..000000000000 --- a/src/CostManagement/examples/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# Examples -This directory contains examples from the exported cmdlets of the module. When `build-module.ps1` is ran, example stub files will be generated here. If your module support Azure Profiles, the example stubs will be in individual profile folders. These example stubs should be updated to show how the cmdlet is used. The examples are imported into the documentation when `generate-help.ps1` is ran. - -## Info -- Modifiable: yes -- Generated: partial -- Committed: yes -- Packaged: no - -## Purpose -This separates the example documentation details from the generated documentation information provided directly from the generated cmdlets. Since the cmdlets don't have examples from the REST spec, this provides a means to add examples easily. The example stubs provide the markdown format that is required. The 3 core elements are: the name of the example, the code information of the example, and the description of the example. That information, if the markdown format is followed, will be available to documentation generation and be part of the documents in the `..\docs` folder. \ No newline at end of file diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index dafa4564aeee..2c8550bf4d11 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -86,15 +86,14 @@ directive: set: parameter-name: Scope parameter-description: This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'. - - where: - model-name: QueryFilter - property-name: Dimension - set: - property-name: Dimensions - where: subject: Export verb: New hide: true + - where: + subject: Export + verb: Update + hide: true - from: source-file-csharp where: $ transform: $ = $.replace(/\/runHistory\$/g, "$"); @@ -147,9 +146,51 @@ directive: return { "type": "string" } - # - from: swagger-document - # where: $.definitions.QueryFilter.properties - # transform: $ = $.replace('dimension','dimensions'); + - from: swagger-document + where: $.definitions.QueryFilter.properties + transform: >- + return { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/QueryFilter" + }, + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/QueryFilter" + }, + "minItems": 2 + }, + "not": { + "description": "The logical \"NOT\" expression.", + "$ref": "#/definitions/QueryFilter" + }, + "dimensions": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/QueryComparisonExpression" + }, + "tag": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/QueryComparisonExpression" + } + } + - where: + model-name: QueryFilter + property-name: Dimension + set: + property-name: Dimensions + - where: + model-name: QueryResult + set: + format-table: + properties: + - Column + - Row - no-inline: - QueryFilter - ReportConfigFilter diff --git a/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 b/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 index b23cdf81a944..9a9071335ebf 100644 --- a/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 +++ b/src/CostManagement/test/Invoke-AzCostManagementQuery.Tests.ps1 @@ -12,14 +12,14 @@ while(-not $mockingPath) { . ($mockingPath | Select-Object -First 1).FullName Describe 'Invoke-AzCostManagementQuery' { - It 'UsageExpanded' { + It 'UsageExpanded' -skip { $invbokeQueryResult = Invoke-AzCostManagementQuery -Scope "/subscriptions/$($env.SubscriptionId)" -Timeframe MonthToDate -Type Usage -DatasetGranularity 'Daily' - $invbokeQueryResult.Column.Name.Contains('UsageDate') + $invbokeQueryResult.Column.Name.Contains('UsageDate') | Should -Be $true } - It 'UsageExpanded1' -skip { - #$DimensionObject = new-AzCostManagementQueryComparisonExpressionObject -name 'ResourceGroup' -Operator 'In' -Value 'API' - #$FilterObject = New-AzCostManagementQueryFilterObject -Dimension $DimensionObject - #Invoke-AzCostManagementQuery -ExternalCloudProviderId 100 -ExternalCloudProviderType externalBillingAccounts -Timeframe MonthToDate -type Usage -DatasetFilter $FilterObject -DatasetGranularity Daily -debug - } + # It 'UsageExpanded1' -skip { + # #$DimensionObject = new-AzCostManagementQueryComparisonExpressionObject -name 'ResourceGroup' -Operator 'In' -Value 'API' + # #$FilterObject = New-AzCostManagementQueryFilterObject -Dimension $DimensionObject + # #Invoke-AzCostManagementQuery -ExternalCloudProviderId 'Microsoft.Compute' -ExternalCloudProviderType externalBillingAccounts -Timeframe MonthToDate -type Usage -DatasetFilter $FilterObject -DatasetGranularity Daily -debug + # } } From 162c9c2318e65ac2a2ffdc6a1db1d54fef931326 Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 2 Dec 2020 15:44:23 +0800 Subject: [PATCH 15/17] Add Examples for cmdlets --- .../custom/Invoke-AzCostManagementQuery.ps1 | 2 -- .../custom/New-AzCostManagementExport.ps1 | 13 ------------ .../Invoke-AzCostManagementExecuteExport.md | 2 ++ .../docs/Invoke-AzCostManagementQuery.md | 2 +- .../docs/Update-AzCostManagementExport.md | 21 ++++++++++++------- .../examples/Update-AzCostManagementExport.md | 21 ++++++++++++------- 6 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 index 4189b45f48fb..ee28a4c61595 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 @@ -74,8 +74,6 @@ PARAMETER : The definition of a query. [DatasetGrouping ]: Array of group by expression to use in the query. Query can have up to 2 group by clauses. Name : The name of the column to group. Type : Has type of the column to group. -.Link -https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery #> function Invoke-AzCostManagementQuery { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult])] diff --git a/src/CostManagement/custom/New-AzCostManagementExport.ps1 b/src/CostManagement/custom/New-AzCostManagementExport.ps1 index c7161bec1291..fa6166f87426 100644 --- a/src/CostManagement/custom/New-AzCostManagementExport.ps1 +++ b/src/CostManagement/custom/New-AzCostManagementExport.ps1 @@ -24,19 +24,6 @@ The operation to create or update a export. Update operation requires latest eTag to be set in the request. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag. -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} -.Example -PS C:\> {{ Add code here }} - -{{ Add output here }} - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport -.Link -https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/new-azcostmanagementexport #> function New-AzCostManagementExport { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IExport])] diff --git a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md index f9c775b6ec69..ff72e35b0033 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md @@ -33,6 +33,7 @@ The operation to execute an export. ```powershell PS C:\> Invoke-AzCostManagementExecuteExport -ExportName 'TestExport' -Scope 'subscriptions/**********' +{{ Add output here }} ``` Invoke Export by ExportName and Scope @@ -42,6 +43,7 @@ Invoke Export by ExportName and Scope PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' Invoke-AzCostManagementExecuteExport -InputObject $getExport +{{ Add output here }} ``` Invoke Export by InputObject diff --git a/src/CostManagement/docs/Invoke-AzCostManagementQuery.md b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md index fdac56b591f7..8852e2339f2a 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementQuery.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementQuery.md @@ -1,7 +1,7 @@ --- external help file: Module Name: Az.CostManagement -online version: https://docs.microsoft.com/en-us/powershell/module/az.cost/invoke-azcostmanagementusagequery +online version: https://docs.microsoft.com/en-us/powershell/module/az.costmanagement/invoke-azcostmanagementquery schema: 2.0.0 --- diff --git a/src/CostManagement/docs/Update-AzCostManagementExport.md b/src/CostManagement/docs/Update-AzCostManagementExport.md index 5c18d1be7835..e1f66ce4e5c0 100644 --- a/src/CostManagement/docs/Update-AzCostManagementExport.md +++ b/src/CostManagement/docs/Update-AzCostManagementExport.md @@ -43,23 +43,28 @@ Create operation does not require eTag. ## EXAMPLES -### Example 1: {{ Add title here }} +### Example 1: Update AzCostManagementExport by scope and name ```powershell -PS C:\> {{ Add code here }} +PS C:\> Update-AzCostManagementExport -Scope "subscriptions//*********" -Name "TestExport" -ScheduleRecurrence 'Weekly' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports ``` -{{ Add description here }} +Update AzCostManagementExport by Scope and name -### Example 2: {{ Add title here }} +### Example 2: Update AzCostManagementExport by InputObject ```powershell -PS C:\> {{ Add code here }} +PS C:\> $oldExport = Get-AzCostManagementExport -Scope "subscriptions/*********" -Name "TestExport" +Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekly' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports ``` -{{ Add description here }} +Update AzCostManagementExport by InputObject ## PARAMETERS diff --git a/src/CostManagement/examples/Update-AzCostManagementExport.md b/src/CostManagement/examples/Update-AzCostManagementExport.md index 093355d11d50..48744b80912b 100644 --- a/src/CostManagement/examples/Update-AzCostManagementExport.md +++ b/src/CostManagement/examples/Update-AzCostManagementExport.md @@ -1,18 +1,23 @@ -### Example 1: {{ Add title here }} +### Example 1: Update AzCostManagementExport by scope and name ```powershell -PS C:\> {{ Add code here }} +PS C:\> Update-AzCostManagementExport -Scope "subscriptions//*********" -Name "TestExport" -ScheduleRecurrence 'Weekly' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports ``` -{{ Add description here }} +Update AzCostManagementExport by Scope and name -### Example 2: {{ Add title here }} +### Example 2: Update AzCostManagementExport by InputObject ```powershell -PS C:\> {{ Add code here }} +PS C:\> $oldExport = Get-AzCostManagementExport -Scope "subscriptions/*********" -Name "TestExport" +Update-AzCostManagementExport -InputObject $oldExport -ScheduleRecurrence 'Weekly' -{{ Add output here }} +ETag Name Type +---- ---- ---- +"********" TestExportDatasetAggregationInfo Microsoft.CostManagement/exports ``` -{{ Add description here }} +Update AzCostManagementExport by InputObject From 7927de395aa032761ad4fd754d14afbcc31f4794 Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 2 Dec 2020 16:24:55 +0800 Subject: [PATCH 16/17] Update the commit id --- .../Invoke-AzCostManagementExecuteExport.md | 2 -- .../Invoke-AzCostManagementExecuteExport.md | 2 -- src/CostManagement/readme.md | 2 +- src/CostManagement/resources/Create.ps1 | 20 ------------------- src/CostManagement/resources/Query.ps1 | 4 ---- 5 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 src/CostManagement/resources/Create.ps1 delete mode 100644 src/CostManagement/resources/Query.ps1 diff --git a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md index ff72e35b0033..f9c775b6ec69 100644 --- a/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/docs/Invoke-AzCostManagementExecuteExport.md @@ -33,7 +33,6 @@ The operation to execute an export. ```powershell PS C:\> Invoke-AzCostManagementExecuteExport -ExportName 'TestExport' -Scope 'subscriptions/**********' -{{ Add output here }} ``` Invoke Export by ExportName and Scope @@ -43,7 +42,6 @@ Invoke Export by ExportName and Scope PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' Invoke-AzCostManagementExecuteExport -InputObject $getExport -{{ Add output here }} ``` Invoke Export by InputObject diff --git a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md index ef684f41758c..cc22ce003f0a 100644 --- a/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md +++ b/src/CostManagement/examples/Invoke-AzCostManagementExecuteExport.md @@ -2,7 +2,6 @@ ```powershell PS C:\> Invoke-AzCostManagementExecuteExport -ExportName 'TestExport' -Scope 'subscriptions/**********' -{{ Add output here }} ``` Invoke Export by ExportName and Scope @@ -12,7 +11,6 @@ Invoke Export by ExportName and Scope PS C:\> $getExport = Get-AzCostManagementExport -Name 'TestExport' -Scope 'subscriptions/**********' Invoke-AzCostManagementExecuteExport -InputObject $getExport -{{ Add output here }} ``` Invoke Export by InputObject diff --git a/src/CostManagement/readme.md b/src/CostManagement/readme.md index 2c8550bf4d11..ba8f2210d58a 100644 --- a/src/CostManagement/readme.md +++ b/src/CostManagement/readme.md @@ -45,12 +45,12 @@ In this directory, run AutoRest: > see https://aka.ms/autorest ``` yaml +Branch: 2cb80cf6668074c84cf02cf45b6bb897eff47e9b require: - $(this-folder)/../readme.azure.noprofile.md input-file: - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.json - $(repo)/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2020-06-01/costmanagement.exports.json - # - $(this-folder)/resources/costmanagement.json title: CostManagement module-version: 0.1.0 diff --git a/src/CostManagement/resources/Create.ps1 b/src/CostManagement/resources/Create.ps1 deleted file mode 100644 index 007730e4954c..000000000000 --- a/src/CostManagement/resources/Create.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -$QueryOrDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceLocation' -Operator In -Value @('East US', 'West Europe') -$QueryOrTag = New-AzCostManagementQueryComparisonExpressionObject -Name 'Environment' -Operator In -Value @('UAT', 'Prod') -$QueryFilterOr = New-AzCostManagementQueryFilterObject -or @((New-AzCostManagementQueryFilterObject -Dimension $QueryOrDimension), (New-AzCostManagementQueryFilterObject -Tag $QueryOrTag)) -$QueryAndDimension = New-AzCostManagementQueryComparisonExpressionObject -Name 'ResourceGroup' -Operator In -Value 'API' -$a = New-AzCostManagementQueryFilterObject -Dimension $QueryAndDimension -$tag = New-AzCostManagementQueryFilterObject -Tag $QueryAndDimension -$QueryFileterAnd = New-AzCostManagementQueryFilterObject -And @($QueryFilterOr, $a) - -$Aggregation1 = @{ name = 'PreTaxCost'; function='sum'} -$Aggregation2 = @{ name = 'Cost'; function='sum'} -$AggregationDict = @{costsum=$aggregation1; cost=$aggregation2} - -New-AzCostManagementExport -Debug -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Name "TestExportDatasetAggregationInfo" ` - -ScheduleStatus "Active" -ScheduleRecurrence "Daily" -RecurrencePeriodFrom "2020-11-03T20:00:00Z" ` - -RecurrencePeriodTo "2020-11-10T00:00:00Z" -Format "Csv" ` - -DestinationResourceId "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/wyunchi-costmanagement/providers/Microsoft.Storage/storageAccounts/wyunchistorageaccount" ` - -DestinationContainer "exports" -DestinationRootFolderPath "ad-hoc" -DefinitionType "Usage" -DefinitionTimeframe "MonthToDate" ` - -DatasetGranularity "Daily" -# Invoke-AzCostManagementUsageQuery -Type AmortizedCost -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -Timeframe 'MonthToDate' -DatasetGranularity 'Daily' - # -DatasetFilter $QueryFilterOr -DatasetGranularity 'Daily' \ No newline at end of file diff --git a/src/CostManagement/resources/Query.ps1 b/src/CostManagement/resources/Query.ps1 deleted file mode 100644 index 40ff8898878b..000000000000 --- a/src/CostManagement/resources/Query.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -$Aggregation1 = @{ name = 'Cost' } -$AggregationDict = @{total=$aggregation1;} -$group = @{name='ResourceGroup'; type='Dimension'} -Invoke-AzCostManagementQuery -Type Usage -Scope "subscriptions/6b085460-5f21-477e-ba44-1035046e9101" -DatasetGranularity 'Daily' -Debug -TimePeriodFrom "2020-08-03T20:00:00Z" -TimePeriodTo "2020-11-10T00:00:00Z" -Timeframe Custom -DatasetAggregation $AggregationDict -DatasetGrouping @($group) \ No newline at end of file From 2bc54ea04ccf0e070a5c6a4f7d54592ec251246c Mon Sep 17 00:00:00 2001 From: Yunchi Wang <54880216+wyunchi-ms@users.noreply.github.com> Date: Wed, 2 Dec 2020 18:04:44 +0800 Subject: [PATCH 17/17] Update Invoke-AzCostManagementQuery.ps1 --- .../custom/Invoke-AzCostManagementQuery.ps1 | 58 +------------------ 1 file changed, 1 insertion(+), 57 deletions(-) diff --git a/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 index ee28a4c61595..f3dd057cfe6a 100644 --- a/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 +++ b/src/CostManagement/custom/Invoke-AzCostManagementQuery.ps1 @@ -18,62 +18,6 @@ Query the usage data for scope defined. .Description Query the usage data for scope defined. - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryDefinition -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.ICostIdentity -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -DATASETFILTER : Has filter expression to use in the query. - [And ]: The logical "AND" expression. Must have at least 2 items. - [Dimension ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Operator : The operator to use for comparison. - Value : Array of values to use for comparison - [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. - [Tag ]: Has comparison expression for a tag - -DATASETGROUPING : Array of group by expression to use in the query. Query can have up to 2 group by clauses. - Name : The name of the column to group. - Type : Has type of the column to group. - -INPUTOBJECT : Identity Parameter - [AlertId ]: Alert ID - [ExportName ]: Export Name. - [ExternalCloudProviderId ]: This can be '{externalSubscriptionId}' for linked account or '{externalBillingAccountId}' for consolidated account used with dimension/query operations. - [ExternalCloudProviderType ]: The external cloud provider type associated with dimension/query operations. This includes 'externalSubscriptions' for linked account and 'externalBillingAccounts' for consolidated account. - [Id ]: Resource identity path - [Scope ]: The scope associated with view operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. - [ViewName ]: View name - -PARAMETER : The definition of a query. - TimePeriodFrom : The start date to pull data from. - TimePeriodTo : The end date to pull data to. - Timeframe : The time frame for pulling data for the query. If custom, then a specific time period must be provided. - Type : The type of the query. - [ConfigurationColumn ]: Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns. - [DatasetAggregation ]: Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses. - [(Any) ]: This indicates any property can be added to this object. - [DatasetFilter ]: Has filter expression to use in the query. - [And ]: The logical "AND" expression. Must have at least 2 items. - [Dimension ]: Has comparison expression for a dimension - Name : The name of the column to use in comparison. - Operator : The operator to use for comparison. - Value : Array of values to use for comparison - [Not ]: The logical "NOT" expression. - [Or ]: The logical "OR" expression. Must have at least 2 items. - [Tag ]: Has comparison expression for a tag - [DatasetGranularity ]: The granularity of rows in the query. - [DatasetGrouping ]: Array of group by expression to use in the query. Query can have up to 2 group by clauses. - Name : The name of the column to group. - Type : Has type of the column to group. #> function Invoke-AzCostManagementQuery { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20200601.IQueryResult])] @@ -329,4 +273,4 @@ function Invoke-AzCostManagementUsageQueryInternal { return $Result } -} \ No newline at end of file +}