i am using your code only.if i have create cosmosdbapi linked service .i am facing issue .please find my issue.
Set-AzureRmDataFactoryV2LinkedService : HTTP Status Code: BadRequest
Error Code: BadRequest
Error Message: Failed to encrypt sub-resource payload {
"Id": "/subscriptions/6e051d77-4292-4764-9964-7b58a3dc445c/resourceGroups/backend_db_backup/providers/Microsoft.DataFactory/factories/BackupCosmosDB/linkedse
rvices/CosmosDbMongoDbApi5",
"Name": "CosmosDbMongoDbApi5",
"Properties": {
"type": "LinkedService",
"typeProperties": {
"connectionString": "*****",
"database": "*****",
"encryptedCredential": "******"
},
"connectVia": {
"referenceName": "BackupCosmosDBIR",
"type": "IntegrationRuntimeReference"
}
}
} and error is: Invalid type 'LinkedService' is provided in 'linkedServices'. Please correct the type in payload and retry..
Request Id: 1c835912-56e1-4054-94ef-855ad7e85347
Timestamp (Utc):02/05/2019 12:19:31
At E:AzureAssignmentDatafactory_AutomationazureDeploy.ps1:22 char:1
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@Utthirabalaji Thank you for providing this detailed feedback. Can you please provide the documentation link or reference the tutorial/quickstart instructions you are attempting to follow, we can address this issue. It looks like the property value of LinkedService is being passed for the property linkedServices. Also, please consider removing any sensitive data from error messages such as the subscription ID value.
Hi team,
Please find the document link.
https://docs.microsoft.com/en-us/azure/data-factory/connector-azure-cosmos-db-mongodb-api
Thanks
Utthirabalaji
@Utthirabalaji You are attempting to create this in PowerShell?
No I am creating arm template with powershell
"name": "CosmosDbMongoDbApi5",
"type": "Microsoft.DataFactory/factories/linkedservices",
"properties": {
"type": "CosmosDbMongoDbApi",
"typeProperties": {
"connectionString": "mongodb://backenddb:@backenddb.documents.azure.com:10255/?ssl=true;replicaSet=globaldb",
"database": "NBME",
"encryptedCredential": "ew0KICAiVmVyc2lvbiI6ICIyMDE3LTExLTMwIiwNCiAgIlByb3RlY3Rpb25Nb2RlIjogIktleSIsDQogICJTZWNyZXRDb250ZW50VHlwZSI6ICJQbGFpbnRleHQiLA0KICAiQ3JlZGVudGlhbElkIjogIkJBQ0tVUENPU01PU0RCX2FmYzhjOTUwLWVmMTQtNGMxOC1hMmE5LWNjNjAwMjU1MmFkNiINCn0="
},
"connectVia": {
"referenceName": "BackupCosmosDBIR",
"type": "IntegrationRuntimeReference"
}
}
}
Get Outlook for Androidhttps://aka.ms/ghei36
From: Mike Ubezzi notifications@github.com
Sent: Tuesday, February 5, 2019 9:33:23 PM
To: MicrosoftDocs/azure-docs
Cc: Utthirabalaji V; Mention
Subject: Re: [MicrosoftDocs/azure-docs] CosmosDbMongoDbApi Linked Service Issue (#24281)
@Utthirabalajihttps://github.com/Utthirabalaji You are attempting to create this in PowerShell?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/MicrosoftDocs/azure-docs/issues/24281#issuecomment-460812246, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AeSo391bwnDvY18lBvu43Gulg1fLgsxNks5vKfijgaJpZM4ajL30.
[Image]
DISCLAIMER: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. Please note that intercepting or any unauthorized use of this message or any attachment can be treated as infringement of person’s right of privacy under the Human Rights Act 1993 and also is a Criminal Offence under the Information and Technology Act, 2008.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. Thank you for your cooperation.
Okay, this needs to go to support, as you might be leveraging code samples in a tutorial, the tutorial itself doesn't necessarily need to be addressed...the use of an ARM template does in this case. Do you have an Azure Support Plan? If not, I can use the Subscription ID value found in your error text to enable a one-time incident ticket to have this investigated. Please send me an email at AzCommunity at Microsoft.com and I will return you instructions to have a support ticket created. In return, please update this GitHub issue with resolution steps.
I don't have azure support plan.i am using azure free subscription
Please reach out to me via the email address provided and I will return instructions. Thank you!
Did you find my issue
If I run that json through Powershell . facing this kind of error.
Set-AzureRmDataFactoryV2LinkedService : HTTP Status Code: BadRequest
Error Code: BadRequest
Error Message: Failed to encrypt sub-resource payload {
"Id": "/subscriptions/6e051d77-4292-4764-9964-7b58a3dc445c/resourceGroups/backend_db_backup/providers/Microsoft.DataFactory/factories/BackupCosmosDB/linkedse
rvices/CosmosDbMongoDbApi5",
"Name": "CosmosDbMongoDbApi5",
"Properties": {
"type": "LinkedService",
"typeProperties": {
"connectionString": "",
"database": "",
"encryptedCredential": "******"
},
"connectVia": {
"referenceName": "BackupCosmosDBIR",
"type": "IntegrationRuntimeReference"
}
}
} and error is: Invalid type 'LinkedService' is provided in 'linkedServices'. Please correct the type in payload and retry..
Request Id: 1c835912-56e1-4054-94ef-855ad7e85347
Timestamp (Utc):02/05/2019 12:19:31
At E:AzureAssignmentDatafactory_AutomationazureDeploy.ps1:22 char:1
Set-AzureRmDataFactoryV2LinkedService -DataFactoryName $DatafactoryNa ...
Pls rectify it.
@Utthirabalaji
You have been enabled for one-time Free Technical Support. To create the support request, please do the following:

@Utthirabalaji I have escalated this item to the product group through a separate channel. We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.
@Utthirabalaji , the powershell support for this connector hasn't been ready. To mitigate, you can author & edit your pipeline on ADF UI.
This link for your reference: https://docs.microsoft.com/en-us/azure/data-factory/quickstart-create-data-factory-portal#create-a-data-factory