Summary
App Portal requests are not getting updated due to a bug within ConfigMgr 1511/1602 where status messages are not getting updated for packages installed on client machines that are reporting to secondary sites.
Symptoms
The "Waiting on Status" message gets displayed for requests within App Portal even though the package gets successfully installed on the client device. The request would eventually fail if no status messages are received from ConfigMgr.
Cause
There's a bug within ConfigMgr 1511 and 1602 version where status messages are not getting updated for packages installed on client machines that are reporting to secondary sites.
Resolution
The following queries can be run against ConfigMgr Database to determine if status messages are being returned to App Portal from ConfigMgr:
Package Status Query
Step 1: Run the following SQL query against App Portal to determine the SCCM AdvertisementID. Replace the appPortalRequestID '111' with the specific AppPortal RequestID. Replace the machineName variable 'MYMACHINENAME' with the target machine name.
--Start of Query---
declare @appPortalRequestID as int
declare @machineName as nvarchar(15)
declare @advertID as nvarchar(255)
set @appPortalRequestID = '111'
set @machineName = 'MYMACHINENAME'
select @advertID = sta.AdvertID
from WD_SiteToAdvert sta
inner join WD_WebPackages wp on wp.PackageID = sta.PackageID
inner join wd_packagerequests pr on pr.packageid_fk = sta.packageid and pr.requesttype = sta.type
where pr.RequestID = @appPortalRequestID and sta.Type = 0
select @advertID as CMAdvertisementID
--End of Query---
Step 2: Run the following SQL query against the ConfigMgr database to get the status message. Replace the values for the machineName "MYMACHINENAME" with your machine name and also replace the advertid value "SA22001D" with the CMAdvertisementID returned from step 1. Note that there are two single quotes surrounding the machine name in the below query.
--NOTE: This only works for Pacakges
declare @p3 xml
set @p3=convert(xml,N'<L><I>SA22001D</I></L>')
exec sp_executesql N'SELECT StatusMessages.MachineName, StatusMessages.SiteCode, StatusMessageAttributes.AttributeValue AS AdvertID, StatusMessages.Time, OfferStatusInfo.MessageName, OfferStatusInfo.MessageState, OfferStatusInfo.MessageStateName, OfferStatusInfo.MessageID & 0x0000FFFF AS LastStatusID, StatusMessages.RecordID FROM StatusMessages INNER JOIN OfferStatusInfo ON StatusMessages.ID = OfferStatusInfo.MessageID INNER JOIN StatusMessageAttributes ON StatusMessages.RecordID = StatusMessageAttributes.RecordID WHERE (StatusMessageAttributes.AttributeID = 401) AND (StatusMessages.Type = 258) and StatusMessages.MachineName = ''MYMACHINENAME'' AND EXISTS (SELECT * FROM (select T.c.value(''.'',''nvarchar(255)'') as Id from @Ids.nodes(''/L/I'') T(c)) Ids where StatusMessageAttributes.AttributeValue = Ids.id) ORDER BY StatusMessages.Time DESC',N'@Ids xml',@Ids=@p3
--End of Query---