Description
openedon Jan 26, 2019
Cmdlet(s)
Add-AzureRmServiceFabricNodeType
PowerShell Version
5.1.17763.134
Module Version
AzureRM 6.12.0
OS Version
10.0.17763.253
Description
When attempting to add new node type to an existing cluster that has VMSS that uses existing VNet from other resource group that's different than resource group of the cluster, the command failed with error:
Add-AzureRmServiceFabricNodeType : The Resource 'Microsoft.Network/virtualNetworks/VNETX' under resource group 'RG01' was not found.
At line:1 char:1
+ Add-AzureRmServiceFabricNodeType -ResourceGroupName 'RG01 ...
+ CategoryInfo : CloseError: (:) [Add-AzureRmServiceFabricNodeType], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ServiceFabric.Commands.AddAzureRmServiceFabricNodeType
Cluster is healthy and was deployed based on this doc to use existing vnet from different resource group:
https://blogs.msdn.microsoft.com/kwill/2016/10/05/azure-service-fabric-common-networking-scenarios/#ExistingVnet
Perhaps using fully qualified resource id (https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#resourceid ) from within the code (https://github.com/Azure/azure-powershell/blob/master/src/ServiceFabric/ServiceFabric/Commands/AddAzureRmServiceFabricNodeType.cs ) may fix this problem? Or add new parameter to allow user to specify different resource group for certain resource (in this case, it's virtual network that's in different resource group than the cluster).
Please note that I'm submitting this issue on behalf of our customer. This seems to be a supported scenario and can be mitigated via ARM template update, however until this issue is fixed, user can't use this cmdlet for this scenario.
Script/Steps for Reproduction
Have an existing cluster with all resources in resource group RG01 except for the virtual network resource is in resource group RG02 (all under the same subscription).
Than run command:
$pwd = ConvertTo-SecureString -String 'password' -AsPlainText -Force
Add-AzureRmServiceFabricNodeType -ResourceGroupName 'RG01' -Name 'Cluster' -NodeType 'NT02' -Capacity 3 -VmUserName 'clusteradmin' -VmPassword $pwd