azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

New/Update-AzTag on Flex Consumption Service Plan fails

Open rsegers opened this issue 2 months ago • 3 comments

Description

Creating, updating and deleting tags fail on Azure Service Plans if it has the sku flex consumption.

Issue script & Debug output

Update-AzTag -ResourceId '<resourceId>' -Tag @{'example'='example'} -Operation Merge


DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PATCH

Absolute Uri:
https://management.azure.com/{resourceId}/providers/Microsoft.Resources/tags/default?api-version=2024-11-01

Headers:
Accept-Language               : en-US
x-ms-client-request-id        : 59b8bedc-32b3-428a-be70-a5e94168f80f

Body:
{
  "operation": "Merge",
  "properties": {
    "tags": {
      "example": "example"
    }
  }
}


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

Status Code:
BadRequest

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-failure-cause            :
x-ms-request-id               : 85bfce1a-9503-44e9-936d-4a8d1c7233fb
x-ms-correlation-request-id   : 85bfce1a-9503-44e9-936d-4a8d1c7233fb
x-ms-routing-request-id       : NORTHEUROPE:20251024T121043Z:85bfce1a-9503-44e9-936d-4a8d1c7233fb
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
X-Cache                       : CONFIG_NOCACHE
X-MSEdge-Ref                  : Ref A: E751AFE583BC4173A73A02FCB4FD4A7C Ref B: DUB241062310029 Ref C: 2025-10-24T12:10:42Z
Date                          : Fri, 24 Oct 2025 12:10:42 GMT

Body:
{
  "error": {
    "code": "ProviderError",
    "message": "{\"Code\":\"BadRequest\",\"Message\":\"Cannot update ServerFarm SKU from 'FlexConsumption' to ''. Please create a new ServerFarm with the desired SKU.\",\"Target\":null,\"Details\":[{\"Message\":\"Cannot update ServerFarm SKU from 'FlexConsumption' to ''. Please create a new ServerFarm with the desired SKU.\"},{\"Code\":\"BadRequest\"},{\"ErrorEntity\":{\"ExtendedCode\":\"53216\",\"MessageTemplate\":\"Cannot update ServerFarm SKU from '{0}' to '{1}'. Please create a new ServerFarm with the desired SKU.\",\"Parameters\":[\"FlexConsumption\",\"\"],\"Code\":\"BadRequest\",\"Message\":\"Cannot update ServerFarm SKU from 'FlexConsumption' to ''. Please create a new ServerFarm with the desired SKU.\"}}],\"Innererror\":null}"
  }
}

Environment data

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

Module versions

PS C:\> Get-Module Az.*

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     5.3.0                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     8.1.1                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}

Error output

PS C:\> Resolve-AzError

Resolve-AzError: Input string was not in a correct format. Failure to parse near offset 16. Expected an ASCII digit.

rsegers avatar Oct 24 '25 12:10 rsegers

Validation has been tested and the same behavior exists across client tools and within the Portal. Assigning to the service team for further investigation on the desired API behavior

teresaritorto avatar Nov 17 '25 08:11 teresaritorto

@CooperLink @pragnagopa - Do you know who owns the tags for Flex Consumption plan resources? Thank you.

Francisco-Gamino avatar Nov 26 '25 21:11 Francisco-Gamino

Adding @nzthiago and @amamounelsayed for FYI

Francisco-Gamino avatar Nov 26 '25 21:11 Francisco-Gamino