Skip to content

Instantly share code, notes, and snippets.

Avatar

Prashant Pratap pratapprashant

View GitHub Profile
View AzureWebsite_ASP.ps1
write-host "trying to load azure dlls"
Import-module azure
write-host "trying to log into Azure"
#Select-AzureSubscription -Default "Microsoft Azure Internal Consumption"
#Add-AzureAccount
#Login-AzureRmAccount
write-host "trying to get website details"
# Get-AzureRMResource -ResourceType "microsoft.web/sites" -ResourceGroupName $ResourceGroupName -ResourceName $WebsiteName
View AzureWebsite_Create.ps1
$resourceGroupName = "pscmdletResourceGroup"
$appServicePlanName = "pscmdletServicePlan"
$newWebsiteName = "pscmdletWebsite"
$location = "West US"
$error.clear()
write-host "trying to load azure dlls"
@pratapprashant
pratapprashant / Program.cs
Created Sep 23, 2016
Azure Stream Analytics Code
View Program.cs
using Microsoft.ServiceBus.Messaging;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SendingEvents2EventHub
@pratapprashant
pratapprashant / AzureFunctionApp.ps1
Created Oct 15, 2017
Calling AI APIs from Azure FunctionApp (PowerShell)
View AzureFunctionApp.ps1
# POST method: $req
$requestBody = Get-Content $req -Raw | ConvertFrom-Json
$name = $requestBody.name
$instrumentationKey = "<ai key>"
$aiClient = New-Object "Microsoft.ApplicationInsights.TelemetryClient"
$aiClient.InstrumentationKey = $instrumentationKey
$aiClient.TrackPageView("my pageview")
#$aiClient.TrackEvent("my event")