I am working on a PowerShell code that is expected to upload a JSON file to my azure Blob Storage. My PowerShell code is saved in my local drive/folder and I am running that azue PowerShell CLI. My PowerShell is falling on this command.
Set-AzStorageBlobContent -Container $containers -File "./test.json" -Context $ctx.
tried all like below Set-AzStorageBlobContent -Container $containers -File "C:/folder/test.json" -Context $ctx or Set-AzStorageBlobContent -Container $containers -File "test.json" -Context $ctx
All are falling with the below error:
Set-AzStorageBlobContent : Can not find the specified file 'C:\folder\ManJason.json'. At C:\folder\BlobUpload.ps1:23 char:5
-
Set-AzStorageBlobContent -Container $containers -File "./ManJason ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidArgument: (:) [Set-AzStorageBlobContent], ArgumentException
- FullyQualifiedErrorId : ArgumentException,Microsoft.WindowsAzure.Commands.Storage.Blob.SetAzureBlobContentComman d
My Environment :
{ "azure-cli": "2.17.1", "azure-cli-core": "2.17.1", "azure-cli-telemetry": "1.0.6", "extensions": {} }