@Harsha Jha I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue: Customer is trying to download the logic app workflow using script and by using deployment publishing profile credentials. the value of username and password is showing as redacted.
Solution: Instead of using the publishing profile credentials, customer has shifted to access token to authenticate and download the workflows as zip file.
Adding to the above you leverage the PowerShell script mentioned in this blog post here to download the content of site/wwwroot
folder using the kudu rest api.
Note: The above script present in the blog post uses the service principal-based authentication rather than the publishing profile credentials or the access token.
Hope this helps !
Please accept as Yes if the answer is helpful so that it can help others in the community