Azure / Azure/azure-powershell

Set-AzureRmDataFactoryV2LinkedService : HTTP Status Code: BadRequest

Open
#11,066 7 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad customer-reported Data Lake Storage Gen2 Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

Hi all,

When I would to deploy a Azure Data Lake Gen2 Linkedservice via powershell, i get this error:
```
Set-AzureRmDataFactoryV2LinkedService : HTTP Status Code: BadRequest
Error Code: BadRequest
Error Message: Failed to encrypt sub-resource payload {
"Id": "/subscriptions/448f5935-d30a-4dac-98ef-fc1f2c2b264c/resourceGroups/TrialDS/providers/Microsoft.DataFactory/factories/TrialDS-Factory2/linkedservi
ces/LinkedServiceCuratedWikiData",
"Name": "LinkedServiceCuratedWikiData",
"Properties": {
"type": "LinkedService",
"typeProperties": {
"url": "********************"
},
"annotations": []
}
} and error is: Invalid type 'LinkedService' is provided in 'linkedServices'. Please correct the type in payload and retry..
Request Id: fe6d2d14-ae5a-41b9-a284-2dec89d78927
Timestamp (Utc):02/07/2020 15:38:03
At line:1 char:1
+ Set-AzureRmDataFactoryV2LinkedService -ResourceGroupName "TrialDS" -D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmDataFactoryV2LinkedService], ErrorResponseException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.DataFactoryV2.SetAzureDataFactoryLinkedServiceCommand
```

My line in powershell (copied from the tutorial):
`Set-AzureRmDataFactoryV2LinkedService -ResourceGroupName "TrialDS" -DataFactoryName "TrialDS-Factory2" -Name "LinkedServiceCuratedWikiData" -File "C:\\Users\\\\Desktop\\ADF Deployment\\linkedservice\\datalake.json" | Format-List`

But I follow this tutorial:
https://docs.microsoft.com/en-us/powershell/module/azurerm.datafactories/set-azurermdatafactoryv2linkedservice?view=azurermps-4.4.1

And use the JSON of my current working ADF:
```
{
"name": "datalake",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"type": "AzureBlobFS",
"typeProperties": {
"url": "https://.dfs.core.windows.net"
},
"annotations": []
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Set-AzureRmDataFactoryV2LinkedService with the supplied datalake.json and compare the payload against the linked-service schema in the referenced tutorial. The work is done when the Azure Data Lake Gen2 linked service deploys successfully without the BadRequest or invalid 'LinkedService' type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.