使用此命令:
az staticwebapp functions link --function-resource-id "/subscriptions/[sub-id]/resourceGroups/[resource-group-name]/providers/Microsoft.Web/sites/[func-name]/slots/[slot-name]" -n [swa-name] -g [swa-rg-name] --environment-name "[env-name]" --force
我收到错误:
ERROR: --function-resource-id must specify a function resource ID. To get resource ID, use the following commmand, inserting the function group/name as needed:
az functionapp show --resource-group "[FUNCTION_RESOURCE_GROUP]" --name "[FUNCTION_NAME]" --query id
如何指定 Azure Function 部署槽?
您应该能够使用通用的
az staticwebapp backends link
命令。它应该接受任何有效的资源ID
az staticwebapp backends link `
--backend-resource-id <function app slot resource id>`
--name <static website name>`
--resource-group <resource group name>