Closed Ranjit-Kumar-Konjeti closed 1 year ago
Thank you for your feedback. This has been routed to the support team for assistance.
@Ranjit-Kumar-Konjeti Can you please provide the full code as it looks like the code which you have shared is incomplete and it is missing use of $DFlinkedServicesObject and $linkedservicejson.
@SaurabhSharma-MSFT - do not worry about the missing code. main method is "Get-AzDataFactoryV2LinkedService". you can create a Datafactory and add linked service of type sqldatabase and then use keyvault secret instead of sql connection string and use the code below(by giving your datafactoryname and resourcegroupname) to list the linkedservices of type sqldatabase and type "AzureKeyVaultSecret" and try to get the keyvault name from there. I tried using Azure powershell, az cli and rest api. all 3 of them does not return keyvault name. Hope I am clear.
Get-AzDataFactoryV2LinkedService -DataFactoryName $dataFactoryName -ResourceGroupName $resourceGroupName
@Ranjit-Kumar-Konjeti I am not able to reproduce this issue. I referring to Azure Key Vault to get SQL connection string and Key Vault name connection name correctly appears in the results output. Please see below the screenshot - You can find the connection string properties under Properties.AdditionalProperties of the returned result set. Please try to fetch the Properties of your returned linked service. Are you expecting the actual Keyvault name in the result set? I don't think cmdlet will return that as the Json result set includes the linked service connection name from ADF which is configured for the Azure Key vault.
Yes we are expecting the keyvault name not just the reference name, in this case how do we know which keyvault name it is referenced to?
@Ranjit-Kumar-Konjeti If you want to know actual Key Vault name then use the same cmdlet again by passing the Azure Key vault linked service referencename like below - Please let me know if you have any other questions.
ok let me check and get back to you. Thanks!
Hi @Ranjit-Kumar-Konjeti. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve
” to remove the “issue-addressed” label and continue the conversation.
Hi @Ranjit-Kumar-Konjeti, since you haven’t asked that we “/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.
@SaurabhSharma-MSFT , this one still does not work . I think you are referring to LinkedServiceType "keyvault". I can see the keyvault name from there but that is not what I am asking for. I am checking for LinkedServiceType "AzureSqlDatabaseLinkedService" and then get the Properties of that object where it references erither sql db connection or keyvault connection. I am looking keyvault name from that keyvault connection
@SaurabhSharma-MSFT - could you please re open the issue and check once.
Description
Get-AzDataFactoryV2LinkedService does not return reference keyvault name in the linkedeservice of type "Azure SQL Database"
The below code only returns referenceName as "KeyVault" but it does not return actual keyvault name.
$linkedservicejson.typeProperties.connectionString.store.referenceName
referenceName type
KeyVault LinkedServiceReference
Issue script & Debug output
Environment data
Module versions
Error output