Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Scripts/110-create-resource-group.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Minimal requirement: Powershell version 3.3

# If you run into problems:
# 1. Run this command to check your Powershell version
# (Get-Module -ListAvailable | Where-Object{ $_.Name -eq 'Azure' }) | Select Version, Name, Author, PowerShellVersion� | Format-List;
# 2. Use Windows Web Installer to update Azure for Powershell: https://www.microsoft.com/web/downloads/platform.aspx

$ErrorActionPreference = "Stop"
$scriptDir=($PSScriptRoot, '.' -ne "")[0]
. "$scriptDir\Include\common.ps1"
Expand Down
3 changes: 2 additions & 1 deletion Scripts/120-create-storage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ $scriptDir=($PSScriptRoot, '.' -ne "")[0]
. "$scriptDir\Include\common.ps1"

#region - create storage account (for ADF U-SQL script, as well as ML data)
if (-Not(Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -ErrorAction SilentlyContinue)) {
if (-Not(Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -ErrorAction SilentlyContinue)) {
Write-Host "Creating the storage and containers..." -ForegroundColor Green
New-AzureRmStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName -Location $location -SkuName Standard_LRS
New-AzureStorageContainer -Context (getStorageContext) -Name adf-resources
New-AzureStorageContainer -Context (getStorageContext) -Name interaction-data
Expand Down
10 changes: 8 additions & 2 deletions Scripts/150-create-function.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ $scriptDir=($PSScriptRoot, '.' -ne "")[0]

Write-Host "Create a Function App..." -ForegroundColor Green

#Comments: the link did not work for me. Maybe add more precise instructions how to navigate on the Portal.
# Should I create a seperate Storage for Function App or can I use the one that is already created?

Write-Host -ForegroundColor Magenta "Perform this manual configuration"
Write-Host -ForegroundColor Magenta "`nNavigate to:"
$sub=(Get-AzureRmContext).Subscription.SubscriptionId
Write-Host -ForegroundColor Magenta "https://portal.azure.com/#blade/WebsitesExtension/FunctionsIFrameBlade/id/%2Fsubscriptions%2F$sub%2FresourceGroups%2F$resourceGroupName%2Fproviders%2FMicrosoft.Web%2Fsites%2F$functionAppName"
Write-Host -ForegroundColor Magenta "`nCreate new resource of type Function App, name '$functionAppName'. When Function App is created, navigate to it."
Write-Host -ForegroundColor Magenta "`nClick New Function -> GenericWebHook-CSharp -> Name your function '$functionName'. Paste following code: "
Write-Host -ForegroundColor Magenta "`nOn the welcome screen click New Function -> Select WebHook+Api -> Select CSharp. Then Select New Function -> Choose GenericWebHook-Csharp template -> Name your function '$functionName'. Paste following code: "
Write-Host -ForegroundColor Cyan (Get-Content -Path ..\Resources\PostToEventHubFunction\run.csx -Raw)

#Doesn't work correctly
Expand Down Expand Up @@ -52,13 +55,16 @@ $props = @{

New-AzureRmResource -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Web/sites/functions -ResourceName $functionAppName/$functionName -PropertyObject $props -ApiVersion 2015-08-01 -Force

}

# These commands were not executed because they are part of the function that is not called. I moved them outside. ###
$sub=(Get-AzureRmContext).Subscription.SubscriptionId
$eventHubSendPolicyKey=(Get-AzureRmEventHubNamespaceKey -ResourceGroupName $resourceGroupName -NamespaceName $eventHubNamespace -AuthorizationRuleName $eventHubSendPolicyName).PrimaryConnectionString
Write-Host -ForegroundColor Magenta "Perform this manual configuration"
Write-Host -ForegroundColor Magenta "`nNavigate to:"
Write-Host -ForegroundColor Magenta "https://portal.azure.com/#blade/WebsitesExtension/FunctionsIFrameBlade/id/%2Fsubscriptions%2F$sub%2FresourceGroups%2F$resourceGroupName%2Fproviders%2FMicrosoft.Web%2Fsites%2F$functionAppName"
Write-Host -ForegroundColor Magenta "`nClick PostToEventHub -> Integrate -> Configure event hub:"
}


Write-Host -ForegroundColor Magenta "`nEvent hub name:"
Write-Host -ForegroundColor Cyan $eventHubName
Expand Down