使用 az cli 将静态 Web 应用程序的预览部署链接到 Azure Function 的非默认部署槽

问题描述 投票:0回答:1

使用此命令:

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 部署槽?

azure azure-functions azure-cli azure-static-web-app
1个回答
0
投票

您应该能够使用通用的

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>
© www.soinside.com 2019 - 2024. All rights reserved.