question

18253371 avatar image
0 Votes"
18253371 asked MayankBargali-MSFT edited

.NET 5 Azure Function 3.x Isolate Process Disable

I want to disable only some functions without stopping the Azure Function Process. Is there a way to do this in .NET 5 Isolate Process?

https://stackoverflow.com/questions/62686591/disable-azure-function-from-c-sharp-for-runtime-version-3-x

I found the above article, but the method is complicated and this is last year's post. Is there anything updated?

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT edited

@18253371 To disable the function please refer to the disable function document.

Programatically you can also use the below REST endpoint to enable/disable a particular function
PUT https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourcegroupname}/providers/Microsoft.Web/sites/{sitename}/functions/{functionappname}/properties/state?api-version=2018-11-01
content-type: application/json; charset=utf-8

Request Body:

 {"properties":"disabled"}

OR

 {"properties":"enabled"}

Alternative you can also using this API API to update settings as mentioned in the stackoverflow post.

Feel free to get back to me if you need any assistance.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

In case of .NET 5 Isolate Process method, is it possible to use only the method in the local.settings.json section in the linked MSDN document?

0 Votes 0 ·

@18253371 For local environment yes you can use define in your local.settings.json but when you deploy to azure then you need to define it in Application setting of your function app.

 "AzureWebJobs.yourfunctionname.Disabled": true

OR

 "AzureWebJobs.yourfunctionname.Disabled": 1
0 Votes 0 ·