microsoft / commercial-marketplace-offer-deploy

Deployment Manager for the Azure Marketplace
Other
21 stars 13 forks source link

When deploying a managed application results in an error: The language expression property 'location' doesn't exist #661

Closed dparv closed 2 months ago

dparv commented 3 months ago

Full error is:

{
    "status": "Failed",
    "error": {
        "code": "ApplicationProvisioningFailed",
        "message": "Deployment template validation failed: 'The template variable 'location' is not valid: The language expression property 'location' doesn't exist, available properties are 'name, properties'.. Please see https://aka.ms/arm-functions for usage details.'.",
        "additionalInfo": [
            {
                "type": "TemplateViolation"
            }
        ]
    }
}

Attaching the app.zip

app.zip

bobjac commented 3 months ago

What I did was set the output of the createUiDefinition to be:

"outputs": { "location": "[location()]", ...

That will set it to the managed resource group, not the resource group that contains the managed application. Then in my mainTemplate, I did this:

... param location string ... module networkBaseDeployment 'modules/networkBaseDeployment.bicep' = { name: 'networkBaseDeployment' scope: az.resourceGroup(resourceGroupName) params: { location: location ///

That will flow the managed resource group to the resource.

bobjac commented 2 months ago

This is resolved. This was an issue with the Bicep template.