Custom script extension fails when getting script from Storage account
Hi,
i'm trying to run following command from Azure runbook, cloud shell and laptop but it keeps failing with this kinda error:
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?