Not sure this is an issue with this code itself, but more with LogicApps in general. As far as I can see LA is acting as a confidential client on behalf of the user granting the consent. In other words it is using the user who consented's permissions to access whatever resources it is using. Is this a recommended pattern for server-side apps? The tokens granted during consent are not permanent and might be revoked, in which case the user must reconsent for the app to work again. How can we introduce access as a service principal directly instead of on behalf of a user?
Not sure this is an issue with this code itself, but more with LogicApps in general. As far as I can see LA is acting as a confidential client on behalf of the user granting the consent. In other words it is using the user who consented's permissions to access whatever resources it is using. Is this a recommended pattern for server-side apps? The tokens granted during consent are not permanent and might be revoked, in which case the user must reconsent for the app to work again. How can we introduce access as a service principal directly instead of on behalf of a user?