Can you give this a shot? Not sure if you've a hard requirement of using SDK.
workspace_url = spark.conf.get('spark.databricks.workspaceUrl')
Getting name is more tricky. You could potentially get it from tags if there is a tagging strategy in place.