To create a SAS Token was the aim and required as a precondition setting desired storage as current storage:
Running the following command
Set-AzureRmCurrentStorageAccount -ResourceGroupName $StorResourceGroupName -Name $StorageAccountName
throws error:
Set-AzureRmCurrentStorageAccount : The Resource 'Microsoft.Storage/storageAccounts/yoursites' under resource group 'Default-Storage-EastUS' was not found. At line:1 char:1 + Set-AzureRmCurrentStorageAccount -ResourceGroupName $StorResourceGroupName -Name ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Set-AzureRmCurrentStorageAccount], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.SetAzureRmCurrentStorageAccount
And this was throwing error for New-AzureStorageBlobSASToken -Container $StorageContainer -Blob $blobname -Permission r -ExpiryTime (Get-Date).AddHours(2.0) -FullUri
How to byepass this issue?