question

sachingupta-1921 avatar image
0 Votes"
sachingupta-1921 asked AnnuKumari-MSFT commented

Not able to deleted the linked service referenced in other linked service

Hello Everyone,

I am testing the Azure data factory deployment using ARM Templates and deleting the ADF instance (Data factory pipeline, linked services, data sets, data flow, Trigger etc.) using Azure Data Factory Delete item in-built task in DevOps Pipeline from azure Devops before deploying to UAT and production. All items deleted as per task outcome but there is one linked service which didn't delete.
Giving error= deleting LS_1 Linked Service: the document cannot be deleted since it is referenced by LS_2. basically the LS_2 deleted and it is not showing in the UAT ADF environment, only LS_1 is showing.

please find attached screenshot. please share your valuable suggestion on this how to resolve it.
Thanks

198614-12.jpg


198633-13.jpg


azure-data-factoryazure-devtestlabs
12.jpg (47.5 KiB)
13.jpg (78.5 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AnnuKumari-MSFT Thank you for follow up. The issue is resolved after I used the inline script to delete the linked services resolving the inter dependencies.

1 Vote 1 ·

@sachingupta-1921 ,
Glad to know it worked that way. Thanks for keeping us informed. Kindly consider clicking on Accept answer button as accepted answer helps community as well.

0 Votes 0 ·

Hi @sachingupta-1921 ,
Following up to see if the below suggestion was helpful, kindly do click Accept Answer and Up-Vote for the same. In case you have any further query please do let us know.

0 Votes 0 ·

@sachingupta-1921 ,
Kindly consider hitting Accept answer button as it helps the community. Thanks !

0 Votes 0 ·

1 Answer

AnnuKumari-MSFT avatar image
0 Votes"
AnnuKumari-MSFT answered

Hi @sachingupta-1921 ,
Thankyou for using Microsoft Q&A platform and posting your query.
As I understand your issue here, you are trying to delete linked service via DevOps pipeline , however, it's throwing error saying there is dependency on another linked service .

Although you have confirmed that you can no longer see the linked service LS_2 in the ADF workspace , could you please check the same switching to live mode in your ADF workspace and ensure LS_2 is not showing up .

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @sachingupta-1921 ,
Did you get a chance to check the previous response?

0 Votes 0 ·

Hi @AnnuKumari-MSFT
thank you for the response.
As per your response, Switching to Live mode for UAT environment- Means UAT environment is not configured to GIT or any Repository. Please correct my understanding if I am wrong.
if Correct, for this response All my adf pipeline and other datasets, dataflow are already in Live mode in ADF UAT workspace. I do see LS_2 is not showing up in the ADF UAT environment. But LS_1 is present.

please let me know your suggestion on this?

Thank you!


0 Votes 0 ·

@AnnuKumari-MSFT ... can you please provide some assistance on this?

0 Votes 0 ·

Hi @sachingupta-1921 ,
Apologies for delay in response. I tried to reproduce your issue , however, I am not able to find any such task named 'Azure Data Factory Delete Items' in my Azure DevOps . Is that some custom task you created? I would like to suggest to explicitly delete LS_2 using some shell script first before trying to delete all the linked services , although you have mentioned LS_2 is not visible in your UAT workspace, but in ARM template it might be having some reference probably.

To mitigate that, Kindly add Inline Azure Powershell task before Azure data factory delete items task in your DevOps pipeline and use the command replacing the required arguments:
Remove-AzDataFactoryV2LinkedService -ResourceGroupName "ADF" -DataFactoryName "WikiADF" -Name "LS_2"

For more details, please visit this MS doc page: Remove-AzDataFactoryV2LinkedService

If the above answer helped, Please do consider clicking Accept Answer and Up-Vote for the same as accepted answers help community as well. If you have any further query do let us know.


0 Votes 0 ·
Show more comments