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
Notes:
- The following cmdlets of {Get-Az*} only support ARM deployed resources:
- Get-AzServiceFabricApplication
- Get-AzServiceFabricService
- Get-AzServiceFabricApplicationTypeVersion
- Get-AzServiceFabricApplicationType
- 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.
If you do have the AzureRM installed, you will need to remove AzureRM module first.
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: https://docs.microsoft.com/en-us/powershell/azure/uninstall-az-ps?view=azps-5.6.0#option-2-uninstall-the-azurerm-powershell-module-from-powershellget
First run code:
Install-Module -Name Az -AllowClobber -Scope CurrentUser
Then run code as an admin:
Uninstall-AzureRm
Common commands
- Login to your Azure account
To login, you will need to run the following command:
Connect-AzAccount
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
Updated Mar 29, 2021
Version 1.0hailey_ding
Microsoft
Joined September 02, 2020
Azure PaaS Blog
Follow this blog board to get notified when there's new activity