Skip to content

Conversation

@harshpatel17
Copy link
Contributor

@harshpatel17 harshpatel17 commented Oct 16, 2025

Description

Removed the temporary bandaid to handle 3 failing LocalDeployCommand tests. These tests were initially failing because when ResourceType was serialized with modern scope properties, the serializer incorrectly included null legacy scope properties.

This causes extension resources like request@v1 to be incorrectly flagged as ReadOnly, triggering BCP245 errors:
"Resource type 'request@v1' can only be used with the 'existing' keyword" in LocalDeployCommand tests.

The serializer was fixed in bicep-types and this PR also makes the update to that newest version.

Example Usage

Checklist

Microsoft Reviewers: Open in CodeFlow

@harshpatel17 harshpatel17 changed the title Draft Implement fixed scope parameter serializer and remove bandaid Oct 16, 2025
@github-actions
Copy link
Contributor

Test this change out locally with the following install scripts (Action run 18565104590)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 18565104590
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 18565104590"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 18565104590
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 18565104590"

@harshpatel17 harshpatel17 changed the title Implement fixed scope parameter serializer and remove bandaid Draft PR: Implement fixed scope parameter serializer and remove bandaid Oct 16, 2025
@github-actions
Copy link
Contributor

Dotnet Test Results

    96 files   -     48      96 suites   - 48   42m 44s ⏱️ - 22m 10s
12 417 tests  -     13  12 417 ✅  -     13  0 💤 ±0  0 ❌ ±0 
28 579 runs   - 14 283  28 579 ✅  - 14 283  0 💤 ±0  0 ❌ ±0 

Results for commit 45c3928. ± Comparison against base commit d8b8c9e.

This pull request removes 1920 and adds 652 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
�ӱ
�0\u0010\u0006��>E�\u0001�%�$���"��\u0000�=�bki+\u0004�w�\u000e���V0ߘ;���/fk��2�\u001b�(\u0015�\u0004{7�\u0018���;��I�\u0000\u000c�6\u0011cܿ}�\u001e�uu7�7��A*��\u000bZHk�(�h\u0014Q\u000c��Ѥ��C5��ʵ�E^f�š9���b�}�g\u0006\u0003����\u0015��?DȤ\u0006�
\u0010�b`4�.�_����§��|EiKي�-��9߹cCױg\u000b� \u0008>�\u0006�x�$\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��K
�0\u0010\u0006�=EO��\u000cy.�w�\u0015�\u0016|�T�\u0014\u000b��M\u0017��\u00167�\u0015̷�0d2�������\u001dʦ����
"%���\u0000%2�/�@K�\u0018���'\u0019ѵ�5q�%��Ad2\u0017NUY�V�HYa��F\u001a��X�O�0��p,:�����s[����jX��ɨ���֊>�\u001f�\u0018JЂ@\u0008�1�H:���L�y�'H�$I��\u00044��_\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
���\u000b�0\u0014\u0007��+�?`n�禁��CFX\u0010t��B\u0006Z���?�<D\u0017��?��9�=���w�٫z��8)J�\u0003x\u000e%}c�@l]op���7F�tŜ\u0010��}�\u0016��R�\u001ee��~\u0010x���,	�\u0014L��]��y>\u0008��ڹ��}뮪K��qR�ky˛���}�c\u001a\u001d>�7�\u0015}�?\u0003$�e\u0012�!r L��u�G����i��q�
W��a\u0017�\u000bK��S�d\u0018�a\u000c�\u0005YD�\u0010\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��K
�0\u0010\u0006�=E�\u0001b�i���\u0008n<@lG��Z�
\u0005��\u000bq��\u000f�|���LH~���v\u000b6��&�\u000b�&hl��R��w�4��7��QJ ���7�q�\u001b[�U���x�m��\u00103���*\u0014�P#u���Ւ�\u001a�pi�s�\u0015)��Rߊ�=\u001fj_��ހ��M7�[����)�U8��%�j%��ϒ�?��\u0003\u0007�\u0002�\u0012�\u0006�\u001d�G��
>�k
ϥw�<���\u00022�܄\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��K\u000e�0\u0010\u0006�=\u0005'(3C_,ػ�
���\u0008�@�$ƻ[\u0016&. n\u0010L��d2Ӵ?Ow�ߖ�P6-�(�)gs�@	1z>@�\u000c�\u000b0�R(ƒ~�MFt��MXe�Y?�Lb��*\u000b�
\u0014I�	�\u001b\u00002�&���5L��\u001f��]\}s���nh��\u001a־h4����5�S��\u0007a(A\u000b\u0002"I!�H2���L�y�7��(���\u0004��\u001b�\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003���
�@\u0010\u0007�=�\u0014�\u0003��_�\u0005\u001e�\u000e\u0019aA�5�\�@\u000b5\u0010z��CtQ��\u0011������2���W�Z�D\u0017%f�	\u000f����s��� \""�\u0000�\u0014�!�Խo��QV�0��1�\u0007��QU��H\u001f|*\u0002&0���C�L��U#s箪K�扮��M{��>�7�\u000e��
7�[��rD\u0004HN�R�|�\u0005�&��d����t����F��氋݅c�:�N�eY��^�m��\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("output loopOutput array = [for i in range(0, 2): {
  prop: map(containerWorkers, (w) => w.properties.ipAddress.ip)
}]")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("resource propertyLoop 'Microsoft.ContainerInstance/containerGroups@2022-09-01' = {
  name: 'gh9440-loop'
  location: 'westus'
  properties: {
    containers: [for i in range(0, 2): {
      name: 'gh9440-w1c-${i}'
      properties: {
        command: [
          'echo "${join(map(containerWorkers, (w) => w.properties.ipAddress.ip), ',')}"'
        ]
      }
    }]
  }
}")
Bicep.Core.IntegrationTests.DirectResourceCollectionTests ‑ DirectResourceCollectionAccess_NotAllowedWithinLoops ("var loopVar = [for i in range(0, 2): {
  prop: map(containerWorkers, (w) => w.properties.ipAddress.ip)
}]")
Bicep.Core.IntegrationTests.Emit.ParamsFileWriterTests ‑ Params_file_with_no_errors_should_compile_correctly ("
using 'main.bicep'

// involves all syntax
param myParam = {
  arr: [
    {
      a : 'b'
    }
    {
      c : true
    }
  ]
  name: 'complex object!'
  priority: 3
  val: null
  obj: {
      a: 'b'
      c: [
          'd'
           1
      ]
  }
}","
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "myParam": {
      "value": {
        "arr" : [
          {
            "a" : "b"
          },
          {
            "c" : true
          }
        ],
        "name" : "complex object!",
        "priority" : 3,
        "val" : null,
        "obj" : {
          "a" : "b",
          "c" : [
            "d",
            1
          ]
        }
      }
    }
  }
}","
param myParam object
")
…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants