Two other answers disappeared. Now my third answer disappeared even tho I was careful. I forgot to periodically save.
A short answer based on personal experience and education is that, at age 17, there is not much we can control. The more anxious and angry become, the more the teen will rebel. When we're able to let them take responsibility for their decisions, we give them room to learn and grow. Sounds like you and your daughter are in a power struggle. She is rebelling because she feels that she has no power.
Parents, with a 17 yo, only has the ability to control what happens in their house. I suggest you show her respect by not lecturing and making demands that you can't enforce.
Parents have control over what they are willing to do. Take away car privileges, electronics for which they pay and new clothes, rearranging their schedule.to help the teen. In other words let go of trying to change them and focus on how you can change yourself so that they will have a choice.
I suggest that not allowing her friends come to your home eliminates your ability to know them and how they act. Be respectful of friends and they will likely respect you.
We want our teen to be a responsible adult. That requires that we are willing to let them learn for themselves by
letting them make mistakes and giving them consequences that teach rather than punish.
My 17 yo granddaughter has lived with me since she was 14. I learned that when I nag, lecture and show anger I am not respecting her right to be involved in her own life. A parent is also not respecting themselves when they react in anger. They've let go of the ability to control themselves.
Have just a few rules with natural consequences. Give the consequence in as unemotional way you can manage. This will help them consider the action and consequences. When we're angry and punitive the teen gets angry instead of thinking about the lesson.
I suggest you're in a power struggle with your daughter. The relationship becomes about power instead of learning how to navigate life.
Of course you worry, get angry because you feel powerless. She rebels to feel like she has some control. In reality, you both share power when you let go of trying to control and learn how to respect each other. You daughter is responsible for herself. And you are responsible for yourself and your home. Those are the only things still within your control.
Some of us learn the hard way. Focus on the lesson instead of punishing. Treat her with respect and she's more apt to respect you. Work together to find resolutions. Sharing power is difficult.
I urge you to read How to Talk to Teens so they Talk to You by Edna Ferber. Love and Logic book is helpful. Love and Logic has web sites to look at.
I also urge you to get counseling for help in being able to change this situation. Don't expect your daughter to go. That's alright, tho it might be helpful later on.
I empathize with you because I've had difficulties parenting. It's the most difficult of all "jobs."