1

In my testing on the desktop, Office.context.partitionKey is undefined.

In the docs, it states:

Gets a partition key for local storage. Add-ins should use this partition key as part of the storage key to securely store data. The partition key is undefined in environments without partitioning, such as the browser controls for Windows applications.

In the cases where it is defined, what is it partitioning by?

For example, does it refer to:

  • A single addin, across all instances, ie. a manifest id
  • Each addin instance, ie. each shared runtime environment gets a unique key, say each word document gets a new id
  • All potential addins from a single author
  • Other

My intuition would say it should be the first option, however I wasn't able to find anything explicit that references this.

What is the partition key partitioning by?

1 Answer 1

1

The partitioning is by an ordered pair of domains:

  • The domain that the top-level browser window is at, such as excel.cloud.microsoft in the case of Excel on the web

  • The domain of the add-in, such as contoso.com

So, each of the following would be a different partition:

excel.cloud.microsoft + myAddin.contoso.com

word.cloud.microsoft + myAddin.contoso.com

word.cloud.microsoft + myOtherAddin.contoso.com

The partition key is a hash of the two domains.

Sign up to request clarification or add additional context in comments.

1 Comment

Appreciate your response. It would good if that extra info was added into the docs!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.