{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-powershell/issues/1896","repository_url":"https://api.github.com/repos/Azure/azure-powershell","labels_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1896/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1896/comments","events_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1896/events","html_url":"https://github.com/Azure/azure-powershell/issues/1896","id":137664535,"number":1896,"title":"New-AzureRmADApplication: Access denied to the specified API version","user":{"login":"winperec","id":10044618,"avatar_url":"https://avatars.githubusercontent.com/u/10044618?v=3","gravatar_id":"","url":"https://api.github.com/users/winperec","html_url":"https://github.com/winperec","followers_url":"https://api.github.com/users/winperec/followers","following_url":"https://api.github.com/users/winperec/following{/other_user}","gists_url":"https://api.github.com/users/winperec/gists{/gist_id}","starred_url":"https://api.github.com/users/winperec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winperec/subscriptions","organizations_url":"https://api.github.com/users/winperec/orgs","repos_url":"https://api.github.com/users/winperec/repos","events_url":"https://api.github.com/users/winperec/events{/privacy}","received_events_url":"https://api.github.com/users/winperec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-01T19:31:34Z","updated_at":"2016-03-05T12:42:31Z","closed_at":null,"body":"I created service principal, assign subscription Owner role for it and use Login-AzureRmAccount to authorize to Azure. \r\nThen when I try to run New-AzureRmADApplication command under my service principal I get the following error:\r\n{\"odata.error\":{\"code\":\"Authentication_Unauthorized\",\"message\":{\"lang\":\"en\",\"value\":\"Access denied to the specified API version.\"}}}\r\n\r\nIn exception i see that request goes to \r\nhttps://graph.windows.net/<tenant_id>/me?api-version=1.6-internal\r\n\r\nIs it expected behavior?  Is it possible to create AAD application under service principal?\r\nVersion of my AzurePS 1.2.1\r\n<!---@tfsbridge:{\"tfsId\":5867824}-->"},"comment":{"url":"https://api.github.com/repos/Azure/azure-powershell/issues/comments/192638583","html_url":"https://github.com/Azure/azure-powershell/issues/1896#issuecomment-192638583","issue_url":"https://api.github.com/repos/Azure/azure-powershell/issues/1896","id":192638583,"user":{"login":"winperec","id":10044618,"avatar_url":"https://avatars.githubusercontent.com/u/10044618?v=3","gravatar_id":"","url":"https://api.github.com/users/winperec","html_url":"https://github.com/winperec","followers_url":"https://api.github.com/users/winperec/followers","following_url":"https://api.github.com/users/winperec/following{/other_user}","gists_url":"https://api.github.com/users/winperec/gists{/gist_id}","starred_url":"https://api.github.com/users/winperec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winperec/subscriptions","organizations_url":"https://api.github.com/users/winperec/orgs","repos_url":"https://api.github.com/users/winperec/repos","events_url":"https://api.github.com/users/winperec/events{/privacy}","received_events_url":"https://api.github.com/users/winperec/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T12:42:31Z","updated_at":"2016-03-05T12:42:31Z","body":"No luck..\r\nI've added permissions to Microsoft Graph 'Read directory' data\r\nhttp://screencast.com/t/92kp4IkzF \r\nand assign all relevant roles on subscription for principal\r\nhttp://screencast.com/t/ffEdrXrd1A\r\n\r\nSo which permissions I should add to the service principal ? Seems it's AD issue...\r\n"}}