Lec-169 Azure in Hindi - Azure Function App - Lab 1 Azure Function Timer Trigger

Published: 17 March 2021
on channel: azurepedia
6,404
129

Lec-169 Azure in Hindi - Azure Function App - Lab Azure Function

This video series about the latest azure videos containing course az 103, az 104, az 303, az 304 and all Azure related.
This video is step by step tutorial on complete azure.

#azureinhindi #learnazure #azurestepbystep #azuretutorials #azurefundamentals #sandeepsinghrawat #az104 #az303 #az304 #az900

----------------------------------------------------------------------------------------------------------------------------
$TenantID = "put your tenant ID"
$ApplicationID = "put your app ID"
$ApplicationSecret = "put your app ID secret"

$SecurePassword = ConvertTo-SecureString "$ApplicationSecret" -AsPlainText -Force
$AzureCredentials = New-Object System.Management.Automation.PSCredential ("$ApplicationID", $SecurePassword)

Connect-AzAccount -ServicePrincipal -Tenant $TenantID -Credential $AzureCredentials -Force


[int]$month = Get-Date -Format MM
$year = Get-Date -Format yyyy
$startdate = "$year-$month-01"
$enddate = Get-Date -Format yyyy-MM-dd

Remove-Item -Path "D:\home\site\wwwroot\temp\azurecost\AzureCost-ResourceGroup-Wise.csv" -ErrorAction SilentlyContinue -Force -Verbose

$outpath = "D:\home\site\wwwroot\temp\azurecost\AzureCost-ResourceGroup-Wise.csv"



$monthname = switch($month){
01 {"Jan"}
02 {"Feb"}
03 {"Mar"}
04 {"Apr"}
05 {"May"}
06 {"Jun"}
07 {"Jul"}
08 {"Aug"}
09 {"Sep"}
10 {"Oct"}
11 {"Nov"}
12 {"Dec"}
}

$subsctiptionlist = Get-AzSubscription

"ResourceGroupName,UsageMonth,SubscriptionName,Cost,Location" | Out-File -FilePath $outpath -Encoding utf8


$subsctiptionlist | foreach {

$subscription = $_.Name
$tenantid = $_.TenantId


$subselect = Select-AzSubscription -Subscription $subscription -Tenant $tenantid

$pretaxcost = $null

$pretaxcost = Get-AzConsumptionUsageDetail -StartDate $startdate -EndDate $enddate

$rglist = Get-AzResourceGroup

$rglist | foreach {

$rgname = $_.ResourceGroupName
$rglocation = $_.Location


$rgcostinfo = $pretaxcost | where {$_.InstanceId -like "*$rgname*"}



$costvalue = 0

$rgcostinfo | foreach {


$precostvalue = $null
$precostvalue = $_.PretaxCost

$costvalue = $costvalue + $precostvalue

}

$cost = $null

$cost = [math]::Round($costvalue,3)

"$rgname,$monthname,$subscription,$cost,$rglocation"


"$rgname,$monthname,$subscription,$cost,$rglocation" | Out-File -FilePath $outpath -Append -Encoding utf8

}
}


Watch video Lec-169 Azure in Hindi - Azure Function App - Lab 1 Azure Function Timer Trigger online, duration hours minute second in high quality that is uploaded to the channel azurepedia 17 March 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 6,404 times and liked it 129 visitors.