Thank you for your post and I apologize for the delayed response!
I understand that you're trying to create a Service Principal to upload files to an Azure Storage Account from on-prem using azcopy and would like to know if it's required for the Service Principal to belong to the same Subscription as the Storage Account. To hopefully help point you in the right direction or resolve your issue, I'll share my findings below.
Findings:
Yes - when it comes to your Service Principal needing to belong to the same Subscription as the Storage Account, this is needed because the service principal needs to have the necessary permissions to access your storage account. If the service principal were to belong to a different subscription, it won't have the required permissions to access your storage account.
For more info:
- Create an Azure Active Directory application and service principal that can access resources
- Get started with AzCopy - Authorize a service principal
Additional Links:
- Authorize access to blobs with AzCopy and Azure Active Directory (Azure AD)
- Service principal object
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.