0

I am deploying a Azure Function Linked Service through CICD pipeline, I am unable to deploy it to ADF with its function key

 "LS_AF_xxxx_properties_typeProperties_functionAppUrl": {
  "value": "https://xxxx.azurewebsites.net"
},
 "LS_AF_xxxx_properties_typeProperties_encryptedCredential": {
            "value": "uiaLtjo8ACh5zYAparmGIhLh_Bhvk4VbsgcGLFWWSFNzAzFumEPZ9w=="
        }

The error is as below

'The template parameters 'LS_AF_xxxx_properties_typeProperties_encryptedCredential' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment.

Is there a way to create an azure function linked service with function key through ARM template

Anshul Dubey
  • 349
  • 4
  • 14
  • https://stackoverflow.com/questions/74196878/azure-arm-template-parameters-for-parametrized-linked-service?rq=2 Took help of this one , exporting ARM template and view the code. – Anshul Dubey Aug 01 '23 at 14:04

1 Answers1

0

Yes, I agree with your comment and the SO thread you shared to export the ARM template of Linked Azure Function service and then edit it accordingly and use it in your Azure Devops ARM task.

I created one Linked Service with Azure Function like below:-

enter image description here

Then I Exported the ARM template and used it in my Azure Devops pipeline:-

Go to Manage tab in ADF > Source control > ARM Template > Export

enter image description here

Uploaded the Exported File in Azure repository:-

enter image description here

Exported ARM code with Function:-

{
            "name": "[concat(parameters('factoryName'), '/pipeline15')]",
            "type": "Microsoft.DataFactory/factories/pipelines",
            "apiVersion": "2018-06-01",
            "properties": {
                "activities": [
                    {
                        "name": "Azure Function1",
                        "type": "AzureFunctionActivity",
                        "dependsOn": [],
                        "policy": {
                            "timeout": "0.12:00:00",
                            "retry": 0,
                            "retryIntervalInSeconds": 30,
                            "secureOutput": false,
                            "secureInput": false
                        },
                        "userProperties": [],
                        "typeProperties": {
                            "functionName": "HttpTrigger1",
                            "method": "GET",
                            "headers": {}
                        },
                        "linkedServiceName": {
                            "referenceName": "AzureFunction1",
                            "type": "LinkedServiceReference"
                        }
                    }
                ],
                "policy": {
                    "elapsedTimeMetric": {},
                    "cancelAfter": {}
                },
                "annotations": []
            },
            "dependsOn": []
        },

Utilize the Exported Linked ARM template in your CI/CD pipeline like below:-

steps:
- task: AzureResourceManagerTemplateDeployment@3
  displayName: 'ARM Template deployment: Resource Group scope'
  inputs:
    azureResourceManagerConnection: 'subscription(xxxxe2b6e97cb2a7)'
    subscriptionId: 'xxxx598-44d6-b4fd-e2b6e97cb2a7'
    resourceGroupName: siliconrg54
    location: 'Australia East'
    csmFile: '$(System.DefaultWorkingDirectory)/_functionARMADF/factory/pratikdemofact_ARMTemplateForFactory.json'
    csmParametersFile: '$(System.DefaultWorkingDirectory)/_functionARMADF/factory/pratikdemofact_ARMTemplateParametersForFactory.json'

enter image description here

SiddheshDesai
  • 3,668
  • 1
  • 2
  • 11