This sample contains a script to easily migrate template gallery templates to templateSpec resources.
{"type": "microsoft.resources/deploymentscripts", "apiversion": "2020-10-01", "name": "[format('{0}-{1}", variables('scriptname'), variables('wordpresssharename'))]", "location": "[parameters('location')]", "kind": "azurepowershell", "identity": {"type": "userassigned", "userassignedidentities": {"[resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))]": {}}}, "properties": {"azpowershellversion": "3.0", "storageaccountsettings": {"storageaccountname": "[parameters('storageaccountname')]", "storageaccountkey": "[listkeys(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "2021-04-01').keys[0].value]"}, "scriptcontent": "[variables('wpscripttoexecute')]", "cleanuppreference": "onsuccess", "retentioninterval": "p1d", "timeout": "pt5m"}, "dependson": ["[resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))]", "[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"]} 