fix: ARM template schema that does not install LA workspace

ASIM parser installation ARM templates should only install the saved
search if the Log Analytics workspace already exists.

Relates: #8623
This commit is contained in:
Teemu Pätsi 2024-10-22 11:09:28 +03:00
Родитель a19ca8a0d2
Коммит dd86c48ab0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CCDC6A4494452CAC
2 изменённых файлов: 17 добавлений и 27 удалений

Просмотреть файл

@ -200,9 +200,9 @@ for f in files:
logging.debug ('Generating ARM template')
# generate the ARM template
armTemplate = copy.deepcopy(func_arm_template)
armTemplate['resources'][0]['resources'][0]['name'] = Alias
armTemplate['resources'][0]['resources'][0]['properties']['query'] = Query
armTemplate['resources'][0]['resources'][0]['properties']['category'] = Category
armTemplate['resources'][0]['name'] = f"[concat(parameters('Workspace'), '/{Alias}')]"
armTemplate['resources'][0]['properties']['query'] = Query
armTemplate['resources'][0]['properties']['category'] = Category
if params:
Parameters = ""
for param in params:
@ -220,9 +220,9 @@ for f in files:
if Parameters != "":
Parameters = f'{Parameters},'
Parameters = Parameters + ParamString
armTemplate['resources'][0]['resources'][0]['properties']['functionParameters'] = Parameters
armTemplate['resources'][0]['resources'][0]['properties']['FunctionAlias'] = Alias
armTemplate['resources'][0]['resources'][0]['properties']['displayName'] = Title
armTemplate['resources'][0]['properties']['functionParameters'] = Parameters
armTemplate['resources'][0]['properties']['FunctionAlias'] = Alias
armTemplate['resources'][0]['properties']['displayName'] = Title
logging.debug ('Writing ARM template')
# Write template

Просмотреть файл

@ -18,28 +18,18 @@
},
"resources": [
{
"type": "Microsoft.OperationalInsights/workspaces",
"apiVersion": "2017-03-15-preview",
"name": "[parameters('Workspace')]",
"type": "Microsoft.OperationalInsights/workspaces/savedSearches",
"apiVersion": "2020-08-01",
"name": "resourceName",
"location": "[parameters('WorkspaceRegion')]",
"resources": [
{
"type": "savedSearches",
"apiVersion": "2020-08-01",
"name": "functionAlias",
"dependsOn": [
"[concat('Microsoft.OperationalInsights/workspaces/', parameters('Workspace'))]"
],
"properties": {
"etag": "*",
"displayName": "displayName",
"category": "ASIM",
"FunctionAlias": "functionAlias",
"query": "parserQuery",
"version": 1
}
}
]
"properties": {
"etag": "*",
"displayName": "displayName",
"category": "ASIM",
"FunctionAlias": "functionAlias",
"query": "parserQuery",
"version": 1
}
}
]
}