@Michał Jełowicki looks like you haven't shared the complete template, and you have couple other dependencies like data factory etc.,.
I would suggest you retry the deployment by making the below changes and let us know you if are still facing the issues.
- Remove the resource block
Microsoft.Web/sites/host@2022-09-01
which is used to list the function app keys. - Pass this
listkeys('${resourceId('Microsoft.Web/sites', functionApp.name)}/host/default/', '2021-02-01').masterKey
as secret value in this resourceMicrosoft.KeyVault/vaults/secrets@2022-07-01
block. - If are using the single template to create resource and storing secrets. I recommend you use two template one template for resource creation and other template for storing secrets and use deployment scripts to wait for few seconds and to create the secret in key vaults. Refer to learn documentation about deployment scripts.