Hi @Raj D ,
I see that you are trying to copy a blob from one container to another using Start-AzStorageBlobCopy cmdlet. I modified the script shared in question a bit and was able to run it successfully. Refer to the steps below for more details.
1. Ensure that the Azure Automation's managed identity has Storage Blob Data Contributor assigned on the storage account. On storage account, under "Access Control (IAM)" it should look like below:
2. I modified the try{} catch{}
block - mainly to wait until the operation succeeds/fails -
3. Notice the $_.Exception.Message
and $_.ScriptStackTrace
in catch{}
-- these have been added so that the line number can also be obtained where the error occurred. In error shared in question, the source of error was unclear.
Hope this helps. Please let me know if you have any questions.
---
Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.