Hi @MoTaar , you need to ensure that the managed identity of your automation account has the required permissions to access the SQL database resource.
You mentioned that you have already added user access to the automation account and to the SQL server. However, you also need to add the managed identity of your automation account to the SQL database with the required permissions. To add the managed identity of your automation account to the SQL database, you can follow these steps:
- Go to the Azure portal and navigate to your SQL database resource.
- Click on "Access control (IAM)" in the left-hand menu.
- Click on "Add" and select "Add role assignment".
- In the "Add role assignment" blade, select the role you want to assign to the managed identity of your automation account. For example, you can select "Reader" to grant read-only access to the SQL database.
- In the "Assign access to" section, select "Azure AD user, group, or service principal".
- In the "Select" field, search for the name of your automation account and select it.
- Click on "Save" to add the role assignment.
After adding the managed identity of your automation account to the SQL database with the required permissions, you should be able to access the SQL database resource from your automation account runbook without any issues. Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James