So Here is the scenario:
I have created a Cloud Service(Extended Support) project. As a Devops engineer I need to create a pipeline in Azure Devops to push package to the azure.
I have followed Publish Cloud Services official guideline to publish cloud service. So for the task ARM Template deployment: Resource Group scope I am using override parameters as follows:
-servicename worker -packageSasUri https://mystorageaccount.blob.core.windows.net/mypackage/202405181456/service.cspkg?<sas-token> -configurationSasUri https://mystorageaccount.blob.core.windows.net/mypackage/202405181456/ServiceConfiguration.Cloud.cscfg?<sas-token> -location 'Australia Southeast' -certificateName AccelerusLightWorker -keyVaultName worker-vault -keyVaultResourceGroup rg-worker
YAML file only ARM template deployment:
steps:
- task: AzureResourceManagerTemplateDeployment@3
displayName: 'ARM Template deployment: Resource Group scope'
inputs:
azureResourceManagerConnection: netsynergy
subscriptionId: 'id'
resourceGroupName: 'rg-worker'
location: 'location'
csmFile: 'build/bicep/worker.bicep'
overrideParameters: <above mentioned>
I am using Bicep Template:
param location string
param servicename string
@secure()
param packageSasUri string
@secure()
param configurationSasUri string
param keyVaultName string
param certificateName string
param keyVaultResourceGroup string
# there are other resources as well
resource cloudService 'Microsoft.Compute/cloudServices@2020-10-01-preview' = {
name: '${servicename}-worker-${suffix}'
location: location
tags: {
DeployFromVisualStudio: 'true'
}
properties: {
osProfile: <secret>
packageUrl: packageSasUri
configurationUrl: configurationSasUri
upgradeMode: 'Auto'
}
}
So While running pipeline I am getting following error:
There was an error while overriding '' parameter because of 'TypeError: Cannot read properties of undefined (reading 'type')', make sure it follows JavaScript Object Notation (JSON) Starting template validation. (node:6460) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. Deployment name is accelerus-20240519-032042-6d1e (Use
node --trace-deprecation ...
to show where the warning was created) There were errors in your deployment. Error code: InvalidDeploymentParameterKey.
According to the error message, there seems to be some issues with the parameters in your Bicep template. To confirm it, try to use Azure CLI to deploy your template on your local machine. See How to use Azure Resource Manager (ARM) deployment templates with Azure CLI for the details.
az deployment group create --name ExampleDeployment --resource-group ExampleGroup --template-file <path-to-template> --parameters storageAccountType=Standard_GRS
If there is the same error, check your template.
Update
Solution: Override location using -location australiasoutheast
.