I have been following this guide:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-identity-access-azure-sql-with-managed-identity
and have reached the step "Grant SQL database access to the managed identity". I have downloaded sqlcmd and executed the following command: sqlcmd -S myserver.database.windows.net -d my-azure-db -G -U ******@domain.no (with correct values, not the ones you see here).
However, I get the following error:
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Failed to authenticate the user '******@domain.no' in Active Directory (Authentication option is 'ActiveDirectoryPassword').
Error code 0xA190; state 41360
AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '022907d3-0f1b-48f7-badc-1ba6abab6d66'. Trace ID: a9939218-6784-4fa8-a211-bf0890356200 Correlation ID: b0a2d9b9-b1a8-46aa-8470-4c8449545920 Timestamp: 2024-04-27 14:12:59Z.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Error requesting access token, HTTP status 400, expected 200.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : TCP Provider: Timeout error [258]. .
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Unable to complete login process due to delay in login response.
When I check out the multi-factor authentication setup for our users at: Microsoft 365 Admin
I see that MFA is not enabled for any of our users. When I check Authentication methods under Microsoft Entra in Azure, it says Microsoft Authenticator is not enabled and neither is SMS.
How come I still get the error above? Is there any other configuration I may have missed or some other error related to sqlcmd?