I believe you have either of the below 2 ways to overcome the issue:
- If you connect to Azure using Az PowerShell cmdlet Connect-AzAccount then use Az PowerShell cmdlet Set-AzStorageAccount to enable and disable sftp.
- As per this update as Az CLI is now supported in Azure Automation PowerShell 7.2 runtime runbooks so if you want to use Az CLI command az storage account update to enable or disable sftp then before using it, connect to Azure using Az CLI command az login.
If you still face any issues while trying either of the ways, let me know.