Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Create and configure Foundry resources and project environments

A worked example

Single answer

A developer ran azd up, which provisioned a Microsoft Foundry project and generated a .env file containing the project connection details and the deployed agent ID. The developer now shares the repository with other learners. The other learners must be able to see which environment variables the application expects. The values in the generated .env file must not be committed to the repository.

What should the developer do with the environment configuration files?

Choose one answer
Why

The generated .env file holds the connection details for the Foundry project and agent, so it is excluded from source control through .gitignore. To tell others which variables are needed, the repository includes a .env.example template with placeholder values. This combination shares the required variable names without committing the generated values.

  • Not correct: Commit the generated .env file so that other learners reuse its values. Committing .env would place the generated connection details in the repository, which the plan avoids by listing .env in .gitignore.
  • Not correct: Add both .env and .env.example to .gitignore and commit neither. The .env.example file is the template that shows the required variables; ignoring it hides that information from other learners.
  • Not correct: Copy the generated values into azure.yaml and commit that file. In the plan, azure.yaml is the azd configuration file; moving the generated values into a committed file still exposes them in the repository.
  • Correct: Add .env to .gitignore and commit a .env.example file with placeholder values. The plan keeps .env in .gitignore to prevent secret exposure and provides .env.example as a template that shows the required variables, which meets both requirements.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free