Sometimes you just need to restart your portal to get a setting to take effect. And sometimes the restart action in the portal administration just doesn’t seem like it is restarting your portal.
Why restart your portal? Some of the settings in your portal actually require a full cache flush, or restart of the behind the scenes ASP.NET application for them to take effect. These range from setting to setting, a lot of the authentication ones have this need though. Sometimes the cache message for whatever reason doesn’t make it there or you as a developer just want a fresh restart of your portal.
The standard action is to go the PowerApps Portal admin center, go to Portal Actions, and select restart. This should cycle the application by sending a restart command to the Azure App Service powering the portal behind the scenes. The restart is basically an IISRESET command. Your portal will then show a 503 error briefly, if you refresh a number of times quickly you might also see a 502 error and then be really really slow on the first request where the ASP.NET application is loaded into memory in the Azure App Service.
But sometimes this doesn’t work, or you never seem to get that cycle of the 503 error and then a slow page load. If that is the case another more evasive technique is to actually turn off the portal and then turn it back on. Effectively doing an IIS STOP and then IIS START.
You can actually do this from the PowerApps Portals admin center, Portal Details, scroll to the bottom and see the Change Portal State.
Now select the Off state, and select Update.
Navigate to your portal and wait to receive the App Stopped message screen.
Once you see this screen, switch back to the Portal Details, select the On state and select Update.
This will also sometimes fix the restart mechanic as the update command on Portal Details actually will run a healing process as well to ensure that the necessary services like the cache invalidation are properly hooked up as well.
Stubborn portal that won’t restart just dealt with 🙂
Note the restart command and the change in state will take some time to actually change. They appear to be asynchronous commands sent to Azure App Services so they can take some time that the PowerApps Portal admin center UI will not always reflect.