I am trying to handle the App events and I am getting one weird intermittent error related to app principal. When I try to deploy the Auto-Hosted App from visual studio, Sometime I am getting the errors below. This error is not consistent and sometime I am able to deploy my app successfully.
I thought of trying to create the token by myself, but I am getting the access denied when I try to create the token from the location: https://microsoft.sharepoint.com/_layouts/15/appregnew.aspx
ErrorDetail: There was a problem registering the app principal. ErrorType: Configuration ErrorTypeName: Configuration ExceptionMessage: The specified application principal does not exist. Source: RemoteWebSite SourceName: Remote Web Site Deployment