docker run --rm -it -v gitlab-runner-config:/etc/gitlab-runner \ gitlab/gitlab-runner:latest register
Enter your GitLab instance URL (also known as the gitlab-ci coordinator URL).
Enter the token you obtained to register the runner.
Enter a description for the runner. You can change this value later in the GitLab user interface.
Enter the tags associated with the runner, separated by commas. You can change this value later in the GitLab user interface.
Provide the runner executor. For most use cases, enter docker.
If you entered docker as your executor, you’ll be asked for the default image to be used for projects that do not define one in .gitlab-ci.yml. GitLab instance URL 是 https://gitlab.com/ 你可以在專案中的 Settings > CI/CD 找到 token, description 會顯示在 Runner List 中,可以用易懂的描述, tags 可以更多的參考這本篇文章設定 executor 選用 docker 記得需要安裝 docker daemon executor 為 docker 時,需要註明預設的 image,我是選用 docker:stable
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}");