web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Secret Key Vault Url

(0) ShareShare
ReportReport
Posted on by 795

Hi,

Can anyone tell me how can i generate a secret key vault URL for my Data Export Profile ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PranavShroti Profile Picture
    4,510 on at

    Hi Biginner,

    You have to have a Azure subscription and little PowerShell skills. 

    https://technet.microsoft.com/en-us/library/mt744592.aspx#SetupAzureKV

     

    # -------------------------------------------------------------------------------- #
    	#  Provide the value for the following parameters before executing the script
    $subscriptionId = 'ContosoSubscriptionId'	
    $keyvaultName = 'ContosoKeyVault'
    	$secretName = 'ContosoDataExportSecret'
    	$resourceGroupName = 'ContosoResourceGroup1'
    	$location = 'West US'
    	$connectionString = 'AzureSQLconnectionString'
    $organizationIdList = 'ContosoSalesOrg1_id, ContosoSalesOrg2_id'
    $tenantId = 'tenantId'
    	# -------------------------------------------------------------------------------- #
    
    # Login to Azure account, select subscription and tenant Id
    Login-AzureRmAccount
    Set-AzureRmContext -TenantId $tenantId -SubscriptionId $subscriptionId
    
    # Create new resource group if not exists.
    $rgAvail = Get-AzureRmResourceGroup -Name $resourceGroupName -Location $location -ErrorAction SilentlyContinue
    if(!$rgAvail){
        New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
    }
    
    # Create new key vault if not exists.
    $kvAvail = Get-AzureRmKeyVault -VaultName $keyvaultName -ResourceGroupName $resourceGroupName -ErrorAction SilentlyContinue
    if(!$kvAvail){
        New-AzureRmKeyVault -VaultName $keyvaultName -ResourceGroupName $resourceGroupName -Location $location
        # Wait few seconds for DNS entry to propagate
        Start-Sleep -Seconds 15
    }
    
    # Create tags to store allowed set of Organizations.
    $secretTags = @{}
    foreach ($orgId in $organizationIdList.Split(',')) {
        $secretTags.Add($orgId.Trim(), $tenantId)
    }
    
    # Add or update a secret to key vault.
    $secretVaule = ConvertTo-SecureString $connectionString -AsPlainText -Force
    $secret = Set-AzureKeyVaultSecret -VaultName $keyvaultName -Name $secretName -SecretValue $secretVaule -Tags $secretTags
    
    # Authorize application to access key vault.
    $servicePrincipal = 'b861dbcc-a7ef-4219-a005-0e4de4ea7dcf'
    Set-AzureRmKeyVaultAccessPolicy -VaultName $keyvaultName -ServicePrincipalName $servicePrincipal -PermissionsToSecrets get
    
    # Display secret url.
    Write-Host "Connection key vault URL is "$secret.id.TrimEnd($secret.Version)"" 

    Running this above powershell script will generate your secret key.

    If found useful, please mark the answer as verified

    Regards,

    Pranav

  • CRM Beginner  Profile Picture
    795 on at

    Yes, i am running this Powershell script in my Windows Powershell but its not working and throwing errors

  • PranavShroti Profile Picture
    4,510 on at

    will it be possible to share error screen...?

  • CRM Beginner  Profile Picture
    795 on at

    Yes, that I can show you but let me clarify one doubt that why can't I connect Azure sql db as a server in my Azure portal.?

  • Suggested answer
    PranavShroti Profile Picture
    4,510 on at

    well its a security thing... it is essential to protect data in the cloud. Key Vault provides that feature to encrypt keys and small secrets like passwords that use keys stored in hardware security modules (HSMs).

    you can find more details here.: azure.microsoft.com/.../key-vault

    If found useful, please mark the answer as verified

    Regards,

    Pranav

  • CRM Beginner  Profile Picture
    795 on at

    3632.image4.PNG

    Can you tell me if this server is not already added , why still this is showing error ? And if added , where do i find this? It is the same server where i need to export my data using data export service?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans