I am trying to export/import tables using bcp, I am able to do it one by one as the documentation says using Azure Active Directory Interactive (I require Multifactor authentication to access the DB), by this method, it prompts an external window to set my credentials, so I should do this action for all the "IN" and "OUT" for all the tables (more than 20 and can increase in the future). Is there any way to avoid re-enter my credentials and execute export and import in one shot?
Example of BCP script:
bcp bcptest out "c:\last\data1.dat" -c -t -S aadserver.database.windows.net -d testdb -G -U alice@aadtest.onmicrosoft.com
Note: I know that script can be created by query, but again, my issue is to re-enter credentials for each file.
select 'bcp dbo.' + st.name + ' out c:\' + st.name + '.dat -c -t -S ' + 'aadserver.database.windows.net -d ' + DB_NAME() + ' -G -U alice@aadtest.onmicrosoft.com' from sys.tables st
select 'bcp dbo.' + st.name + ' in c:\' + st.name + '.dat -c -t -S ' + 'aadserver.database.windows.net -d ' + 'newdb' + ' -G -U v-alice@aadtest.onmicrosoft.com' from sys.tables st