microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.45k stars 2.6k forks source link

[BUG]: Deployment template validation failed: 'The provided value for the template parameter '<an object type parameter>' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'. #19942

Open lgp1985 opened 2 months ago

lgp1985 commented 2 months ago

New issue checklist

Task name

AzureResourceManagerTemplateDeployment@3

Task version

3.238.0

Issue Description

I need to pass a parameter from YAML pipelines on Azure DevOps into AzureResourceManagerTemplateDeployment@3 input: overrideParameters.

If I use convertToJson(), I receive:

overrideParameters: -CommonCfg ${{ convertToJson(parameters.CommonCfg) }}

[error]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.

Instead, if avoid using convertToJson(), I receive:

overrideParameters: -CommonCfg ${{ parameters.CommonCfg }}

(Line: 68, Col: 41): Unable to convert from Object to String. Value: Object


Below are reference codes

pipeline.yml

pool:
  vmImage: ubuntu-latest

parameters:
  - name: ProductName
    type: string
    default: "Supply"
  - name: deploymentStage
    type: string
    default: "dev"
  - name: CommonCfg
    type: object
    default:
      {
        "common":
          {
            "appName": "prdmgmt",
            "appShortName": "REDACTED",
            "applicationShortName": "REDACTED",
            "bu": "set",
            "appID": "l",
            "resourceGroupLocation": "eastus",
            "applicationOwner": "REDACTED",
            "Description": "REDACTED",
            "TopicName": "REDACTED",
            "serviceBusTopicSubscription1": "REDACTED",
            "serviceBusTopicSubscription2": "REDACTED",
            "maxDeliveryCount": 100,
          },
        "resourcegroup":
          {
            "ServiceLevel": "Standard",
            "Recovery": "Manual",
            "DataCI": "not sensitive",
          },
      }

stages:
  - stage: Deploy_to_${{ parameters.deploymentStage }}
    variables:
      system.debug: true
    jobs:
      - deployment:
        displayName: Deploy to ${{ parameters.deploymentStage }}
        environment: ${{ lower(parameters.CommonCfg.common.bu) }}-${{ parameters.CommonCfg.common.appName }}-iac-${{ parameters.deploymentStage }}2
        strategy:
          runOnce:
            deploy:
              steps:
                - checkout: self
                - task: AzureResourceManagerTemplateDeployment@3
                  displayName: "Deploy Bicep Template"
                  inputs:
                    deploymentScope: "Subscription"
                    azureResourceManagerConnection: "sc-${{ lower(parameters.CommonCfg.common.bu) }}-${{ parameters.deploymentStage }}-${{ lower(parameters.ProductName) }}"
                    subscriptionId: "9dcc2f3d-3764-40ee-9e84-43bac166ec9a"
                    location: "East US"
                    templateLocation: "Linked artifact"
                    csmFile: "$(System.DefaultWorkingDirectory)/infrastructure/standard-bicep/main.bicep"
                    overrideParameters: -CommonCfg ${{ convertToJson(parameters.CommonCfg) }}
                    deploymentMode: "Incremental"

main.bicep

@allowed([
  'dev'
  'stg'
  'uat'
  'prod'
])
@maxLength(4)
param deploymentStage string = 'dev'

import { CommonType } from 'CommonType.bicep'
param CommonCfg CommonType = {
  common: {
    appName: 'REDACTED'
    appShortName: 'REDACTED'
    applicationShortName: 'REDACTED'
    bu: 'REDACTED'
    appID: 'l'
    resourceGroupLocation: 'eastus'
    applicationOwner: 'REDACTED'
    Description: 'REDACTED'
    TopicName: 'REDACTED'
    serviceBusTopicSubscription1: 'REDACTED'
    serviceBusTopicSubscription2: 'REDACTED'
    maxDeliveryCount: 100
  }
  resourcegroup: {
    ServiceLevel: 'Standard'
    Recovery: 'Manual'
    DataCI: 'not sensitive'
  }
}

@maxLength(64)
param resourceGroupName string = toLower('rg-${CommonCfg.common.bu}-${deploymentStage}-${CommonCfg.common.appShortName}-${CommonCfg.common.appID}')

output resourceGroupName string = resourceGroupName

CommonType.bicep

@export()
type CommonType = {
  common: {
    appName: string
    appShortName: string
    applicationShortName: string
    bu: string
    appID: string
    resourceGroupLocation: string
    applicationOwner: string
    Description: string
    TopicName: string
    serviceBusTopicSubscription1: string
    serviceBusTopicSubscription2: string
    maxDeliveryCount: int
  }
  resourcegroup: {
    ServiceLevel: string
    Recovery: string
    DataCI: string
  }
}

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04.4 LTS

Relevant log output

There were errors in your deployment. Error code: InvalidTemplate.
##[error]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Task failed while creating or updating the template deployment.. Please follow https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
Starting Deployment.
Deployment name is main-20240603-185511-e4c9
There were errors in your deployment. Error code: InvalidTemplate.
##[error]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
##[error]Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
##[error]Task failed while creating or updating the template deployment.

Full task logs with system.debug enabled

 
2024-06-03T23:50:29.6005506Z ##[debug]Evaluating condition for step: 'Deploy Bicep Template'
2024-06-03T23:50:29.6006828Z ##[debug]Evaluating: SucceededNode()
2024-06-03T23:50:29.6007125Z ##[debug]Evaluating SucceededNode:
2024-06-03T23:50:29.6007729Z ##[debug]=> True
2024-06-03T23:50:29.6008142Z ##[debug]Result: True
2024-06-03T23:50:29.6008436Z ##[section]Starting: Deploy Bicep Template
2024-06-03T23:50:29.6016747Z ==============================================================================
2024-06-03T23:50:29.6017126Z Task         : ARM template deployment
2024-06-03T23:50:29.6017236Z Description  : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
2024-06-03T23:50:29.6017364Z Version      : 3.238.0
2024-06-03T23:50:29.6017433Z Author       : Microsoft Corporation
2024-06-03T23:50:29.6017517Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
2024-06-03T23:50:29.6017684Z ==============================================================================
2024-06-03T23:50:29.8455899Z ##[debug]Using node path: /home/vsts/agents/3.239.1/externals/node16/bin/node
2024-06-03T23:50:30.1758258Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2024-06-03T23:50:30.1770188Z ##[debug]loading inputs and endpoints
2024-06-03T23:50:30.1775484Z ##[debug]loading INPUT_DEPLOYMENTSCOPE
2024-06-03T23:50:30.1791117Z ##[debug]loading INPUT_CONNECTEDSERVICENAME
2024-06-03T23:50:30.1792426Z ##[debug]loading INPUT_SUBSCRIPTIONNAME
2024-06-03T23:50:30.1794481Z ##[debug]loading INPUT_ACTION
2024-06-03T23:50:30.1796497Z ##[debug]loading INPUT_LOCATION
2024-06-03T23:50:30.1798468Z ##[debug]loading INPUT_TEMPLATELOCATION
2024-06-03T23:50:30.1801676Z ##[debug]loading INPUT_CSMFILE
2024-06-03T23:50:30.1805176Z ##[debug]loading INPUT_CSMPARAMETERSFILE
2024-06-03T23:50:30.1807395Z ##[debug]loading INPUT_OVERRIDEPARAMETERS
2024-06-03T23:50:30.1812029Z ##[debug]loading INPUT_DEPLOYMENTMODE
2024-06-03T23:50:30.1816021Z ##[debug]loading INPUT_ADDSPNTOENVIRONMENT
2024-06-03T23:50:30.1821855Z ##[debug]loading INPUT_USEWITHOUTJSON
2024-06-03T23:50:30.1840546Z ##[debug]loading ENDPOINT_AUTH_77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4
2024-06-03T23:50:30.1841350Z ##[debug]loading ENDPOINT_AUTH_SCHEME_77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4
2024-06-03T23:50:30.1841832Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4_TENANTID
2024-06-03T23:50:30.1842303Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4_SERVICEPRINCIPALID
2024-06-03T23:50:30.1842826Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4_AUTHENTICATIONTYPE
2024-06-03T23:50:30.1846127Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4_SERVICEPRINCIPALKEY
2024-06-03T23:50:30.1846616Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2024-06-03T23:50:30.1847038Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2024-06-03T23:50:30.1848245Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2024-06-03T23:50:30.1875733Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2024-06-03T23:50:30.1876342Z ##[debug]loaded 22
2024-06-03T23:50:30.1876802Z ##[debug]Agent.ProxyUrl=undefined
2024-06-03T23:50:30.1877871Z ##[debug]Agent.CAInfo=undefined
2024-06-03T23:50:30.1878295Z ##[debug]Agent.ClientCert=undefined
2024-06-03T23:50:30.1879003Z ##[debug]Agent.SkipCertValidation=undefined
2024-06-03T23:50:30.2202246Z ##[debug]agent.proxyurl=undefined
2024-06-03T23:50:30.2203295Z ##[debug]VSTS_ARM_REST_IGNORE_SSL_ERRORS=undefined
2024-06-03T23:50:30.2204491Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_2ebdce2f-7ae5-43ff-b6be-32748fd1d53b_build_5439_0
2024-06-03T23:50:30.4039499Z ##[debug]check path : /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4044132Z ##[debug]adding resource file: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4045802Z ##[debug]system.culture=en-US
2024-06-03T23:50:30.4058594Z ##[debug]Agent.TempDirectory=/home/vsts/work/_temp
2024-06-03T23:50:30.4071137Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4169514Z ##[debug]check path : /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-artifacts-common/module.json
2024-06-03T23:50:30.4173518Z ##[debug]adding resource file: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-artifacts-common/module.json
2024-06-03T23:50:30.4177143Z ##[debug]system.culture=en-US
2024-06-03T23:50:30.4189385Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-artifacts-common/module.json
2024-06-03T23:50:30.4200061Z ##[debug]agent.proxyurl=undefined
2024-06-03T23:50:30.4202330Z ##[debug]VSTS_ARM_REST_IGNORE_SSL_ERRORS=undefined
2024-06-03T23:50:30.4205026Z ##[debug]AZURE_HTTP_USER_AGENT=VSTS_2ebdce2f-7ae5-43ff-b6be-32748fd1d53b_build_5439_0
2024-06-03T23:50:30.4229716Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4234757Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4248801Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4252203Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4259368Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4266467Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4270047Z ##[debug]Setting resource path to /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/task.json
2024-06-03T23:50:30.4272742Z ##[debug]check path : /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/task.json
2024-06-03T23:50:30.4275615Z ##[debug]adding resource file: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/task.json
2024-06-03T23:50:30.4279103Z ##[debug]system.culture=en-US
2024-06-03T23:50:30.4297685Z ##[debug]Resource file has already set to: /home/vsts/work/_tasks/AzureResourceManagerTemplateDeployment_94a74903-f93f-4075-884f-dc11f34058b4/3.238.0/node_modules/azure-pipelines-tasks-azure-arm-rest/module.json
2024-06-03T23:50:30.4308796Z ##[debug]deploymentScope=Subscription
2024-06-03T23:50:30.4313467Z ##[debug]ConnectedServiceName=77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4
2024-06-03T23:50:30.4729594Z ##[debug]Processed: ##vso[telemetry.publish area=TaskEndpointId;feature=AzureResourceManagerTemplateDeployment]{"endpointId":"77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4"}
2024-06-03T23:50:30.4804837Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data armManagementPortalUrl = https://portal.azure.com/
2024-06-03T23:50:30.4806238Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data ScopeLevel = Subscription
2024-06-03T23:50:30.4806754Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param scope = undefined
2024-06-03T23:50:30.4807427Z ARM Service Connection deployment scope - Subscription
2024-06-03T23:50:30.4807892Z ##[debug]subscriptionName=9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:30.4808742Z ##[debug]resourceGroupName=undefined
2024-06-03T23:50:30.4809201Z ##[debug]action=Create Or Update Resource Group
2024-06-03T23:50:30.4810250Z ##[debug]location=East US
2024-06-03T23:50:30.4810717Z ##[debug]deploymentMode=Incremental
2024-06-03T23:50:30.4811158Z ##[debug]templateLocation=Linked artifact
2024-06-03T23:50:30.4811626Z ##[debug]csmFile=/home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:30.4812091Z ##[debug]csmParametersFile=/home/vsts/work/1/s
2024-06-03T23:50:30.4813036Z ##[debug]overrideParameters=-CommonCfg {
  "common": {
    "appName": "prdmgmt",
    "appShortName": "REDACTED",
    "applicationShortName": "REDACTED",
    "bu": "set",
    "appID": "l",
    "resourceGroupLocation": "eastus",
    "applicationOwner": "REDACTED",
    "Description": "REDACTED",
    "TopicName": "REDACTED",
    "serviceBusTopicSubscription1": "REDACTED",
    "serviceBusTopicSubscription2": "REDACTED",
    "maxDeliveryCount": 100
  },
  "resourcegroup": {
    "ServiceLevel": "Standard",
    "Recovery": "Manual",
    "DataCI": "not sensitive"
  }
}
2024-06-03T23:50:30.4814297Z ##[debug]outputVariable=undefined
2024-06-03T23:50:30.4814759Z ##[debug]deploymentName=undefined
2024-06-03T23:50:30.4815170Z ##[debug]USE_MSAL=true
2024-06-03T23:50:30.4815651Z ##[debug]MSAL - USE_MSAL override is found: true
2024-06-03T23:50:30.4816403Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth scheme = ServicePrincipal
2024-06-03T23:50:30.4816938Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data subscriptionid = 9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:30.4817522Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data subscriptionname = sb-set-dev-supply
2024-06-03T23:50:30.4818491Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param serviceprincipalid = ***
2024-06-03T23:50:30.4819068Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data activeDirectoryAuthority = https://login.microsoftonline.com/
2024-06-03T23:50:30.4819707Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param tenantid = e2ba673a-b782-4f44-b0b5-93da90258200
2024-06-03T23:50:30.4820247Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4=https://management.azure.com/
2024-06-03T23:50:30.4820895Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data environment = AzureCloud
2024-06-03T23:50:30.4821372Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth scheme = ServicePrincipal
2024-06-03T23:50:30.4822230Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data msiclientId = undefined
2024-06-03T23:50:30.4822770Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/
2024-06-03T23:50:30.4823348Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data AzureKeyVaultServiceEndpointResourceId = https://vault.azure.net
2024-06-03T23:50:30.4823962Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data AzureKeyVaultDnsSuffix = vault.azure.net
2024-06-03T23:50:30.4827698Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data ScopeLevel = Subscription
2024-06-03T23:50:30.4828266Z ##[debug]MSAL - getEndpoint - useGraphActiveDirectoryResource=false
2024-06-03T23:50:30.4828971Z ##[debug]MSAL - getEndpoint - useMSAL=true
2024-06-03T23:50:30.4830211Z ##[debug]MSAL - getEndpoint - endpoint={"subscriptionID":"9dcc2f3d-3764-40ee-9e84-43bac166ec9a","subscriptionName":"sb-set-dev-supply","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"e2ba673a-b782-4f44-b0b5-93da90258200","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.core.windows.net/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription"}
2024-06-03T23:50:30.4831695Z ##[debug]MSAL - getEndpoint - connectedServiceName=77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4
2024-06-03T23:50:30.4832214Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param authenticationType = spnKey
2024-06-03T23:50:30.4832906Z ##[debug]credentials spn endpoint
2024-06-03T23:50:30.4833756Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param serviceprincipalkey = ***
2024-06-03T23:50:30.4834319Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data EnableAdfsAuthentication = false
2024-06-03T23:50:30.4835072Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param apitoken = undefined
2024-06-03T23:50:30.4836918Z ##[debug]{"subscriptionID":"9dcc2f3d-3764-40ee-9e84-43bac166ec9a","subscriptionName":"sb-set-dev-supply","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"e2ba673a-b782-4f44-b0b5-93da90258200","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.azure.com/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription","authenticationType":"spnKey","servicePrincipalKey":***,"isADFSEnabled":false,"applicationTokenCredentials":{"clientId":"***","tenantId":"e2ba673a-b782-4f44-b0b5-93da90258200","baseUrl":"https://management.azure.com/","authorityUrl":"https://login.microsoftonline.com/","activeDirectoryResourceId":"https://management.azure.com/","isAzureStackEnvironment":false,"authType":"spnKey","secret":***,"isADFSEnabled":false,"useMSAL":true,"tokenMutex":{"_semaphore":{"_value":1,"_cancelError":{},"_weightedQueues":[],"_weightedWaiters":[]}}}}
2024-06-03T23:50:30.4839135Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth scheme = ServicePrincipal
2024-06-03T23:50:30.4839617Z ##[debug]USE_MSAL=true
2024-06-03T23:50:30.4840076Z ##[debug]MSAL - USE_MSAL override is found: true
2024-06-03T23:50:30.4840522Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth scheme = ServicePrincipal
2024-06-03T23:50:30.4841011Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data subscriptionid = 9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:30.4841514Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data subscriptionname = sb-set-dev-supply
2024-06-03T23:50:30.4842274Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param serviceprincipalid = ***
2024-06-03T23:50:30.4842833Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data activeDirectoryAuthority = https://login.microsoftonline.com/
2024-06-03T23:50:30.4843353Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param tenantid = e2ba673a-b782-4f44-b0b5-93da90258200
2024-06-03T23:50:30.4844998Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4=https://management.azure.com/
2024-06-03T23:50:30.4845725Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data environment = AzureCloud
2024-06-03T23:50:30.4846225Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth scheme = ServicePrincipal
2024-06-03T23:50:30.4847182Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data msiclientId = undefined
2024-06-03T23:50:30.4847797Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data activeDirectoryServiceEndpointResourceId = https://management.core.windows.net/
2024-06-03T23:50:30.4848551Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data AzureKeyVaultServiceEndpointResourceId = https://vault.azure.net
2024-06-03T23:50:30.4849079Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data AzureKeyVaultDnsSuffix = vault.azure.net
2024-06-03T23:50:30.4849642Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data ScopeLevel = Subscription
2024-06-03T23:50:30.4850118Z ##[debug]MSAL - getEndpoint - useGraphActiveDirectoryResource=true
2024-06-03T23:50:30.4850611Z ##[debug]MSAL - getEndpoint - useMSAL=true
2024-06-03T23:50:30.4851781Z ##[debug]MSAL - getEndpoint - endpoint={"subscriptionID":"9dcc2f3d-3764-40ee-9e84-43bac166ec9a","subscriptionName":"sb-set-dev-supply","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"e2ba673a-b782-4f44-b0b5-93da90258200","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://management.core.windows.net/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription"}
2024-06-03T23:50:30.4853232Z ##[debug]MSAL - getEndpoint - connectedServiceName=77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4
2024-06-03T23:50:30.4853825Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data microsoftGraphUrl = https://graph.microsoft.com/
2024-06-03T23:50:30.4854333Z ##[debug]MSAL - getEndpoint - activeDirectoryResourceID=https://graph.microsoft.com/
2024-06-03T23:50:30.4854920Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param authenticationType = spnKey
2024-06-03T23:50:30.4855767Z ##[debug]credentials spn endpoint
2024-06-03T23:50:30.4856402Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param serviceprincipalkey = ***
2024-06-03T23:50:30.4857021Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data EnableAdfsAuthentication = false
2024-06-03T23:50:30.4857858Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param apitoken = undefined
2024-06-03T23:50:30.4859765Z ##[debug]{"subscriptionID":"9dcc2f3d-3764-40ee-9e84-43bac166ec9a","subscriptionName":"sb-set-dev-supply","servicePrincipalClientID":"***","environmentAuthorityUrl":"https://login.microsoftonline.com/","tenantID":"e2ba673a-b782-4f44-b0b5-93da90258200","url":"https://management.azure.com/","environment":"AzureCloud","scheme":"ServicePrincipal","activeDirectoryResourceID":"https://graph.microsoft.com/","azureKeyVaultServiceEndpointResourceId":"https://vault.azure.net","azureKeyVaultDnsSuffix":"vault.azure.net","scopeLevel":"Subscription","authenticationType":"spnKey","servicePrincipalKey":***,"isADFSEnabled":false,"applicationTokenCredentials":{"clientId":"***","tenantId":"e2ba673a-b782-4f44-b0b5-93da90258200","baseUrl":"https://management.azure.com/","authorityUrl":"https://login.microsoftonline.com/","activeDirectoryResourceId":"https://graph.microsoft.com/","isAzureStackEnvironment":false,"authType":"spnKey","secret":***,"isADFSEnabled":false,"useMSAL":true,"tokenMutex":{"_semaphore":{"_value":1,"_cancelError":{},"_weightedQueues":[],"_weightedWaiters":[]}}}}
2024-06-03T23:50:30.4861477Z ##[debug]deploymentOutputs=undefined
2024-06-03T23:50:30.4861906Z ##[debug]addSpnToEnvironment=false
2024-06-03T23:50:30.4862312Z ##[debug]useWithoutJSON=false
2024-06-03T23:50:30.5417710Z ##[debug]Processed: ##vso[telemetry.publish area=TaskDeploymentMethod;feature=AzureResourceManagerTemplateDeployment]{"deploymentScope":"Subscription","deploymentMode":"Incremental"}
2024-06-03T23:50:30.5418645Z Creating deployment parameters.
2024-06-03T23:50:30.5419465Z ##[debug]System.DefaultWorkingDirectory=/home/vsts/work/1/s
2024-06-03T23:50:30.5419890Z ##[debug]defaultRoot: '/home/vsts/work/1/s'
2024-06-03T23:50:30.5420245Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'false'
2024-06-03T23:50:30.5420623Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2024-06-03T23:50:30.5420976Z ##[debug]findOptions.followSymbolicLinks: 'true'
2024-06-03T23:50:30.5421321Z ##[debug]findOptions.skipMissingFiles: 'false'
2024-06-03T23:50:30.5421658Z ##[debug]matchOptions.debug: 'false'
2024-06-03T23:50:30.5422212Z ##[debug]matchOptions.nobrace: 'true'
2024-06-03T23:50:30.5422556Z ##[debug]matchOptions.noglobstar: 'false'
2024-06-03T23:50:30.5423047Z ##[debug]matchOptions.dot: 'true'
2024-06-03T23:50:30.5423378Z ##[debug]matchOptions.noext: 'false'
2024-06-03T23:50:30.5423706Z ##[debug]matchOptions.nocase: 'false'
2024-06-03T23:50:30.5424052Z ##[debug]matchOptions.nonull: 'false'
2024-06-03T23:50:30.5424387Z ##[debug]matchOptions.matchBase: 'false'
2024-06-03T23:50:30.5424884Z ##[debug]matchOptions.nocomment: 'false'
2024-06-03T23:50:30.5425804Z ##[debug]matchOptions.nonegate: 'false'
2024-06-03T23:50:30.5426509Z ##[debug]matchOptions.flipNegate: 'false'
2024-06-03T23:50:30.5426887Z ##[debug]pattern: '/home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep'
2024-06-03T23:50:30.5427297Z ##[debug]findPath: '/home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep'
2024-06-03T23:50:30.5427664Z ##[debug]statOnly: 'true'
2024-06-03T23:50:30.5428073Z ##[debug]found 1 paths
2024-06-03T23:50:30.5428747Z ##[debug]applying include pattern
2024-06-03T23:50:30.5429068Z ##[debug]1 matches
2024-06-03T23:50:30.5429374Z ##[debug]1 final results
2024-06-03T23:50:30.5429736Z ##[debug]Loading CSM Template File.. /home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:30.7061183Z ##[debug]Agent environment resources - Disk: / Available 21528.00 MB out of 74244.00 MB, Memory: Used 641.00 MB out of 6921.00 MB, CPU: Usage 71.81%
2024-06-03T23:50:35.7116210Z ##[debug]Agent environment resources - Disk: / Available 21528.00 MB out of 74244.00 MB, Memory: Used 822.00 MB out of 6921.00 MB, CPU: Usage 54.85%
2024-06-03T23:50:36.0086170Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data environment = AzureCloud
2024-06-03T23:50:36.0087122Z Setting active cloud to: AzureCloud
2024-06-03T23:50:36.0088629Z ##[debug]which 'az'
2024-06-03T23:50:36.0103086Z ##[debug]found: '/usr/bin/az'
2024-06-03T23:50:36.0104510Z ##[debug]/usr/bin/az arg: cloud set -n AzureCloud
2024-06-03T23:50:36.0105339Z ##[debug]/usr/bin/az arg: cloud set -n AzureCloud
2024-06-03T23:50:36.0110274Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:36.0111187Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:36.0112092Z ##[debug]arguments:
2024-06-03T23:50:36.0112455Z ##[debug]arguments:
2024-06-03T23:50:36.0112757Z ##[debug]   cloud
2024-06-03T23:50:36.0113045Z ##[debug]   cloud
2024-06-03T23:50:36.0113356Z ##[debug]   set
2024-06-03T23:50:36.0113646Z ##[debug]   set
2024-06-03T23:50:36.0113934Z ##[debug]   -n
2024-06-03T23:50:36.0114218Z ##[debug]   -n
2024-06-03T23:50:36.0114528Z ##[debug]   AzureCloud
2024-06-03T23:50:36.0115962Z ##[debug]   AzureCloud
2024-06-03T23:50:36.0121738Z [command]/usr/bin/az cloud set -n AzureCloud
2024-06-03T23:50:36.4659054Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth scheme = ServicePrincipal
2024-06-03T23:50:36.4660294Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param authenticationType = spnKey
2024-06-03T23:50:36.4662614Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param serviceprincipalid = ***
2024-06-03T23:50:36.4663584Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param tenantid = e2ba673a-b782-4f44-b0b5-93da90258200
2024-06-03T23:50:36.4664299Z ##[debug]key based endpoint
2024-06-03T23:50:36.4665567Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 auth param serviceprincipalkey = ***
2024-06-03T23:50:36.4671109Z ##[debug]Processed: ##vso[task.setsecret]***
2024-06-03T23:50:36.4671973Z ##[debug]which 'az'
2024-06-03T23:50:36.4672517Z ##[debug]found: '/usr/bin/az'
2024-06-03T23:50:36.4673369Z ##[debug]/usr/bin/az arg: login --service-principal -u "***" --password=*** --tenant "e2ba673a-b782-4f44-b0b5-93da90258200" --allow-no-subscriptions
2024-06-03T23:50:36.4674351Z ##[debug]/usr/bin/az arg: login --service-principal -u "***" --password=*** --tenant "e2ba673a-b782-4f44-b0b5-93da90258200" --allow-no-subscriptions
2024-06-03T23:50:36.4675493Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:36.4676039Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:36.4676536Z ##[debug]arguments:
2024-06-03T23:50:36.4677052Z ##[debug]arguments:
2024-06-03T23:50:36.4677652Z ##[debug]   login
2024-06-03T23:50:36.4679674Z ##[debug]   login
2024-06-03T23:50:36.4680183Z ##[debug]   --service-principal
2024-06-03T23:50:36.4680702Z ##[debug]   --service-principal
2024-06-03T23:50:36.4682605Z ##[debug]   -u
2024-06-03T23:50:36.4683207Z ##[debug]   -u
2024-06-03T23:50:36.4686175Z ##[debug]   ***
2024-06-03T23:50:36.4686585Z ##[debug]   ***
2024-06-03T23:50:36.4686964Z ##[debug]   --password=***
2024-06-03T23:50:36.4687658Z ##[debug]   --password=***
2024-06-03T23:50:36.4687953Z ##[debug]   --tenant
2024-06-03T23:50:36.4688230Z ##[debug]   --tenant
2024-06-03T23:50:36.4688546Z ##[debug]   e2ba673a-b782-4f44-b0b5-93da90258200
2024-06-03T23:50:36.4688869Z ##[debug]   e2ba673a-b782-4f44-b0b5-93da90258200
2024-06-03T23:50:36.4689214Z ##[debug]   --allow-no-subscriptions
2024-06-03T23:50:36.4689526Z ##[debug]   --allow-no-subscriptions
2024-06-03T23:50:36.4690403Z [command]/usr/bin/az login --service-principal -u *** --password=*** --tenant e2ba673a-b782-4f44-b0b5-93da90258200 --allow-no-subscriptions
2024-06-03T23:50:37.6040779Z [
2024-06-03T23:50:37.6041469Z   {
2024-06-03T23:50:37.6042085Z     "cloudName": "AzureCloud",
2024-06-03T23:50:37.6042826Z     "homeTenantId": "e2ba673a-b782-4f44-b0b5-93da90258200",
2024-06-03T23:50:37.6043563Z     "id": "1d99fa9a-076b-4aca-b5f1-a67288640d2c",
2024-06-03T23:50:37.6045958Z     "isDefault": true,
2024-06-03T23:50:37.6046113Z     "managedByTenants": [],
2024-06-03T23:50:37.6046384Z     "name": "sb-set-dev-sharedservices",
2024-06-03T23:50:37.6046643Z     "state": "Enabled",
2024-06-03T23:50:37.6046907Z     "tenantId": "e2ba673a-b782-4f44-b0b5-93da90258200",
2024-06-03T23:50:37.6048246Z     "user": {
2024-06-03T23:50:37.6048681Z       "name": "***",
2024-06-03T23:50:37.6048850Z       "type": "servicePrincipal"
2024-06-03T23:50:37.6049001Z     }
2024-06-03T23:50:37.6049111Z   },
2024-06-03T23:50:37.6049235Z   {
2024-06-03T23:50:37.6049361Z     "cloudName": "AzureCloud",
2024-06-03T23:50:37.6049667Z     "homeTenantId": "e2ba673a-b782-4f44-b0b5-93da90258200",
2024-06-03T23:50:37.6077453Z     "id": "9dcc2f3d-3764-40ee-9e84-43bac166ec9a",
2024-06-03T23:50:37.6077785Z     "isDefault": false,
2024-06-03T23:50:37.6077948Z     "managedByTenants": [],
2024-06-03T23:50:37.6078395Z     "name": "sb-set-dev-supply",
2024-06-03T23:50:37.6078562Z     "state": "Enabled",
2024-06-03T23:50:37.6078819Z     "tenantId": "e2ba673a-b782-4f44-b0b5-93da90258200",
2024-06-03T23:50:37.6078997Z     "user": {
2024-06-03T23:50:37.6079383Z       "name": "***",
2024-06-03T23:50:37.6079528Z       "type": "servicePrincipal"
2024-06-03T23:50:37.6079672Z     }
2024-06-03T23:50:37.6079780Z   },
2024-06-03T23:50:37.6079906Z   {
2024-06-03T23:50:37.6080049Z     "cloudName": "AzureCloud",
2024-06-03T23:50:37.6080318Z     "homeTenantId": "e2ba673a-b782-4f44-b0b5-93da90258200",
2024-06-03T23:50:37.6080610Z     "id": "1e1fcaa9-54b2-455d-aa22-d31c53a838ae",
2024-06-03T23:50:37.6080773Z     "isDefault": false,
2024-06-03T23:50:37.6080935Z     "managedByTenants": [],
2024-06-03T23:50:37.6081150Z     "name": "sb-set-dev-sales",
2024-06-03T23:50:37.6081297Z     "state": "Enabled",
2024-06-03T23:50:37.6081558Z     "tenantId": "e2ba673a-b782-4f44-b0b5-93da90258200",
2024-06-03T23:50:37.6081715Z     "user": {
2024-06-03T23:50:37.6082238Z       "name": "***",
2024-06-03T23:50:37.6082426Z       "type": "servicePrincipal"
2024-06-03T23:50:37.6082557Z     }
2024-06-03T23:50:37.6082680Z   }
2024-06-03T23:50:37.6082786Z ]
2024-06-03T23:50:37.6083400Z ##[debug]77e2ed1c-17b6-4fc3-8af2-7e96d0d971b4 data SubscriptionID = 9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:37.6086660Z ##[debug]which 'az'
2024-06-03T23:50:37.6087003Z ##[debug]found: '/usr/bin/az'
2024-06-03T23:50:37.6087377Z ##[debug]/usr/bin/az arg: account set --subscription "9dcc2f3d-3764-40ee-9e84-43bac166ec9a"
2024-06-03T23:50:37.6087798Z ##[debug]/usr/bin/az arg: account set --subscription "9dcc2f3d-3764-40ee-9e84-43bac166ec9a"
2024-06-03T23:50:37.6088184Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:37.6088580Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:37.6088885Z ##[debug]arguments:
2024-06-03T23:50:37.6089196Z ##[debug]arguments:
2024-06-03T23:50:37.6089535Z ##[debug]   account
2024-06-03T23:50:37.6089847Z ##[debug]   account
2024-06-03T23:50:37.6090136Z ##[debug]   set
2024-06-03T23:50:37.6090422Z ##[debug]   set
2024-06-03T23:50:37.6090888Z ##[debug]   --subscription
2024-06-03T23:50:37.6091210Z ##[debug]   --subscription
2024-06-03T23:50:37.6091567Z ##[debug]   9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:37.6092797Z ##[debug]   9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:37.6093234Z [command]/usr/bin/az account set --subscription 9dcc2f3d-3764-40ee-9e84-43bac166ec9a
2024-06-03T23:50:38.2285838Z ##[debug]which 'az'
2024-06-03T23:50:38.2286994Z ##[debug]found: '/usr/bin/az'
2024-06-03T23:50:38.2287943Z ##[debug]/usr/bin/az arg: bicep build --file /home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:38.2289356Z ##[debug]/usr/bin/az arg: bicep build --file /home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:38.2289953Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:38.2290713Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:38.2291627Z ##[debug]arguments:
2024-06-03T23:50:38.2292706Z ##[debug]arguments:
2024-06-03T23:50:38.2293070Z ##[debug]   bicep
2024-06-03T23:50:38.2293528Z ##[debug]   bicep
2024-06-03T23:50:38.2293873Z ##[debug]   build
2024-06-03T23:50:38.2294152Z ##[debug]   build
2024-06-03T23:50:38.2294462Z ##[debug]   --file
2024-06-03T23:50:38.2294740Z ##[debug]   --file
2024-06-03T23:50:38.2295241Z ##[debug]   /home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:38.2295810Z ##[debug]   /home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:38.2296641Z [command]/usr/bin/az bicep build --file /home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep
2024-06-03T23:50:40.7185351Z ##[debug]Agent environment resources - Disk: / Available 21528.00 MB out of 74244.00 MB, Memory: Used 689.00 MB out of 6921.00 MB, CPU: Usage 38.71%
2024-06-03T23:50:45.7227216Z ##[debug]Agent environment resources - Disk: / Available 21528.00 MB out of 74244.00 MB, Memory: Used 742.00 MB out of 6921.00 MB, CPU: Usage 29.92%
2024-06-03T23:50:46.5178130Z ##[debug]which 'az'
2024-06-03T23:50:46.5178629Z ##[debug]found: '/usr/bin/az'
2024-06-03T23:50:46.5178969Z ##[debug]/usr/bin/az arg: account clear
2024-06-03T23:50:46.5179316Z ##[debug]/usr/bin/az arg: account clear
2024-06-03T23:50:46.5179668Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:46.5179985Z ##[debug]exec tool: /usr/bin/az
2024-06-03T23:50:46.5180291Z ##[debug]arguments:
2024-06-03T23:50:46.5180589Z ##[debug]arguments:
2024-06-03T23:50:46.5180902Z ##[debug]   account
2024-06-03T23:50:46.5181197Z ##[debug]   account
2024-06-03T23:50:46.5181672Z ##[debug]   clear
2024-06-03T23:50:46.5181976Z ##[debug]   clear
2024-06-03T23:50:46.5182193Z [command]/usr/bin/az account clear
2024-06-03T23:50:47.3566446Z ##[debug]Detecting file encoding using BOM
2024-06-03T23:50:47.3593040Z ##[debug]Unable to detect File encoding using BOM
2024-06-03T23:50:47.3597718Z ##[debug]Detecting file encoding without BOM
2024-06-03T23:50:47.3603220Z The detected encoding for file '/home/vsts/work/1/s/infrastructure/standard-bicep/main.json' is 'utf-8'
2024-06-03T23:50:47.3620539Z ##[debug]Loaded CSM File
2024-06-03T23:50:47.3624831Z ##[debug]System.DefaultWorkingDirectory=/home/vsts/work/1/s
2024-06-03T23:50:47.3628461Z ##[debug]defaultRoot: '/home/vsts/work/1/s'
2024-06-03T23:50:47.3631753Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'false'
2024-06-03T23:50:47.3634841Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2024-06-03T23:50:47.3637911Z ##[debug]findOptions.followSymbolicLinks: 'true'
2024-06-03T23:50:47.3641161Z ##[debug]findOptions.skipMissingFiles: 'false'
2024-06-03T23:50:47.3645380Z ##[debug]matchOptions.debug: 'false'
2024-06-03T23:50:47.3649587Z ##[debug]matchOptions.nobrace: 'true'
2024-06-03T23:50:47.3653174Z ##[debug]matchOptions.noglobstar: 'false'
2024-06-03T23:50:47.3657506Z ##[debug]matchOptions.dot: 'true'
2024-06-03T23:50:47.3662041Z ##[debug]matchOptions.noext: 'false'
2024-06-03T23:50:47.3665523Z ##[debug]matchOptions.nocase: 'false'
2024-06-03T23:50:47.3668938Z ##[debug]matchOptions.nonull: 'false'
2024-06-03T23:50:47.3672345Z ##[debug]matchOptions.matchBase: 'false'
2024-06-03T23:50:47.3676202Z ##[debug]matchOptions.nocomment: 'false'
2024-06-03T23:50:47.3680022Z ##[debug]matchOptions.nonegate: 'false'
2024-06-03T23:50:47.3686855Z ##[debug]matchOptions.flipNegate: 'false'
2024-06-03T23:50:47.3691439Z ##[debug]pattern: '/home/vsts/work/1/s'
2024-06-03T23:50:47.3697155Z ##[debug]findPath: '/home/vsts/work/1/s'
2024-06-03T23:50:47.3700907Z ##[debug]statOnly: 'true'
2024-06-03T23:50:47.3705739Z ##[debug]found 1 paths
2024-06-03T23:50:47.3710347Z ##[debug]applying include pattern
2024-06-03T23:50:47.3713673Z ##[debug]1 matches
2024-06-03T23:50:47.3716546Z ##[debug]1 final results
2024-06-03T23:50:47.3722761Z ##[debug]csmParametersFile=/home/vsts/work/1/s
2024-06-03T23:50:47.3726776Z ##[debug]Absolute path for pathSegments: /home/vsts/work/1/s = /home/vsts/work/1/s
2024-06-03T23:50:47.3729663Z ##[debug]build.sourcesDirectory=/home/vsts/work/1/s
2024-06-03T23:50:47.3732311Z ##[debug]Absolute path for pathSegments: /home/vsts/work/1/s = /home/vsts/work/1/s
2024-06-03T23:50:47.3734818Z ##[debug]csmParametersFilepath supplied :false
2024-06-03T23:50:47.3738565Z ##[debug]Overriding Parameters..
2024-06-03T23:50:47.3747777Z ##[debug]Overriding key: CommonCfg
2024-06-03T23:50:47.3753273Z There was an error while overriding 'CommonCfg' parameter because of 'TypeError: Cannot read properties of undefined (reading 'toLowerCase')', make sure it follows JavaScript Object Notation (JSON)
2024-06-03T23:50:47.3762917Z ##[debug]MSAL - Graph - GraphManagementClient - useMSAL = true
2024-06-03T23:50:47.3770253Z ##[debug]MSAL - Graph - GetServicePrincipal - useMSAL = true
2024-06-03T23:50:47.3777449Z ##[debug]MSAL - Graph - GetServicePrincipal - requestURL = https://graph.microsoft.com/v1.0/e2ba673a-b782-4f44-b0b5-93da90258200/servicePrincipals?$filter=appId%20eq%20'***'
2024-06-03T23:50:47.3797215Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-06-03T23:50:47.3828307Z ##[debug]agent.proxyurl=undefined
2024-06-03T23:50:47.3832286Z ##[debug]agent.proxybypasslist=undefined
2024-06-03T23:50:47.3838156Z ##[debug]MSAL - ServicePrincipal - clientSecret is used.
2024-06-03T23:50:47.3852434Z ##[debug][Mon, 03 Jun 2024 23:50:47 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-06-03T23:50:47.4144957Z (node:1646) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
2024-06-03T23:50:47.4147411Z (Use `node --trace-deprecation ...` to show where the warning was created)
2024-06-03T23:50:47.5782428Z ##[debug]MSAL - retrieved token - isFromCache?: false
2024-06-03T23:50:47.5788287Z ##[debug][GET]https://graph.microsoft.com/v1.0/e2ba673a-b782-4f44-b0b5-93da90258200/servicePrincipals?$filter=appId%20eq%20'***'
2024-06-03T23:50:47.6791363Z Starting template validation.
2024-06-03T23:50:47.6793597Z ##[debug]System.DefaultWorkingDirectory=/home/vsts/work/1/s
2024-06-03T23:50:47.6795609Z ##[debug]defaultRoot: '/home/vsts/work/1/s'
2024-06-03T23:50:47.6796655Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'false'
2024-06-03T23:50:47.6797702Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2024-06-03T23:50:47.6799636Z ##[debug]findOptions.followSymbolicLinks: 'true'
2024-06-03T23:50:47.6800009Z ##[debug]findOptions.skipMissingFiles: 'false'
2024-06-03T23:50:47.6801773Z ##[debug]matchOptions.debug: 'false'
2024-06-03T23:50:47.6802402Z ##[debug]matchOptions.nobrace: 'true'
2024-06-03T23:50:47.6803134Z ##[debug]matchOptions.noglobstar: 'false'
2024-06-03T23:50:47.6803504Z ##[debug]matchOptions.dot: 'true'
2024-06-03T23:50:47.6804067Z ##[debug]matchOptions.noext: 'false'
2024-06-03T23:50:47.6804387Z ##[debug]matchOptions.nocase: 'false'
2024-06-03T23:50:47.6804860Z ##[debug]matchOptions.nonull: 'false'
2024-06-03T23:50:47.6805162Z ##[debug]matchOptions.matchBase: 'false'
2024-06-03T23:50:47.6805464Z ##[debug]matchOptions.nocomment: 'false'
2024-06-03T23:50:47.6805784Z ##[debug]matchOptions.nonegate: 'false'
2024-06-03T23:50:47.6806088Z ##[debug]matchOptions.flipNegate: 'false'
2024-06-03T23:50:47.6808602Z ##[debug]pattern: '/home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep'
2024-06-03T23:50:47.6816464Z ##[debug]findPath: '/home/vsts/work/1/s/infrastructure/standard-bicep/main.bicep'
2024-06-03T23:50:47.6818080Z ##[debug]statOnly: 'true'
2024-06-03T23:50:47.6824373Z ##[debug]found 1 paths
2024-06-03T23:50:47.6824775Z ##[debug]applying include pattern
2024-06-03T23:50:47.6830009Z ##[debug]1 matches
2024-06-03T23:50:47.6830958Z ##[debug]1 final results
2024-06-03T23:50:47.6874119Z Deployment name is main-20240603-235047-14c1
2024-06-03T23:50:47.6882147Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-06-03T23:50:47.6884179Z ##[debug]agent.proxyurl=undefined
2024-06-03T23:50:47.6885009Z ##[debug]agent.proxybypasslist=undefined
2024-06-03T23:50:47.6887523Z ##[debug]MSAL - ServicePrincipal - clientSecret is used.
2024-06-03T23:50:47.6890588Z ##[debug][Mon, 03 Jun 2024 23:50:47 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-06-03T23:50:47.9561586Z ##[debug]MSAL - retrieved token - isFromCache?: false
2024-06-03T23:50:47.9563063Z ##[debug][POST]https://management.azure.com/subscriptions/9dcc2f3d-3764-40ee-9e84-43bac166ec9a/providers/Microsoft.Resources/deployments/main-20240603-235047-14c1/validate?api-version=2021-04-01
2024-06-03T23:50:48.1540873Z ##[debug]Correlation ID from ARM api call response : 21cdd1a5-8da8-4fe1-8325-75c9a0f1b9d1
2024-06-03T23:50:48.1548142Z There were errors in your deployment. Error code: InvalidTemplate.
2024-06-03T23:50:48.1598846Z ##[error]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
2024-06-03T23:50:48.1616148Z ##[debug]Processed: ##vso[task.issue type=error;]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
2024-06-03T23:50:48.1617761Z ##[warning]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Task failed while creating or updating the template deployment.. Please follow https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
2024-06-03T23:50:48.1618969Z ##[debug]Processed: ##vso[task.issue type=warning;]Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Task failed while creating or updating the template deployment.. Please follow https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
2024-06-03T23:50:48.1619452Z Starting Deployment.
2024-06-03T23:50:48.1619923Z Deployment name is main-20240603-235047-14c1
2024-06-03T23:50:48.1620274Z ##[debug]MSAL - getMSALToken called. force=undefined
2024-06-03T23:50:48.1620871Z ##[debug][Mon, 03 Jun 2024 23:50:48 GMT] : @azure/msal-node@1.14.5 : Info - acquireTokenByClientCredential called
2024-06-03T23:50:48.1621438Z ##[debug]MSAL - retrieved token - isFromCache?: true
2024-06-03T23:50:48.1621902Z ##[debug][PUT]https://management.azure.com/subscriptions/9dcc2f3d-3764-40ee-9e84-43bac166ec9a/providers/Microsoft.Resources/deployments/main-20240603-235047-14c1?api-version=2021-04-01
2024-06-03T23:50:48.3520739Z ##[debug]Correlation ID from ARM api call response : 4bb0daa6-444d-45a3-a55a-03ef8ec3e223
2024-06-03T23:50:48.3531787Z ##[debug]Processed: ##vso[task.logissue type=error;code=InvalidTemplate;]
2024-06-03T23:50:48.3532206Z There were errors in your deployment. Error code: InvalidTemplate.
2024-06-03T23:50:48.3533380Z ##[error]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
2024-06-03T23:50:48.3534177Z ##[debug]Processed: ##vso[task.issue type=error;]Deployment template validation failed: 'The provided value for the template parameter 'CommonCfg' is not valid. Expected a value of type 'Object', but received a value of type 'String'. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
2024-06-03T23:50:48.3535791Z ##[error]Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
2024-06-03T23:50:48.3536634Z ##[debug]Processed: ##vso[task.issue type=error;]Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
2024-06-03T23:50:48.3537186Z ##[debug]task result: Failed
2024-06-03T23:50:48.3538164Z ##[error]Task failed while creating or updating the template deployment.
2024-06-03T23:50:48.3538643Z ##[debug]Processed: ##vso[task.issue type=error;]Task failed while creating or updating the template deployment.
2024-06-03T23:50:48.3548564Z ##[debug]Processed: ##vso[task.complete result=Failed;]Task failed while creating or updating the template deployment.
2024-06-03T23:50:48.3626656Z ##[section]Finishing: Deploy Bicep Template
 

Repro steps

pool:
  vmImage: ubuntu-latest

parameters:
  - name: ProductName
    type: string
    default: "Supply"
  - name: deploymentStage
    type: string
    default: "dev"
  - name: CommonCfg
    type: object
    default:
      {
        "common":
          {
            "appName": "prdmgmt",
            "appShortName": "REDACTED",
            "applicationShortName": "REDACTED",
            "bu": "set",
            "appID": "l",
            "resourceGroupLocation": "eastus",
            "applicationOwner": "REDACTED",
            "Description": "REDACTED",
            "TopicName": "REDACTED",
            "serviceBusTopicSubscription1": "REDACTED",
            "serviceBusTopicSubscription2": "REDACTED",
            "maxDeliveryCount": 100,
          },
        "resourcegroup":
          {
            "ServiceLevel": "Standard",
            "Recovery": "Manual",
            "DataCI": "not sensitive",
          },
      }

stages:
  - stage: Deploy_to_${{ parameters.deploymentStage }}
    variables:
      system.debug: true
    jobs:
      - deployment:
        displayName: Deploy to ${{ parameters.deploymentStage }}
        environment: ${{ lower(parameters.CommonCfg.common.bu) }}-${{ parameters.CommonCfg.common.appName }}-iac-${{ parameters.deploymentStage }}2
        strategy:
          runOnce:
            deploy:
              steps:
                - checkout: self
                - task: AzureResourceManagerTemplateDeployment@3
                  displayName: "Deploy Bicep Template"
                  inputs:
                    deploymentScope: "Subscription"
                    azureResourceManagerConnection: "sc-${{ lower(parameters.CommonCfg.common.bu) }}-${{ parameters.deploymentStage }}-${{ lower(parameters.ProductName) }}"
                    subscriptionId: "9dcc2f3d-3764-40ee-9e84-43bac166ec9a"
                    location: "East US"
                    templateLocation: "Linked artifact"
                    csmFile: "$(System.DefaultWorkingDirectory)/infrastructure/standard-bicep/main.bicep"
                    overrideParameters: -CommonCfg ${{ convertToJson(parameters.CommonCfg) }}
                    deploymentMode: "Incremental"
mark-vw commented 1 month ago

I came across this yesteray. Seems the AzureResourceManagerTemplateDeployment@3 task does not yet support user defined types in bicep. As a workaround, use 'object' type (instead of CommonType) for your CommonCfg param.