i18n .use(initReactI18next) // passes i18n down to react-i18next .init({ resources: resources, lng: "en", // if you're using a language detector, do not define the lng option fallbackLng: "en", interpolation: { escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape }, });
if (name == null) { // Get request body dynamic data = await req.Content.ReadAsAsync<object>(); name = data?.name; }
return name == null ? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body") : req.CreateResponse(HttpStatusCode.OK, "Hello " + name); }
啟用 Function App 的 Managed Identity
移動到 Functions Apps 的 Settings > Identity, 可以看 System assigned > Status 將它切換為 On. 這一步的設定是為了讓服務之間可以受到 AAD 控管而不需要你自行處理.
// Get var testKV = Environment.GetEnvironmentVariable("TestKV", EnvironmentVariableTarget.Process);
而如果你需要寫入請使用 Azure SDK Client Library
1 2 3 4 5 6 7
using Azure.Identity; using Azure.Security.KeyVault.Secrets; /// Skip ... /// Set var kvUri = $"https://{KeyVaultName}.vault.azure.net"; var client = new SecretClient(new Uri(kvUri), new DefaultAzureCredential()); client.SetSecret($"{SecretKey}", $"{SecretValue}");
[oh-my-zsh] For safety, we will not load completions from these directories until [oh-my-zsh] you fix their permissions and ownership and restart zsh. [oh-my-zsh] See the above list for directories with group or other writability.
[oh-my-zsh] To fix your permissions you can do so by disabling [oh-my-zsh] the write permission of "group" and "others" and making sure that the [oh-my-zsh] owner of these directories is either root or your current user. [oh-my-zsh] The following command may help: [oh-my-zsh] compaudit | xargs chmod g-w,o-w
[oh-my-zsh] If the above didn't help or you want to skip the verification of [oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to [oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.