New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grant-azurermsnapshotaccess returning null accesssas #5956
Comments
@hyonholee @huangpf Can you take a look at this issue? |
Is there any update? |
I have same problem,Is there any update? |
@hyonholee @huangpf Is there any update on this issue? |
There is an issue with the Swagger spec and client library. We will fix it soon. Thanks. |
Similar problem with Grant-AzureRmDiskAccess |
This just started happening for me. Is there a workaround? $osSAS = Grant-AzureRmSnapshotAccess -ResourceGroupName $snapshotResourceGroupName -SnapshotName $osSnapshotName -DurationInSecond $sasExpiryDuration -Access Read I get a null AccessSAS result. |
I was getting this recently as well.
None of my team was able to get it to work either.
Timothy Shegrud
Support Engineer
Cloud & Infrastructure Solutions
Customer Services & Support | Microsoft Corporation
(425) 706-4408; * v-tisheg@microsoft.com<mailto:v-tisheg@microsoft.com> | Hours: Sun - Thur, 8:00am-5:00pm PST
Need help outside of my working hours for a technical issue?
*: AzBackup@microsoft.com<mailto:AzBackup@microsoft.com>
Meeting and exceeding your expectations are my top priorities. We are interested in any feedback you might have about the service you received on this incident. Please let my Manager, Martin Rosales know what you think of the level of service provided, by contacting him via email at v-rosmar@microsoft.com<mailto:v-rosmar@microsoft.com>.
[cid:image001.png@01D2DECD.52D68C60] [cid:image002.jpg@01D2DECD.52D68C60]
From: J.F. Larente [mailto:notifications@github.com]
Sent: Monday, May 14, 2018 9:39 AM
To: Azure/azure-powershell <azure-powershell@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [Azure/azure-powershell] grant-azurermsnapshotaccess returning null accesssas (#5956)
This just started happening for me. Is there a workaround?
$osSAS = Grant-AzureRmSnapshotAccess -ResourceGroupName $snapshotResourceGroupName -SnapshotName $osSnapshotName -DurationInSecond $sasExpiryDuration -Access Read
I get a null AccessSAS result.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F5956%23issuecomment-388881933&data=02%7C01%7Cv-tisheg%40microsoft.com%7C97916228d64840f04b3508d5b9b9322f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636619127420917418&sdata=H3TR%2FK%2Fmb%2BdZ%2FRzUTjuFTVgPVlcovRXeT%2BibCuJBjfA%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAjuECf_VHNBbgMMJlgAl8svqCwLERis0ks5tybMjgaJpZM4TU1Fu&data=02%7C01%7Cv-tisheg%40microsoft.com%7C97916228d64840f04b3508d5b9b9322f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636619127420927431&sdata=y0Q15I3gdumbtt%2BEQTHPJGt9%2B5Laay6ygonl8S7yWGc%3D&reserved=0>.
|
You can call az cli from within powershell to get the sas https://docs.microsoft.com/en-us/cli/azure/snapshot I tested this but didn’t work thron ugh the whole syntax |
@hyonholee Is there a known workaround for the issue? |
Thanks for the workaround @ikiris04, I (temporarily) changed my script to: |
Same issue here, any workaround? |
same issue |
We expect the fix would be included in the next Powershell release (6/15). Thanks. |
In the meantime a workaround that doesn't require Azure CLI is to set $DebugPreference = 'Continue' before calling Grant-AzureRmSnapshotAccess, redirect the Grant-AzureRmSnapshotAccess output by adding 5>&1 at the end of the line, then parse out the accessSAS value. $DebugPreference = 'Continue'
$result = Grant-AzureRmSnapshotAccess -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName -Access 'Read' -DurationInSecond 3600 5>&1
$DebugPreference = 'SilentlyContinue'
$sasUri = ((($result | where {$_ -match "accessSAS"})[-1].ToString().Split("`n") | where {$_ -match "accessSAS"}).Split(' ') | where {$_ -match "https"}).Replace('"','') |
Hi everyone, |
Hi everyone,
But, I've this problem with OS-disks, 'cos DataDisks is easy for get.
Can it help me? |
Would love if this was fixed we have azure automation runbooks that depend on this working, that just have stopped working altogether because of this. The above adding the $result does work, thanks for the workaround @craiglandis |
just hit this / eta ? |
Have you tried the latest module? I installed on a new laptop last week and didn’t have any problems |
Upgrading the
After this, I was able to use |
Closing as fixed - if anyone is still hitting this issue in the latest version, please let me know and I will reopen the issue. |
I updated the AzureRM* modules to the latest and able to access the SAS URL using
Thanks everyone who helped with the interim workaround and the final fix. |
Just got this issue as well. Versions:
Output:
accessSAS is null. |
Had a colleague update to 6.5.0 and try and could access accessSAS value. I rolled my version back to 6.5.0 and still had a null value for accessSAS value. Anyone have any thoughts? |
I've been using 6.6 with no issues.
|
@andsmit9 this might be an issue with multiple modules installed and potentially an older one getting loaded maybe? Hopefully the below link helps |
Thanks for the feedback. I made sure just now to uninstall the AzureRM over and over until there were no modules installed before installing 6.5.0:
Unfortunately, the result is the same for me: Null value for accessSAS. Seems to just be my setup but not sure what is causing the conflict. I think we can ignore my issues as no one else seems to have it. |
@andsmit9 not sure where 6.5 came from, I did mention 6.6 in my post :) Give it a shot with 6.6 or greater, I'm hoping that helps. |
Same result on 6.6. |
Description
grant-azurermsnapshotaccess returns an object with accesssas equal to null in azurerm.compute 4.0.0 and up (including 4.6.0). Last version that works correctly is 3.4.1
Debug shows that http response contains accesssas but the cmdlet is not returning it
Script/Steps for Reproduction
#create storage snapshot
$debugpreference = 'Continue'
$returnsas=Grant-AzureRmSnapshotAccess -ResourceGroupName rgimagebuild -SnapshotName rhel7-snapshot -access read -DurationInSecond 7200
#returnsas.accesssas is null
Module Version
PS C:> Get-Module -Name azurerm -ListAvailable
ModuleType Version Name ExportedCommands
Script 5.7.0 AzureRM
Script 5.4.1 AzureRM
Script 5.1.1 AzureRM
Script 4.3.1 AzureRM
Script 4.2.0 AzureRM
PS C:> Get-Module -Name azurerm.compute -ListAvailable
ModuleType Version Name ExportedCommands
Script 4.6.0 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Script 4.3.2 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Script 4.1.1 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Script 4.0.0 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Script 3.4.1 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Script 3.3.1 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Script 3.2.0 AzureRM.Compute {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet...
Environment Data
PS C:> $psversiontable
Name Value
PSVersion 5.1.15063.966
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.966
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Debug Output
The text was updated successfully, but these errors were encountered: