Configure App services: In the "Capabilities" section, look for the "Location" option. If your application only needs to use the location function while it is in the foreground, check the "Location When In Use" option. If it needs to obtain location information even when it is in the background (such as a navigation application), then check the "Location Always and When In Use" option. After checking the relevant options, the system will automatically configure the corresponding permissions for your App ID.
I'm seeking for an answer.