Unable to create cross-tenancy Virtual Network rule for VM access to Storage container

Adam Dawson 21 Reputation points
2022-01-31T10:15:43.397+00:00

I am following the instructions in https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security?tabs=azure-powershell#grant-access-from-a-virtual-network to allow a VM in my Tenancy access to a storage account in a client tenancy, using Powershell.

When ever I run the following command (in an Azure shell in the context of the client's Azure tenancy):

$subnet = Get-AzVirtualNetwork -ResourceGroupName "client-resource-group" -Name "client-vnet" | Get-AzVirtualNetworkSubnetConfig -Name "/subscriptions/my-subscription/resourceGroups/my-resource-group/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet"

I receive the following error:

Get-AzVirtualNetwork: The api-version '2021-05-01' is invalid. The supported versions are '2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,201
9-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-0
1,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.
StatusCode: 400
ReasonPhrase: Bad Request
ErrorCode: InvalidApiVersionParameter
ErrorMessage: The api-version '2021-05-01' is invalid. The supported versions are '2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.
OperationID : d17bece7-7043-4233-8949-3962048396c6

Is this likely to be a problem the API or with my syntax, what are the likely causes for this?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,164 questions
0 comments No comments
{count} votes

Accepted answer
  1. ChaitanyaNaykodi-MSFT 23,031 Reputation points Microsoft Employee
    2022-01-31T20:24:26.793+00:00

    Hello @Adam Dawson , Good to know that your issue is resolved now. I am just posting this answer for the benefit of the community, so that anyone facing similar issue can refer it.

    I could not reproduce the exact error received, but I did spot a syntax issue in the command Get-AzVirtualNetworkSubnetConfig the Name parameter should consists the subnet name only. I was able to run the below command successfully in Cloud Shell

    $subnet = Get-AzVirtualNetwork -ResourceGroupName "<RGName>" -Name "<VnetName>" | Get-AzVirtualNetworkSubnetConfig -Name <SubnetName>  
    

    170004-image.png

    Hope this helps. Please let me know if you have any additional questions. Thank you!


0 additional answers

Sort by: Most helpful