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:
Родитель
a19ca8a0d2
Коммит
dd86c48ab0
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Загрузка…
Ссылка в новой задаче