microsoft / microsoft/sql-server-samples

Setup script in the "Always Encrypted" demo fails

Open
#1,032 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

Hello,

I tried to deploy the “always encrypted with secure enclave” demo, and got two errors during running the setup script

  1. line 27. $userObjectId = $(Get-AzADUser -UserPrincipalName $userName).Id always return empty string, which will fail subsequent commands. Changing the code to $userObjectId = $(Get-AzADUser -SignedIn).Id works. Not sure why UserPrincipalName doesn't work for me, but at least this is not blocking.
  2. line 117. $cmkSettings = New-SqlAzureKeyVaultColumnMasterKeySettings -KeyURL $key.Key.Kid -AllowEnclaveComputations fails with error like New-SqlAzureKeyVaultColumnMasterKeySettings: The given key 'AZURE_KEY_VAULT' was not present in the dictionary. The command works if we remove the -AllowEnclaveComputations option but it is not what we want.

So I could not encrypted the columns in the table.

I tried to deploy the demo in both Mac and linux, same error. I don't have a Window machine. So I couldn't use the SSMS to configure "Always encrypted". The Azure Data Studio doesn't support configuring "Always Encrypted"

Any suggestion on how to fix the second error above?

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with samples/features/security/always-encrypted-with-secure-enclaves/azure-sql-database/setup/setup.ps1 and reproduce the failures at lines 27 and 117 on the affected platforms. Check the referenced Az and SQL Azure Key Vault commands first; done means the setup script completes and the demo columns can be encrypted.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell, sql
Domain
cloud, databases, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.