How to generate a valid Azurite custom account key

821 Views Asked by At

How to create a valid key for azurite storage explorer, when I give some random alpha numeric values, it's failing saying not a valid base64 value

1

There are 1 best solutions below

0
On

can you provide some more details on the scenario you are trying to address? The storage emulator will default to the standard dev account key see:
https://github.com/Azure/Azurite#storage-accounts

If you want to use a different key, you need to replace the account key with a valid base64 string, found in the constants.ts files, one per API.
You can see how it is done in the code :

export const EMULATOR_ACCOUNT_KEY_STR =
  "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==";
export const EMULATOR_ACCOUNT_KEY = Buffer.from(
  EMULATOR_ACCOUNT_KEY_STR,
  "base64"
);