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

  • CRM Beginner  Profile Picture
    795 on at
    RE: Secret Key Vault Url

    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?

  • Suggested answer
    PranavShroti Profile Picture
    4,510 on at
    RE: Secret Key Vault Url

    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
    RE: Secret Key Vault Url

    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.?

  • PranavShroti Profile Picture
    4,510 on at
    RE: Secret Key Vault Url

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

  • CRM Beginner  Profile Picture
    795 on at
    RE: Secret Key Vault Url

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

  • Suggested answer
    PranavShroti Profile Picture
    4,510 on at
    RE: Secret Key Vault Url

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans