Skip to content

Update-AzCostManagementExport: Invalid request payload, Invalid member :properties.schedule.recurrence #27730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
msqishengc opened this issue May 11, 2025 · 1 comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Cost Management - UsageDetailsAndExport All issues in cost management and Consumption for usage details api and export Service Attention This issue is responsible by Azure service team.

Comments

@msqishengc
Copy link

Description

I have a cost export working until around May 6th, that when using Update-AzCostManagementExport to update its start and end time it throws error
Invalid request payload, Invalid member :properties.schedule.recurrence

Cmd tried:

Update-AzCostManagementExport -Scope "/subscriptions/$azSubId" -Name $exportName -TimePeriodFrom $startDate -TimePeriodTo $endDate -DefinitionTimeframe "Custom" -ScheduleStatus "InActive" -Format "CSV" -DefinitionType "Usage" -DatasetGranularity "Daily" -RecurrencePeriodTo (Get-Date) -RecurrencePeriodFrom (Get-Date) -ErrorAction Stop

Update-AzCostManagementExport -Scope "/subscriptions/$azSubId" -Name $exportName -TimePeriodFrom $startDate -TimePeriodTo $endDate -DefinitionTimeframe "Custom" -ScheduleStatus "InActive" -Format "CSV" -DefinitionType "Usage" -DatasetGranularity "Daily" -ErrorAction Stop

Issue script & Debug output

PS C:\Users\<replaced_**>> $DebugPreference='Continue'
PS C:\Users\<replaced_**>> Update-AzCostManagementExport -Scope "/subscriptions/$azSubId" -Name $exportName  -TimePeriodFrom $startDate -TimePeriodTo $endDate -DefinitionTimeframe "Custom" -ScheduleStatus "InActive"  -Format "CSV"  -DefinitionType "Usage"  -DatasetGranularity "Daily"  -RecurrencePeriodTo (Get-Date) -RecurrencePeriodFrom (Get-Date) -ErrorAction Stop
DEBUG: 10:00:12 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:12 AM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 10:00:12 AM - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Get-AzContext].
DEBUG: 10:00:12 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:12 AM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:12 AM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:12 AM - No authentication telemetry is found for the current cmdlet with Id f4371ca7-0ca1-4685-beed-d606901ca701.
DEBUG: AzureQoSEvent:  Module: Az.Accounts:4.2.0; CommandName: Get-AzContext; PSVersion: 7.5.1; IsSuccess: True; Duration: 00:00:00.0016659; SanitizeDuration: 00:00:00.0000518
DEBUG: 10:00:12 AM - [ConfigManager] Got nothing from [EnableDataCollection], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:13 AM - GetAzureRMContextCommand end processing.
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:13 AM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 10:00:13 AM - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Get-AzContext].
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:00:13 AM - GetAzureRMContextCommand end processing.
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: //subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com?api-version=2021-10-01
DEBUG: RequestCreated: //subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com?api-version=2021-10-01
DEBUG: HeaderParametersAdded:
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com//subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com?api-version=2021-10-01

Headers:
x-ms-unique-id                : 8
x-ms-client-request-id        : f8df3926-d35e-484f-ac10-2abb391322f1
CommandName                   : Get-AzCostManagementExport
FullCommandName               : Get-AzCostManagementExport_Get
ParameterSetName              : __AllParameterSets
User-Agent                    : AzurePowershell/v0.0.0,PSVersion/v7.5.1,Az.CostManagement/0.1.0

Body:



DEBUG: BeforeCall:
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: 10:00:13 AM - [ConfigManager] Got [False] from [EnableLoginByWam], Module = [], Cmdlet = [].
DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
OK

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
Vary                          : Accept-Encoding
session-id                    : b2d454ce-7722-4308-9347-9bac72529e82
x-ms-request-id               : 38087b7b-ff59-4c38-a65d-8a649be2a800
x-ms-correlation-id           : 3a28c083-3b6a-496d-a465-8a19387ca4b7
x-ms-correlation-request-id   : 6417eea4-0f64-402f-9cac-1008e465d9f4
x-ms-client-request-id        : f8df3926-d35e-484f-ac10-2abb391322f1
X-Powered-By                  : ASP.NET
x-ms-operation-identifier     : tenantId=3c39752e-0592-48db-912f-c54b4552eefe,objectId=18020e8e-c521-4bc4-8d8a-14db25a4faa0/westus2/2851b60b-1531-4ab1-90e6-acebe702955a
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-routing-request-id       : WESTUS2:20250511T170017Z:6417eea4-0f64-402f-9cac-1008e465d9f4
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 7373C16915E942A99F2A547BC918F160 Ref B: MWH011020806052 Ref C: 2025-05-11T17:00:16Z
Date                          : Sun, 11 May 2025 17:00:16 GMT

Body:
{
  "id": "subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com",
  "name": "a830edad9050849stxprod0120b_sharepoint_com",
  "type": "Microsoft.CostManagement/exports",
  "eTag": "\"1dbbde31cbbe959\"",
  "properties": {
    "schedule": {
      "status": "Inactive",
      "recurrencePeriod": {
        "from": "2025-05-05T17:28:22.8907407Z",
        "to": "2025-05-05T17:28:22.8906513Z"
      }
    },
    "format": "Csv",
    "deliveryInfo": {
      "destination": {
        "resourceId": "/subscriptions/<information_replaced_**>/resourceGroups/CostExportAutomationRG/providers/Microsoft.Storage/storageAccounts/costexpsa20240913",
        "container": "automationcontainer",
        "rootFolderPath": "costexport"
      }
    },
    "definition": {
      "type": "Usage",
      "timeframe": "Custom",
      "timePeriod": {
        "from": "2025-04-03T00:00:00Z",
        "to": "2025-05-05T00:00:00Z"
      },
      "dataSet": {
        "granularity": "Daily"
      }
    }
  }
}


DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
DEBUG: Finally:
DEBUG: CmdletAfterAPICall:
DEBUG: [CmdletProcessRecordAsyncEnd]: Finish HTTP process
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: //subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com?api-version=2021-10-01
DEBUG: RequestCreated: //subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com?api-version=2021-10-01
DEBUG: HeaderParametersAdded:
DEBUG: BodyContentSet:
DEBUG: 10:00:13 AM - [ConfigManager] Got nothing from [DisableInstanceDiscovery], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com//subscriptions/<information_replaced_**>/providers/Microsoft.CostManagement/exports/a830edad9050849stxprod0120b_sharepoint_com?api-version=2021-10-01

Headers:
x-ms-unique-id                : 9
x-ms-client-request-id        : f76f1aeb-5b91-4c9f-8778-c28e7a8283f5
CommandName                   : Az.CostManagement.internal\Update-AzCostManagementExport
FullCommandName               : Update-AzCostManagementExport_UpdateExpanded
ParameterSetName              : __AllParameterSets
User-Agent                    : AzurePowershell/v0.0.0,PSVersion/v7.5.1,Az.CostManagement/0.1.0

Body:
{
  "eTag": "\"1dbbde31cbbe959\"",
  "properties": {
    "deliveryInfo": {
      "destination": {
        "resourceId": "/subscriptions/<information_replaced_**>/resourceGroups/CostExportAutomationRG/providers/Microsoft.Storage/storageAccounts/costexpsa20240913",
        "container": "automationcontainer",
        "rootFolderPath": "costexport",
        "sasToken": "",
        "storageAccount": ""
      }
    },
    "definition": {
      "timePeriod": {
        "from": "2025-04-09T00:00:00",
        "to": "2025-05-11T00:00:00"
      },
      "dataSet": {
        "granularity": "Daily"
      },
      "type": "Usage",
      "timeframe": "Custom"
    },
    "format": "CSV",
    "partitionData": false,
    "schedule": {
      "recurrencePeriod": {
        "from": "2025-05-11T10:00:12.9816626-07:00",
        "to": "2025-05-11T10:00:12.9815716-07:00"
      },
      "status": "InActive",
      "recurrence": ""
    }
  }
}


DEBUG: 10:00:13 AM - [ConfigManager] Got [False] from [EnableLoginByWam], Module = [], Cmdlet = [].
DEBUG: BeforeCall:
DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
BadRequest

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
session-id                    : 9f858fe6-977a-4b91-826b-90989e29526c
x-ms-request-id               : 99ef4ac5-cf4e-4f90-b55a-aaa088c90215
x-ms-correlation-id           : 9c932afb-1948-4af3-a4ac-55ca3550b805
X-Powered-By                  : ASP.NET
x-ms-operation-identifier     : tenantId=3c39752e-0592-48db-912f-c54b4552eefe,objectId=18020e8e-c521-4bc4-8d8a-14db25a4faa0/westus/42274643-13dd-4c34-b7a1-5f07d8ffbf6e
x-ms-ratelimit-remaining-subscription-reads: 249
x-ms-ratelimit-remaining-subscription-global-reads: 3749
x-ms-correlation-request-id   : 97cec2df-d938-4f09-8dd2-a6fa061fe288
x-ms-routing-request-id       : WESTUS:20250511T170017Z:97cec2df-d938-4f09-8dd2-a6fa061fe288
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: 9560F2C51D064C4D9940AD8B49090412 Ref B: MWH011020806052 Ref C: 2025-05-11T17:00:17Z
Date                          : Sun, 11 May 2025 17:00:17 GMT

Body:
{
  "error": {
    "code": "400",
    "message": "Invalid request payload, Invalid member :properties.schedule.recurrence"
  }
}


DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
DEBUG: CmdletProcessRecordEnd:
Update-AzCostManagementExport_UpdateExpanded: C:\Users\<replaced_**>\OneDrive - Microsoft\Documents\PowerShell\Modules\Az.CostManagement\0.4.0\CostManagement.Autorest\custom\Update-AzCostManagementExport.ps1:375
Line |
 375 |  …             Az.CostManagement.internal\Update-AzCostManagementExport|                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Invalid request payload, Invalid member :properties.schedule.recurrence

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     4.2.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     0.4.0                 Az.CostManagement                   {Get-AzCostManagementExport, Get-AzCostManagementExportExecutionHistory, Invoke-AzCostManagementExecuteExport, Invoke-AzCostManagementQuery…}
Script     7.11.0                Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     8.4.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…}

Error output

DEBUG: 10:06:18 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 10:06:18 AM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 10:06:18 AM - using account id 'syntex@m365x33941147.onmicrosoft.com'...
DEBUG: 10:06:18 AM - [ConfigManager] Got [False] from [DisplayBreakingChangeWarning], Module = [Az.Accounts], Cmdlet = [Resolve-AzError].
DEBUG: 10:06:18 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].

   HistoryId: 53

Message        : [400] : Invalid request payload, Invalid member :properties.schedule.recurrence
StackTrace     :
Exception      : System.Exception
InvocationInfo : {Update-AzCostManagementExport_UpdateExpanded}
Line           :                 Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters

Position       : At C:\Users\qishengc\OneDrive - Microsoft\Documents\PowerShell\Modules\Az.CostManagement\0.4.0\CostManagement.Autorest\custom\Update-AzCostManagementExport.ps1:375 char:17
                 + …             Az.CostManagement.internal\Update-AzCostManagementExport+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 53

DEBUG: 10:06:19 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].

   HistoryId: 51

Message        : [400] : Invalid request payload, Invalid member :properties.schedule.recurrence
StackTrace     :
Exception      : System.Exception
InvocationInfo : {Update-AzCostManagementExport_UpdateExpanded}
Line           :                 Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters

Position       : At C:\Users\qishengc\OneDrive - Microsoft\Documents\PowerShell\Modules\Az.CostManagement\0.4.0\CostManagement.Autorest\custom\Update-AzCostManagementExport.ps1:375 char:17
                 + …             Az.CostManagement.internal\Update-AzCostManagementExport+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 51

DEBUG: 10:06:19 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].

   HistoryId: 50

Message        : [400] : Invalid request payload, Invalid member :properties.schedule.recurrence
StackTrace     :
Exception      : System.Exception
InvocationInfo : {Update-AzCostManagementExport_UpdateExpanded}
Line           :                 Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters

Position       : At C:\Users\qishengc\OneDrive - Microsoft\Documents\PowerShell\Modules\Az.CostManagement\0.4.0\CostManagement.Autorest\custom\Update-AzCostManagementExport.ps1:375 char:17
                 + …             Az.CostManagement.internal\Update-AzCostManagementExport+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 50

DEBUG: 10:06:19 AM - [ConfigManager] Got nothing from [DisplaySecretsWarning], Module = [], Cmdlet = []. Returning default value [True].

   HistoryId: 49

Message        : [400] : Invalid request payload, Invalid member :properties.schedule.recurrence
StackTrace     :
Exception      : System.Exception
InvocationInfo : {Update-AzCostManagementExport_UpdateExpanded}
Line           :                 Az.CostManagement.internal\Update-AzCostManagementExport @PSBoundParameters

Position       : At C:\Users\qishengc\OneDrive - Microsoft\Documents\PowerShell\Modules\Az.CostManagement\0.4.0\CostManagement.Autorest\custom\Update-AzCostManagementExport.ps1:375 char:17
                 + …             Az.CostManagement.internal\Update-AzCostManagementExport+               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 49
@msqishengc msqishengc added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels May 11, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 11, 2025
@isra-fel isra-fel added Service Attention This issue is responsible by Azure service team. Cost Management - UsageDetailsAndExport All issues in cost management and Consumption for usage details api and export labels May 16, 2025
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @TiagoCrewGitHubIssues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Cost Management - UsageDetailsAndExport All issues in cost management and Consumption for usage details api and export Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants