Azure Data Factory not interpreting well an array global parameter - azure

We have an Azure Data Factory using Global Parameters, it's working fine on our Dev environment, but we when try do deploy it to QA environment using an Azure DevOps pipeline, it seems it's not understanding the only Global Parameter with type = array; even though all of the other parameters are good.
This is the guide we're using to build the CI/CD pipelines.
We have something similar to this in the Global Parameters JSON file:
{
"FilesToProcess": {
"type": "array",
"value": [
"VALUE01",
"VALUE02",
"VALUE03",
"VALUE04",
"VALUE05",
"VALUE06",
"VALUE07",
"VALUE08",
"VALUE09",
"VALUE10",
"VALUE11",
"VALUE12",
"VALUE13",
"VALUE14",
"VALUE15",
"VALUE16",
"VALUE17",
"VALUE18",
"VALUE19",
"VALUE20",
"VALUE21",
"VALUE22",
"VALUE23",
"VALUE24",
"VALUE25",
"VALUE26",
"VALUE27"
]
},
"EmailLogicAppUrl": {
"type": "string",
"value": "URL
}
}
All of the paremeters are deployed fine, except for the array one, and we're getting this:
We have debugged the PS script to update the Global Parameters, and it seems it's understanding well the array, so it has to be something else.
Any help will be highly appreciated.
Thanks!

Related

Azure DevOps Deployment shows InvalidRequestContent: Request content contains one or more instances of unsupported reference property names

We get an error on deploying our Logic-App with Azure DevOps.
I can't explain why this error occurs all at once.
Has anyone seen this error message before?
InvalidRequestContent:
Request content contains one or more instances of unsupported reference property names ($id, $ref, $values) creating ambiguity in paths 'properties.definition.actions.Parse_JSON.inputs.schema.properties.caseId.$ref,properties.definition.actions.Parse_JSON.inputs.schema.properties.integrationId.$ref'.
Please remove the use of reference property names and try again.
Our logic-app contains following JSON-Parse code. Apparently the variable "#/definitions/nonEmptyString" is defined twice.
"caseId": {
"$ref": "#/definitions/nonEmptyString",
"type": "string"
},
Issue reproduced from my end and got expected results.
The issue is with $ref which is not supported by Azure logicapps as mentioned in error got.
Created logic app as shown below and the sample JSON-Parse code is taken as per your requirement
{
"caseId": {
"$ref": "#/definitions/nonEmptyString",
"type": "string"
}
}
By taking $ref got the same error as shown below
Failed to save logic app parselp. Request content contains one or more instances of unsupported reference property names ($id, $ref, $values) creating ambiguity in paths 'properties.definition.actions.Parse_JSON.inputs.schema.caseId.$ref'. Please remove the use of reference property names and try again.
Then removed $ and taken ref in Parse Json as shown and logic App saved successfully without that error and workflow ran successfully.
I have fixed the problem by changing the following code
"definitions":{
"nonEmptyString":{
"minLength":1,
"type":"string"
}
},
"properties":{
"caseId":{
"$ref":"#/definitions/nonEmptyString",
"type":"string"
}
to this code
"properties":{
"caseId":{
"minLength":1,
"type":"string"
}
Maybe the problem was simply that my old solution defined "type": "string" twice. But I have not tested that yet.

if condition in ARM Template resource

I have a resource in my Arm Template as follows:
parameters:
env
prodparam
nonprodparam
resources:
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-05-01",
"url": "[if(equals(parameters('env'),'prod'), parameters('prodparam'), parameters('nonprodparam'))]"
}
I see the url is always set to parameters('nonprodparam') even if parameters('env') = 'prod'. Is this if condition correct? Am I missing something?
Your if condition statement is correct, I tested it and got the correct result successfully.
You need to do the following steps to check where your problem is:
1. Check if your parameter definition is correct, especially as Stringfellow mentioned in the comment, to be case sensitive. It should be defined as follows.
2. Pay attention to whether to save after editing arm templates in the azure portal.
You can check the value of the parameter during the deployment process:

Using parameters to locate file during trigger creation in Azure Data Factory

I am trying to create a trigger that I will use for starting a pipeline in ADF:
The folder I want to set my trigger on can have different paths:
202001/Test/TriggerFolder
202002/Test/TriggerFolder
202003/Test/TriggerFolder
etc..
Therefore in my Blob path begins with I would like to use a parameter (that I will set somewhere else through another pipeline) that tells the trigger where to look for instead of having a static name file.
Unfortunately it doesn't seem to give me the chance to add dynamic content as (for example) in a DataSet.
If there is really no chance, because maybe I may think the trigger is something instantiated once, is there a way to create a trigger as a step during a pipeline?
Thank you!
There is possibility to pass parameter from "ARM Template" of the Azure Data Factory. During the deployment of pipelines, this parameter can be passed with necessary value. Below is example code for it.
Sample Code:
{
"name": "[concat(parameters('factoryName'), '/trigger1')]",
"type": "Microsoft.DataFactory/factories/triggers",
"apiVersion": "2018-06-01",
"properties": {
"annotations": [],
"runtimeState": "Stopped",
"pipelines": [],
"type": "BlobEventsTrigger",
"typeProperties": {
"blobPathBeginsWith": "[parameters('trigger1_properties_typeProperties_blobPathBeginsWith')]",
"ignoreEmptyBlobs": true,
"scope": "[parameters('trigger1_properties_typeProperties_scope')]",
"events": [
"Microsoft.Storage.BlobCreated"
]
}
},

Is it possible to create a CompositeIndex of CosmosDB with ARM template

I find instructions for using ARM templates to create or make changes to CosmosDB, but none of them contain instructions on how to add a CompositeIndex to the template. I have also heard it is not supported in the template and has to be done with PowerShell or Azure CLI script, but have not been able to find a supporting content on the net. Can someone please shed light on this?
I've not tested this but according to the Microsoft.DocumentDB resource provider docs / template reference there is a Microsoft.DocumentDB/databaseAccounts/apis/databases/containers resource which may give you what you need.
Every container has an IndexingPolicy in the template schema, which has an array of IncludedPath objects which themselves have an array of Index objects as follows:
"includedPaths": [
{
"path": "string",
"indexes": [
{
"dataType": "string",
"precision": "integer",
"kind": "string"
}
]
}
]
It's treated as a separate resource from the database / account altogether. You may want to add this resource to your template with an appropriate dependsOn value to ensure it's deployed after your database.
You can add multiple paths therefore making a composite index.
Full schema is here:
https://learn.microsoft.com/en-us/azure/templates/microsoft.documentdb/2015-04-08/databaseaccounts/apis/databases/containers
If this doesn't do it, you may want to look at this too as the schema docs may be out of date and compositeIndexes may be supported:
https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-manage-indexing-policy#composite-indexing-policy-examples

How to Access Output Parameters from Azure ARM in next Tasks?

I am writing ARM scripts for my Azure infra. I have sample output variable in my ARM
"OutputVariables": [{
"name" : "MY_OUTPUTVARIABLE_1",
"description" : "This is the description of my output variable."
},
{
"name" : "MY_OUTPUTVARIABLE_2",
"description" : "Description can contains markdown [vsts-tasks](https://github.com/microsoft/vsts-tasks)"
}]
I want to access these ARM output variables in the next task of my VSTS release tasks.
I am not able to access variable MY_OUTPUTVARIABLE_1.
Please suggest how to use ARM output variables.
Thanks
This article shows you how to parse the output variables in VSTS. You need to make sure you define them as outputs of the task so VSTS knows what to look for. This can be found in the Output Variables section at the bottom of the task.
If it isn't initialised in the pipeline it can't be found. Also it's worth noting the ARM template you have provided doesn't actually set a value for the parameter. The ARM documentation shows the correct way of setting output variables.
"outputs": {
"resourceID": {
"type": "string",
"value": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_name'))]"
}
}
Hope that helps.

Resources