Custom script extension fails when getting script from Storage account

Bombbe 1,611 Reputation points
2020-08-06T16:33:05.2+00:00

Hi,
i'm trying to run following command from Azure runbook, cloud shell and laptop but it keeps failing with this kinda error:

16201-errori.png

Powershell code:

Set-AzVMCustomScriptExtension -ResourceGroupName "rg-name" `  
            -Location "West Europe" `  
            -VMName "vmanme" `  
            -Name "CustomScriptExtension" `  
            -TypeHandlerVersion "1.1" `  
            -StorageAccountName "storageaccountname" `  
            -StorageAccountKey aaaaaaaaaaaaaaaaaaaaaaaaaaaaa `  
            -ContainerName "script" `  
            -FileName "filename.ps1" `  
            -Run "filename.ps1"  

My storage account has "Allow access" from "Select networks" and allowed my ip adderess in "Firewalls and virtual networks" . Container are "Private" and changing access level did not solve problem. Even tho i'm not able to run Set-AzVMCustomScriptExtension command I'm allowed to download content with invoke-webrequest. If I "Allow access" from "All networks" it works but that is not solution right now.

Tips how can run Set-AzVMCustomScriptExtension from storage account (or some where else) with allowing access to everyone to that storage account? Or any suggestions what could I check to solve problem?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,119 questions
{count} votes