-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Josh Brown
committed
Jan 29, 2025
1 parent
84659cd
commit f2f4364
Showing
4 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { SearchPlugIn } from './plugin' | ||
import { SearchUtils } from './functions' | ||
|
||
exports.plugin = null | ||
exports.pluginNS = null | ||
exports.plugin = SearchPlugIn | ||
exports.pluginNS = "@azbake/ingredient-search" | ||
|
||
exports.functions = SearchUtils | ||
exports.functionsNS = "search" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
import { BaseIngredient, IngredientManager } from "@azbake/core" | ||
import { ARMHelper } from "@azbake/arm-helper" | ||
import ARMTemplate from "./search.json" | ||
|
||
const path = require("path") | ||
|
||
export class SearchPlugIn extends BaseIngredient { | ||
|
||
private resourceGroup: string = "" | ||
|
||
public async Execute(): Promise<void> { | ||
try { | ||
let util = IngredientManager.getIngredientFunction("coreutils", this._ctx) | ||
this._logger.log("Search ingredient logging"); | ||
|
||
const helper = new ARMHelper(this._ctx); | ||
|
||
let params = await helper.BakeParamsToARMParamsAsync(this._name, this._ingredient.properties.parameters) | ||
|
||
// define resource group | ||
let rgOverrideParam = this._ingredient.properties.parameters.get('rgOverride') | ||
if (rgOverrideParam) { | ||
this.resourceGroup = await rgOverrideParam.valueAsync(this._ctx) | ||
// remove rgOverride if it exists since its not in the ARM template | ||
delete params["rgOverride"] | ||
} | ||
else { | ||
this.resourceGroup = await util.resource_group(); | ||
} | ||
|
||
await helper.DeployTemplate(this._name, ARMTemplate, params, this.resourceGroup) | ||
|
||
} catch(error){ | ||
this._logger.error('deployment failed: ' + error) | ||
throw error | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]", | ||
"metadata": { | ||
"description": "Location for all resources." | ||
} | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"sku": { | ||
"type": "string", | ||
"defaultValue": "basic" | ||
} | ||
}, | ||
"variables": {}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Search/searchServices", | ||
"apiVersion": "2024-06-01-preview", | ||
"name": "[parameters('name')]", | ||
"location": "[parameters('location')]", | ||
"sku": { | ||
"name": "[parameters('sku')]" | ||
}, | ||
"identity": { | ||
"type": "SystemAssigned" | ||
}, | ||
"properties": { | ||
"replicaCount": 1, | ||
"partitionCount": 1, | ||
"hostingMode": "default", | ||
"publicNetworkAccess": "Enabled", | ||
"networkRuleSet": { | ||
"ipRules": [], | ||
"bypass": "None" | ||
}, | ||
"encryptionWithCmk": { | ||
"enforcement": "Unspecified" | ||
}, | ||
"disableLocalAuth": false, | ||
"authOptions": { | ||
"apiKeyOnly": {} | ||
}, | ||
"disabledDataExfiltrationOptions": [], | ||
"semanticSearch": "free" | ||
} | ||
} | ||
] | ||
} |