Always Encrypted Guide Results in Build Error

Nathan R 1 Reputation point
2021-11-19T16:15:19.217+00:00

I'm receiving a build error while trying to follow along with the Always Encrypted guide here: https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-always-encrypted?tabs=dotnet

I transplanted this into a console app which is now a direct copy paste from the docs and am getting the same error

'EncryptionKeyWrapMetadata' is inaccessible due to its protection level  

150940-image.png

Here are the packages and versions in use:
151000-image.png

Where am I going wrong here?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,543 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,791 Reputation points Microsoft Employee
    2021-11-22T23:52:39.02+00:00

    Hi @Nathan R ,
    Thanks for using Microsoft Q&A !!
    I have tried using the sample and it works fine and I am able to build the solution without any issues.
    I have only installed only two packages -

    • Install-Package Microsoft.Data.Encryption.AzureKeyVaultProvider -Version 0.2.0-pre and
    • Install-Package Microsoft.Azure.Cosmos.Encryption -Version 1.0.0-previewV18
      151631-image.png

    Looks like these to nuget packages are taking care of other dependencies. Can you please try building it again by removing other two packages - Azure.Identity and Microsoft.Azure.Cosmos

    Please let me know if you have any questions.

    Thanks
    Saurabh

    1 person found this answer helpful.