Thanks for your response. Since WEBSITE_RUN_FROM_PACKAGE
is not present and you already have the Contributor role, let’s explore alternative ways to delete the function and troubleshoot the disabled buttons further.
Deleting Function from Function App
You can delete the function using either the Azure REST API or Azure CLI:
Using REST API:
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}?api-version=2024-04-01
Replace {subscriptionId}
, {resourceGroupName}
, {name}
, and {functionName}
with the correct values.
Using Azure CLI:
az functionapp function delete --function-name <FunctionName> --name <FunctionAppName> --resource-group <ResourceGroupName>
Reference :
https://learn.microsoft.com/en-us/cli/azure/functionapp/function?view=azure-cli-latest#az-functionapp-function-delete
https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/delete-function?view=rest-appservice-2024-04-01#code-try-0
Checking "Remove Additional Files at Destination" & Deployment Profile
Since you deployed via VS Code, this setting is not directly available. However, in Visual Studio, you can find it in the Publish Profile:
- Open Visual Studio.
- Go to Solution Explorer → Right-click on your Function App project → Click Publish.
- Under Deployment Settings, look for "Remove additional files at destination" and enable it before redeploying.
Since you used VS Code, you may need to manually clean up the function files using Kudu or Azure CLI before redeploying.
Why are the Delete & Disable Buttons Disabled?
This seems to be an issue with RBAC roles or permissions. Can you try the following and let us know if the issue persists?
- Try adding the Website Contributor role and check whether the "Disable" and "Delete" buttons become enabled. If the issue persists, try removing the Website Contributor role.
- Try creating a custom role using the following permissions:
-
microsoft.web/sites/functions/delete
-
microsoft.web/sites/functions/action
-
microsoft.web/sites/functions/write
-
Let me know how it goes or if you need further assistance!