Over medium heat, cook diced bacon in a nine inch cast iron skillet until fat is rendered and the bacon gets crispy.
Throw sweet potatoes, onions, and rosemary in the skillet on top of the bacon and its grease. Stir to make sure everything is coated in bacon grease. Press out into a single layer. Sprinkle with kosher salt and pepper. Continue to cook over medium heat. Check the bottom side of the sweet potatoes and stir them when they start to brown. Stir occasionally until the potatoes are tender but not mushy.
Make four little round wells in the hash for the eggs. Crack an egg into each well and bake at 350 degrees for 10 minutes or until the white is set.
Serve immediately. Well, take it out of the oven first and then serve immediately.