Azure / Azure-DataFactory

Other
485 stars 591 forks source link

Auth header not being included in REST API Service after release pipeline deployment #689

Closed PaulKna closed 2 months ago

PaulKna commented 2 months ago

We have a REST Linked Service that in our development environment has an Auth Header Authorization and which reads the value from a key vault. Up until recently this was working fine when deployed to a data factory in another environment using a release pipeline as demonstrated here: https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-delivery-automate-azure-pipelines.

However, when I deployed our latest release yesterday (04/09/24) this linked service stopped working. When examining it the Auth Header in the production linked service was blank, whilst the dev linked service was populated as it was before. The JSON of the linked service in dev is like this:

{ "name": "REDACTED", "properties": { "description": "REDACTED", "annotations": [], "type": "RestService", "typeProperties": { "url": "REDACTED", "enableServerCertificateValidation": false, "authenticationType": "Anonymous", "authHeaders": { "Authorization": { "type": "AzureKeyVaultSecret", "store": { "referenceName": "ADFKeyVault", "type": "LinkedServiceReference" }, "secretName": "REDACTED" } } } } }

When deployed to production the JSON it looks like this with an "encryptedCredential" entry added with no Authorization auth header details:

{ "name": "REDACTED", "type": "Microsoft.DataFactory/factories/linkedservices", "properties": { "description": "REDACTED", "annotations": [], "type": "RestService", "typeProperties": { "url": "REDACTED", "enableServerCertificateValidation": false, "authenticationType": "Anonymous", "encryptedCredential": "REDACTED" } } }

The JSON for the object in the ARMTemplateForFactory.json is as expected i.e. as per the dev environment. Our previous release on 30/08/24 worked fine and the linked service has not been edited for over a year. I tried creating a new linked service and the same thing happened when deployed to another environment. Is anybody experiencing likewise and know why has this stopped working/have any suggestions to resolve?

Thanks

PaulKna commented 2 months ago

I have also tried to use a Powershell script to update the json definition using Set-AzDataFactoryV2LinkedService and a copy of the correct json but that also resulted in the authHeader not being populated.

PaulKna commented 2 months ago

This has now appears to have been fixed as when I tried again today it is now deploying correctly