Skip to content
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

Unable to update VMSS of CSP subscription - "is not authorized to access linked subscription" #72

Open
SenorRagequit opened this issue Jun 27, 2021 · 1 comment

Comments

@SenorRagequit
Copy link

SenorRagequit commented Jun 27, 2021

I'm currently trying to update my VMSS boot diagnostics with powershell, but it fails every time.

Code:

Set-AzContext -Subscription "Name of CSP Subscription"
$GETstorageaccount001 = Get-AzStorageAccount -Name "Name of storage account"  -ResourceGroupName "Name of resource group"
$storageaccount001uri = $GETstorageaccount001.Id

$GETvmss = get-azvmss -ResourceGroupName "Name of resource group"

Foreach ($scaleset in $GETvmss)
{
    Update-AzVmss -ResourceGroupName "Name of resource group" -VirtualMachineScaleSet $scaleset -VMScaleSetName $scaleset.Name -BootDiagnosticsEnabled $true -BootDiagnosticsStorageUri $storageaccount001uri
}

The error:

Update-AzVmss : The client has permission to perform action 'Microsoft.Compute/galleries/images/versions/read' on scope 
'/subscriptions/XXXXX-XXXXXXX-XXXXXXX/resourceGroups/YYYYYY-YYYYYY-YYYYYY/providers/Microsoft.Compute/virtualMachineScaleSets/ZZZZZ-ZZZZZZ-ZZZZZ', however the 
current tenant 'XYZXYZXYZ-XZXYZXYZ' is not authorized to access linked subscription '109a5e88-712a-48ae-9078-9ca8b3c81345'.
ErrorCode: LinkedAuthorizationFailed
ErrorMessage: The client has permission to perform action 'Microsoft.Compute/galleries/images/versions/read' on scope 
'/subscriptions/XXXXX-XXXXXXX-XXXXXXX/resourceGroups/YYYYYY-YYYYYY-YYYYYY/providers/Microsoft.Compute/virtualMachineScaleSets/ZZZZZ-ZZZZZZ-ZZZZ', however the 
current tenant 'XYZXYZXYZ-XZXYZXYZ' is not authorized to access linked subscription '109a5e88-712a-48ae-9078-9ca8b3c81345'.
ErrorTarget: 
StatusCode: 403
ReasonPhrase: Forbidden
OperationID : efb6f89d-a844-4d14-b184-30cde962dfdf

I don't even know where the linked subscription of 109a5e88-712a-48ae-9078-9ca8b3c81345 is coming from, that ain't mine.
This person: Azure/AKS#2040 had the same error, even same linked subscription. But it got closed.

For the permissions: I am owner of the CSP subscription.

@biakewe
Copy link

biakewe commented May 19, 2023

Did you solve it? I'm also facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants