-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsumptionToAppService.ps1
27 lines (22 loc) · 1.1 KB
/
ConsumptionToAppService.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Param(
[string] $AppService_RG = '<app-service-rg>',
[string] $AppService_Name = '<app-service-name>',
[string] $LogicApp_RG = '<logic-app-rg>',
[string] $LogicApp_Name = '<logic-app-name>',
[string] $subscriptionId = '<subscription-id>'
)
Login-AzureRmAccount
$subscription = Get-AzureRmSubscription -SubscriptionId $subscriptionId
$appserviceplan = Get-AzureRmResource -ResourceType "Microsoft.Web/serverFarms" -ResourceGroupName $AppService_RG -ResourceName $AppService_Name
$logicapp = Get-AzureRmResource -ResourceType "Microsoft.Logic/workflows" -ResourceGroupName $LogicApp_RG -ResourceName $LogicApp_Name
$sku = @{
"name" = $appservicePlan.Sku.tier;
"plan" = @{
"id" = $appserviceplan.ResourceId;
"type" = "Microsoft.Web/ServerFarms";
"name" = $appserviceplan.Name
}
}
$updatedProperties = $logicapp.Properties | Add-Member @{sku = $sku;} -PassThru
$updatedLA = Set-AzureRmResource -ResourceId $logicapp.ResourceId -Properties $updatedProperties -ApiVersion 2015-08-01-preview
Write-Output "Logic App now associated with App Service Plan: $appserviceplan.Name"