Azure / Azure/azure-powershell
`Get-AzContainerAppJobExecution` is missing most properties
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
When running `Get-AzContainerAppJobExecution`, the resulting powershell object is missing most properties from the execution, like Status, StartTime, etc...
### Issue script & Debug output
```PowerShell
PS /> $DebugPreference='Continue'
PS /> $ResourceGroup = "resource-group"
PS /> $ContainerName = "container-app-test"
PS /> $job = Start-AzContainerAppJob -Name $ContainerName -ResourceGroupName $ResourceGroup
DEBUG: 4:03:54 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 4:03:54 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:03:54 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:03:54 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:03:54 PM - GetAzureRMContextCommand end processing.
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/start?api-version=2023-05-01
DEBUG: RequestCreated: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/start?api-version=2023-05-01
DEBUG: HeaderParametersAdded:
DEBUG: BodyContentSet:
DEBUG: 4:03:54 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
POST
Absolute Uri:
https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/start?api-version=2023-05-01
Headers:
x-ms-unique-id : 5
x-ms-client-request-id : 2fe136e4-65b3-4761-94a5-27dec09ecaa4
CommandName : Start-AzContainerAppJob
FullCommandName : Start-AzContainerAppJob_StartExpanded
ParameterSetName : __AllParameterSets
User-Agent : AzurePowershell/v11.2.0,PSVersion/v7.4.0,Az.App/0.0.0
Body:
{}
DEBUG: BeforeCall:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Cache-Control : no-cache
Pragma : no-cache
Vary : Accept-Encoding
x-ms-ratelimit-remaining-subscription-writes: 1199
api-supported-versions : 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview, 2023-11-02-preview, 2024-02-02-preview
X-Powered-By : ASP.NET
x-ms-request-id : 7e82299f-2778-4ecb-b898-e60033a2f289
x-ms-correlation-request-id : 7e82299f-2778-4ecb-b898-e60033a2f289
x-ms-routing-request-id : NORTHCENTRALUS:20240126T160355Z:7e82299f-2778-4ecb-b898-e60033a2f289
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
X-Cache : CONFIG_NOCACHE
X-MSEdge-Ref : Ref A: 8A496B5DEEC941DA967B0E38E22BB10A Ref B: CH1AA2020616045 Ref C: 2024-01-26T16:03:54Z
Date : Fri, 26 Jan 2024 16:03:54 GMT
Body:
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/executions/container-app-test-8vb7sbp",
"name": "container-app-test-8vb7sbp"
}
DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
DEBUG: Finally:
DEBUG: CmdletAfterAPICall:
DEBUG: [CmdletProcessRecordAsyncEnd]: Finish HTTP process
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: AzureQoSEvent: Module: Az.App:1.0.0; CommandName: Start-AzContainerAppJob; PSVersion: 7.4.0; IsSuccess: True; Duration: 00:00:00.9884090
PS /> $execution = Get-AzContainerAppJobExecution -JobName $ContainerName -Name $job.Name -ResourceGroupName $ResourceGroup
DEBUG: 4:04:05 PM - GetAzureRMContextCommand begin processing with ParameterSet 'GetSingleContext'.
DEBUG: 4:04:05 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:04:05 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:04:05 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 4:04:05 PM - GetAzureRMContextCommand end processing.
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/executions/container-app-test-8vb7sbp?api-version=2023-05-01
DEBUG: RequestCreated: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/executions/container-app-test-8vb7sbp?api-version=2023-05-01
DEBUG: HeaderParametersAdded:
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
GET
Absolute Uri:
https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/executions/container-app-test-8vb7sbp?api-version=2023-05-01
Headers:
x-ms-unique-id : 6
x-ms-client-request-id : 29d26dff-4640-4967-85dc-ed2904bd9418
CommandName : Get-AzContainerAppJobExecution
FullCommandName : Get-AzContainerAppJobExecution_Job
ParameterSetName : __AllParameterSets
User-Agent : AzurePowershell/v11.2.0,PSVersion/v7.4.0,Az.App/0.0.0
Body:
DEBUG: BeforeCall:
DEBUG: 4:04:05 PM - [ConfigManager] Got nothing from [EnableLoginByWam], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
OK
Headers:
Cache-Control : no-cache
Pragma : no-cache
Vary : Accept-Encoding
x-ms-ratelimit-remaining-subscription-reads: 11999
api-supported-versions : 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview, 2023-11-02-preview, 2024-02-02-preview
X-Powered-By : ASP.NET
x-ms-request-id : 21ca6fbf-7bcc-417d-9ad0-dfd782ab8c2e
x-ms-correlation-request-id : 21ca6fbf-7bcc-417d-9ad0-dfd782ab8c2e
x-ms-routing-request-id : NORTHCENTRALUS:20240126T160406Z:21ca6fbf-7bcc-417d-9ad0-dfd782ab8c2e
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
X-Cache : CONFIG_NOCACHE
X-MSEdge-Ref : Ref A: 6642DB0D4A4644D4A0ED5A0F614C7619 Ref B: CH1AA2020616045 Ref C: 2024-01-26T16:04:06Z
Date : Fri, 26 Jan 2024 16:04:06 GMT
Body:
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/executions/container-app-test-8vb7sbp",
"name": "container-app-test-8vb7sbp",
"type": "Microsoft.App/jobs/executions",
"properties": {
"status": "Running",
"startTime": "2024-01-26T16:03:55+00:00",
"template": {
"containers": [
{
"image": "my-org.azurecr.io/docker-test:v2",
"name": "container-app-test",
"env": [
{
"name": "CONTAINER_APP_JOB_NAME",
"value": "container-app-test"
}
],
"resources": {
"cpu": 0.5,
"memory": "1Gi",
"ephemeralStorage": ""
}
}
],
"initContainers": []
}
}
}
DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
DEBUG: Finally:
DEBUG: CmdletAfterAPICall:
DEBUG: [CmdletProcessRecordAsyncEnd]: Finish HTTP process
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: AzureQoSEvent: Module: Az.App:1.0.0; CommandName: Get-AzContainerAppJobExecution; PSVersion: 7.4.0; IsSuccess: True; Duration: 00:00:00.6665176
PS /> $execution.Status
PS /> $execution.ToJsonString()
{
"name": "container-app-test-8vb7sbp",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group/providers/Microsoft.App/jobs/container-app-test/executions/container-app-test-8vb7sbp",
"type": "Microsoft.App/jobs/executions"
}
```
### Environment data
```PowerShell
PS /> $PSVersionTable
Name Value
---- -----
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Ubuntu 20.04.6 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Running on Docker. Image is mcr.microsoft.com/azure-powershell:latest (e543c0f068a0). Docker engine is v24.0.7
```
### Module versions
```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.15.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzC…
Script 1.0.0 Az.App {Disable-AzContainerAppRevision, Enable-AzCon…
```
### Error output
```PowerShell
No results pertinent to the debugged lines above
```
Contributor guide
Research direction
Start at the Get-AzContainerAppJobExecution entry point and compare its returned object with the properties shown in the 2023-05-01 REST response. Verify that fields such as Status and StartTime are exposed and appear in ToJsonString(); done means the execution object contains the response properties reported in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100