Exemple #1
0
        public override async Task WriteSnapshotAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets)
        {
            if (secrets == null)
            {
                throw new ArgumentNullException(nameof(secrets));
            }

            string blobPath = GetSecretsBlobPath(type, functionName);

            blobPath = SecretsUtility.GetNonDecryptableName(blobPath);
            await WriteToBlobAsync(blobPath, ScriptSecretSerializer.SerializeSecrets(secrets));
        }
        public async Task WriteSnapshotAsync(ScriptSecretsType type, string functionName, string secretsContent)
        {
            if (secretsContent == null)
            {
                throw new ArgumentNullException(nameof(secretsContent));
            }

            string blobPath = GetSecretsBlobPath(type, functionName);

            blobPath = SecretsUtility.GetNonDecryptableName(blobPath);
            await WriteToBlobAsync(blobPath, secretsContent);
        }
        private string GetSecretsFilePath(ScriptSecretsType secretsType, string functionName = null, bool isSnapshot = false)
        {
            string result = secretsType == ScriptSecretsType.Host
                ? _hostSecretsPath
                : GetFunctionSecretsFilePath(functionName);

            if (isSnapshot)
            {
                result = SecretsUtility.GetNonDecryptableName(result);
            }

            return(result);
        }
Exemple #4
0
        public override async Task WriteSnapshotAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets)
        {
            ArgumentNullException.ThrowIfNull(secrets);

            string blobPath = GetSecretsBlobPath(type, functionName);

            blobPath = SecretsUtility.GetNonDecryptableName(blobPath);

            try
            {
                await WriteToBlobAsync(blobPath, ScriptSecretSerializer.SerializeSecrets(secrets));
            }
            catch (Exception ex)
            {
                LogErrorMessage("write", ex);
                throw;
            }
        }