Azure / Azure/azure-powershell

Get-AzImageBuilderTemplate returns Internal error occurred. This is a generic error

Open
#19,401 7 comments 0 reactions 0 assignees View on GitHub
bug customer-reported ImageBuilder needs-team-attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Hi,

I'm automating the Azure Image Build process using Azure DevOps pipelines, this takes a couple of steps.

Run Invoke-AzResourceAction to start the image build process for a specific template
use Get-AzImageBuilderTemplate with a while loop to continuously get the run
At first I thought that a 30 second wait was giving connection timeouts due to to many calls or something, and a run takes a while so increasing it to 5 minutes was a logical step.

But it seems that after about 25 minutes (so 5 calls with Get-AzImageBuilderTemplate) it only keeps returning Internal error occurred. This is a generic error. The build is still running and will complete successfully, but I am unable to get the status and checking the LastRunStatusRunState.

The while loop is doing a Get-AzImageBuilderTemplate every 5 minutes, stores it in a variable while LastRunStatusRunState -eq "Running".

After about 20 to 25 min it starts returning expected output again. Doesn't matter if you run the command 2 times per 30 minutes of 20 times per 3 minutes, behavior stays the same.

### Issue script & Debug output

```PowerShell
Get-AzImageBuilderTemplate -ImageTemplateName $templateName -ResourceGroupName $templateResourceGroupName
```

### Environment data

```PowerShell
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
7 2 6
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 0.2.0 Az.ImageBuilder
```

### Error output

```PowerShell
Get-AzImageBuilderTemplate_Get: Internal error occurred. This is a generic error. To identify possible causes, go to https://aka.ms/azvmimagebuilderts.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.