Context: Want to find the total number of connection has been made to Azure Service Plan, under which my application is running. Want to automate it, is there any way ?
So far I have wrote code to connect to the azure with the following code,
function connectionMenthod($AzureUserName,$AzureP,$AzureTenantID,$AzureSubscriptionID) {
$username = $AzureUserName;
$password = ConvertTo-SecureString $AzureP -AsPlainText -Force;
$creds = New-Object System.Management.Automation.PSCredential -ArgumentList ($username, $password);
Connect-AzAccount -Credential $creds -Tenant $AzureTenantID
}
function upgradeNFREnvironment () {
$AzureTenantID = "<Azure_tenant_id>"
$AzureSubscriptionID = "<Azure_Subscription_Id>"
$AzureUserName = "<User_Name>"
$AzureP = "<Password>"
connectionMenthod $AzureUserName $AzureP $AzureTenantID $AzureSubscriptionID
}
upgradeNFREnvironment