Azure-Player / azure.synapse.tools

PowerShell module to deploy Synapse workspace (and more) in Microsoft Azure.
MIT License
19 stars 8 forks source link

PL with WebActivity with Basic Authentication throws exception #12

Closed FrenkLoonen closed 2 years ago

FrenkLoonen commented 2 years ago

I have a pipeline with a WebActivity that uses Basic Authentication, which throws an exception. I've narrowed it down to this part, because when I change authentication to MSI, it works fine.

Start deploying object: [pipeline].[PL_CHECK_DEVOPS_STATUS] (2 dependency/ies)
VERBOSE: 1) Depends on: [LinkedService].[LS_KEV]
VERBOSE: Object [linkedService].[LS_KEV] is already deployed.
VERBOSE: 2) Depends on: [IntegrationRuntime].[SelfHostedIntegrationRuntime]
Start deploying object: [IntegrationRuntime].[SelfHostedIntegrationRuntime] (0 dependency/ies)
VERBOSE: Ready to deploy from file: C:\Synapse\integrationRuntime\SelfHostedIntegrationRuntime.json
VERBOSE: Integration Runtime type detected: Self-Hosted
Finished deploying object: [IntegrationRuntime].[SelfHostedIntegrationRuntime]
VERBOSE: Ready to deploy from file: C:\Synapse\pipeline\PL_CHECK_DEVOPS_STATUS.json
Set-AzSynapsePipeline: C:\PowerShell\Modules\azure.synapse.tools\0.18.0\private\Deploy-SynapseObjectOnly.ps1:100
Line |
 100 |              Set-AzSynapsePipeline `
     |              ~~~~~~~~~~~~~~~~~~~~~~~
     | Exception has been thrown by the target of an invocation.

Finished deploying object: [pipeline].[PL_CHECK_DEVOPS_STATUS]

It's related to this part of code in the pipeline:

"authentication": {
    "type": "Basic",
    "username": {
        "value": "@pipeline().parameters.devopsUsername",
        "type": "Expression"
    },
    "password": {
        "type": "AzureKeyVaultSecret",
        "store": {
            "referenceName": "LS_KEV",
            "type": "LinkedServiceReference"
        },
        "secretName": "<mySecret>"
    }
}

When I change it to this, it works fine:

"authentication": {
    "type": "MSI",
    "resource": "https://management.azure.com/"
}

The secret exists, I selected it using the UI: image

FrenkLoonen commented 2 years ago

Done some more debugging.. at first I thought it maybe was because of the link to the KeyVault.. but it looks like it doesn't want to do Basic Authentication at all.. I tried using this

"authentication": {
    "type": "Basic",
    "username": {
        "value": "@pipeline().parameters.devopsUsername",
        "type": "Expression"
    },
    "password": {
        "type": "SecureString",
        "value": "**********"
    }
}

but it's giving me the same error.

NowinskiK commented 2 years ago

Hi @FrenkLoonen, can you attach the file of pipeline which causes the problem?

NowinskiK commented 2 years ago

I tested it and apparently it's working fine.