Azure / Azure/azure-powershell

Container App - Enable-AzContainerAppRevision failed when ACA created via BICEP

Open
#22,607 5 comments 0 reactions 0 assignees View on GitHub
act-observability-squad bug ContainerApp Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

I have a process to disable and re-enable my container revision at night in staging using Disable-AzContainerAppRevision and Enable-AzContainerAppRevision. When I create my ACA using azure powershell no issue but since I move to create my ACA using BICEP template, the Enable-AzContainerAppRevision is failing.

### Issue script & Debug output

```PowerShell
Enable-AzContainerAppRevision -ContainerAppName "*****" -ResourceGroupName "****" -RevisionName "*****"
DEBUG: 9:22:54 PM - GetAzureRMContextCommand end processing.
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: /subscriptions/*****/resourceGroups/****/providers/Microsoft.App/containerApps/****/revisions/****/activate?api-version=2022-03-01
DEBUG: RequestCreated: /subscriptions/****/resourceGroups/****/providers/Microsoft.App/containerApps/****/***/activate?api-version=2022-03-01
DEBUG: HeaderParametersAdded:
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://management.azure.com/subscriptions/******/resourceGroups/*****/providers/Microsoft.App/containerApps/****/revisions/*****/activate?api-version=2022-03-01

Headers:
x-ms-unique-id : 9
x-ms-client-request-id : *******
CommandName : Enable-AzContainerAppRevision
FullCommandName : Enable-AzContainerAppRevision_Activate
ParameterSetName : __AllParameterSets
User-Agent : AzurePowershell/v0.0.0,PSVersion/v7.3.6,Az.App/0.1.1

Body:

DEBUG: BeforeCall:
DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Conflict

Headers:
Cache-Control : no-cache
Pragma : no-cache
x-ms-ratelimit-remaining-subscription-writes: 1199
api-supported-versions : 2022-01-01-preview, 2022-03-01, 2022-06-01-preview, 2022-10-01, 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview
Server : Microsoft-IIS/10.0
X-Powered-By : ASP.NET
x-ms-request-id : 5e1c346b-1c46-416f-960b-60bcecc360ae
x-ms-correlation-request-id : 5e1c346b-1c46-416f-960b-60bcecc360ae
x-ms-routing-request-id : CANADAEAST:20230819T212257Z:5e1c346b-1c46-416f-960b-60bcecc360ae
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Date : Sat, 19 Aug 2023 21:22:56 GMT

Body:
{
"error": {
"code": "RevisionOperationError",
"message": "Error activating revision ****RevisionName****. Details Reason: Bad Request. Body: {\"error\":\"the revision you are trying to activate ****RevisionName**** references registry int which is no longer defined, please add registry int back and try again\",\"success\":false}"
}
}

DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
Enable-AzContainerAppRevision_Activate: Error activating revision ****RevisionName****. Details Reason: Bad Request. Body: {"error":"the revision you are trying to activate ****RevisionName**** references registry int which is no longer defined, please add registry int back and try again","success":false}
DEBUG: [Finally]: Getting exception 'Microsoft.Azure.Commands.Common.Exceptions.AzPSCloudException: InternalException' from response
DEBUG: Finally:
DEBUG: CmdletAfterAPICall:
DEBUG: [CmdletProcessRecordAsyncEnd]: Finish HTTP process
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletProcessRecordEnd:
DEBUG: AzureQoSEvent: Module: Az.App:0.1.1; CommandName: Enable-AzContainerAppRevision; PSVersion: 7.3.6; IsSuccess: False; Duration: 00:00:01.9294137; Exception: InternalException;
```

### Environment data

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

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.12.5 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 0.1.1 Az.App {Disable-AzContainerAppRevision, Enable-AzContainerAppRevision, Get-AzContainerApp, Get-AzContainerAppAuthConfig…}
```

### Error output

```PowerShell
DEBUG: Got version 0 of Az
DEBUG: Got version 0 of Az.Accounts
DEBUG: 9:50:23 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 9:50:23 PM - using account id '******'...
DEBUG: 9:50:23 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].

HistoryId: 3

Message : [RevisionOperationError] : Error activating revision ******. Details Reason: Bad Request. Body: {"error":"the revision you are trying to activate
****** references registry int which is no longer defined, please add registry int back and try again","success":false}
StackTrace :
Exception : System.Exception
InvocationInfo : {Enable-AzContainerAppRevision_Activate}
Line : Enable-AzContainerAppRevision -ContainerAppName "******" -ResourceGroupName "******" -RevisionName "******"
Position : At line:1 char:1
+ Enable-AzContainerAppRevision -ContainerAppName "****** …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 3

DEBUG: 9:50:23 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.12.5; CommandName: Resolve-AzError; PSVersion: 7.3.6; IsSuccess: True; Duration: 00:00:00.1054381
DEBUG: 9:50:23 PM - [ConfigManager] Got nothing from
```

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.