Microsoft DevOps Engineer Expert AZ-400 Practice Question
Your team accidentally committed an Azure service principal JSON file that contains client secrets to an Azure Repos Git repository. The secret appears in multiple branches and tags. You must permanently remove every instance of the secret from the repository history and ensure that new clones cannot retrieve it. The solution should complete quickly on a repository that is several gigabytes in size and preserve all other history. What should you do?
Add the JSON file to the repository's .gitignore, commit the change, and push it to all branches.
Run BFG Repo-Cleaner with a text-replacement or file-deletion rule against the bare repository mirror, then force-push the rewritten history to origin.
Delete the branch that first introduced the secret and push the deletion to origin.
Revert the commit that added the JSON file on every branch and push the new commits to origin.
BFG Repo-Cleaner is the approach Microsoft recommends when you need to strip sensitive data such as passwords or large binaries from a Git repository. BFG works far faster than the older git filter-branch utility, making it suitable for multi-gigabyte repositories, and it automatically cleans all branches and tags. After running BFG with the appropriate --replace-text or --delete-files options and then force-pushing the rewritten history, the secret is removed from every reachable commit so that future clones cannot obtain it. Simply reverting the offending commit, deleting a branch, or adding the file to .gitignore only affects future snapshots-the secret remains in earlier commits that are still accessible, so those actions do not satisfy the requirement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is BFG Repo-Cleaner?
Open an interactive chat with Bash
What does force-pushing rewritten history accomplish?
Open an interactive chat with Bash
How does BFG Repo-Cleaner compare to `git filter-branch`?
Open an interactive chat with Bash
Microsoft DevOps Engineer Expert AZ-400
Design and implement a source control strategy
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .