This article is contributed. See the original author and article here.

AzureRM PowerShell modules would be retired on 29 February 2024, Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules.   

This blog shows AZ module setup and common commands to manage your Azure Service Fabric. 


Table of Contents 

  • Az module setup: 

    • Check if you have AzureRM module 

    • Install AZ module and remove AzureRM module 

  • Common commands 

    • Login to your Azure account   

    • Get service fabric cluster status

    • Add nodes to a cluster 

    • Add nodeType to cluster 

    • Update cluster durability 

    • Update the cluster reliability 


  1. The following cmdlets of {Get-Az*} only support ARM deployed resources: 

  • Get-AzServiceFabricApplication 

  • Get-AzServiceFabricService 

  • Get-AzServiceFabricApplicationTypeVersion 

  • Get-AzServiceFabricApplicationType 

  1.  Add cluster certificate is not supported, suggest to use ARM instead. 



Az module setup: 

This section will cover how to setup the AZ module in your environment. 

You can skip this part, If you have already setup a local environment for with the AZ module. 


Step 1: check if you have AzureRM module.  

Iyou do have the AzureRM installed, you will need to remove AzureRM module first 

Document Link 


Run code:  



if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM -ListAvailable)) { 

    Write-Warning -Message ('Az module not installed. Having both the AzureRM and ' + 

      'Az modules installed at the same time is not supported.') 

} else { 

    Install-Module -Name Az -AllowClobber -Scope CurrentUser 






Step2: install AZ module and remove AzureRM module 

Uninstall AzureRM module: 


First run code:  



Install-Module -Name Az -AllowClobber -Scope CurrentUser 





Then run code as an admin: 








Common commands 


  • Login to your Azure account 

To login, you will need to run the following command:








After sign in, you will be able to see the subscriptions you can work with: 



 (Optional) If you want to change a subscription to work with, run the following codes: 

Run code: 



$context = Get-AzSubscription -SubscriptionId ... 
Set-AzContext $context 





Use the Get-AzServiceFabricCluster command to get the information for a specific SF cluster. 

Run code: 



Get-AzServiceFabricCluster -ResourceGroupName 'haileyservicefabrictest' -ClusterName 'haileysftest' 





You can run the following code to add nodes to your specific cluster



Add-AzureRmServiceFabricNode  -ResourceGroupName 'haileyservicefabrictest' -ClusterName 'haileysftest'  -NodeType 'Type456' -Number 2 




Run codes: 



Add-AzServiceFabricNodeType -ResourceGroupName $resourceGroupName -ClusterName $clusterName  -NodeType $nodeType  -Capacity $capacity  -VmUserName  $vmUsername -VmPassword $pwd 






Using the following command to update the durability tier or VmSku of a node type in the cluster. 



Update-AzServiceFabricDurability -ResourceGroupName 'haileyservicefabrictest' -Name 'haileysftest' -DurabilityLevel Silver -NodeType 'mynodetype’ 





Use the following command to update the reliability tier of the primary node type in a cluster. 



Update-AzServiceFabricReliability -ResourceGroupName 'haileyservicefabrictest' -Name 'haileysftest' -ReliabilityLevel Silver 





Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.

%d bloggers like this: