Ensure that Azure Automation accounts have managed identity enabled.
Enabling managed identities eliminate the need for developers having to manage credentials by providing an identity for the Azure resource in Azure AD and using it to obtain Azure Active Directory (Azure AD) tokens.
Modify automation account and enable managed identity.