What command links the target siteA to a Firebase Hosting site ID?
medium
A. firebase target:apply hosting siteA your-site-id
B. firebase deploy --only hosting:siteA
C. firebase init hosting siteA
D. firebase hosting:link siteA your-site-id
Solution
Step 1: Understand target linking command
The command firebase target:apply hosting <target> <site-id> links a target name to a Firebase Hosting site ID.
Step 2: Review options
firebase deploy --only hosting:siteA deploys hosting but does not link targets. firebase init hosting siteA initializes hosting but does not link targets. firebase hosting:link siteA your-site-id is not a valid Firebase CLI command.
Final Answer:
firebase target:apply hosting siteA your-site-id -> Option A
Quick Check:
Target apply links target to site ID [OK]
Hint: Use 'firebase target:apply hosting' to link targets [OK]
Common Mistakes:
Using deploy instead of target:apply to link
Trying to link with firebase init
Assuming 'hosting:link' is a valid command
4. You added two sites in firebase.json hosting array but forgot to run firebase target:apply hosting. What happens when you deploy?
medium
A. Firebase creates new site IDs automatically
B. Both sites deploy successfully with default site IDs
C. Deployment fails with an error about missing target link
D. Only the first site deploys, second is ignored silently
Solution
Step 1: Understand target linking requirement
Each hosting target must be linked to a Firebase Hosting site ID using firebase target:apply hosting.
Step 2: Consequence of missing link
If targets are not linked, deployment fails with an error indicating missing target link.
Final Answer:
Deployment fails with an error about missing target link -> Option C
Quick Check:
Missing target link causes deployment error [OK]
Hint: Always link targets before deploying multiple sites [OK]
Common Mistakes:
Assuming Firebase auto-links targets
Expecting silent ignore of unlinked sites
Thinking deployment creates new site IDs
5. You want to host two websites: a blog and a store, under one Firebase project. You defined them in firebase.json hosting array with targets blog and store. Which sequence correctly sets up and deploys both sites?
hard
A. Run firebase deploy --only hosting:blog,hosting:store directly without linking targets
B. Run firebase target:apply hosting blog blog-site-id and firebase target:apply hosting store store-site-id, then firebase deploy --only hosting
C. Add sites in .firebaserc and run firebase deploy
D. Run firebase init hosting blog and firebase init hosting store then deploy
Solution
Step 1: Link each target to its Firebase Hosting site ID
Use firebase target:apply hosting <target> <site-id> for both blog and store targets.
Step 2: Deploy all hosting targets
Run firebase deploy --only hosting to deploy all defined hosting sites.
Final Answer:
Run target:apply for blog and store, then deploy hosting -> Option B
Quick Check:
Link targets first, then deploy hosting [OK]
Hint: Link targets first, then deploy all hosting sites [OK]
Common Mistakes:
Deploying without linking targets
Trying to define sites only in .firebaserc
Using firebase init hosting multiple times incorrectly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.