{"action":"created","issue":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6639","repository_url":"https://api.github.com/repos/OrchardCMS/Orchard","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6639/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6639/comments","events_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6639/events","html_url":"https://github.com/OrchardCMS/Orchard/issues/6639","id":142908703,"number":6639,"title":"Azure Media Storage don't recognizes its own URLs","user":{"login":"TFleury","id":7600804,"avatar_url":"https://avatars.githubusercontent.com/u/7600804?v=3","gravatar_id":"","url":"https://api.github.com/users/TFleury","html_url":"https://github.com/TFleury","followers_url":"https://api.github.com/users/TFleury/followers","following_url":"https://api.github.com/users/TFleury/following{/other_user}","gists_url":"https://api.github.com/users/TFleury/gists{/gist_id}","starred_url":"https://api.github.com/users/TFleury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TFleury/subscriptions","organizations_url":"https://api.github.com/users/TFleury/orgs","repos_url":"https://api.github.com/users/TFleury/repos","events_url":"https://api.github.com/users/TFleury/events{/privacy}","received_events_url":"https://api.github.com/users/TFleury/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-23T09:29:47Z","updated_at":"2016-03-23T12:31:13Z","closed_at":null,"body":"# Repro steps\r\n- Enable Azure Media Storage\r\n- Add StorageConnectionString\r\n```\r\n<add key=\"Orchard.Azure.Media.StorageConnectionString\" value=\"BlobEndpoint=http://myaccount.blob.core.windows.net/;AccountName=myaccount;AccountKey=mykey\"/>\r\n```\r\nNote that port is not defined in the BlobEndPoint URI\r\n- Add a media to your storage...\r\n\r\n# The issue\r\nNow, look at your media's PublicUrl :\r\nIt should be :\r\n```\r\nhttp://myaccount.blob.core.windows.net/media/mysite/mydir/mymedia.ext\r\n```\r\nBut it is :\r\n```\r\nhttp://myaccount.blob.core.windows.net:80/media/mysite/mydir/mymedia.ext\r\n```\r\nThe only difference is that the port is defined. Not an issue, it just works... no, not really.\r\n\r\n## Assume you want to open your media file\r\nThe way to do this is :\r\n```\r\nvar storagePath = _storageProvider.GetStoragePath(mediaPart.MediaUrl);\r\nvar mediaFile = _storageProvider.GetFile(storagePath);\r\n```\r\nBut `AzureBlobStorageProvider.GetStoragePath` checks if `MediaUrl` StartsWith our `BlobEndpoint.AbsoluteUri` (which doesn't contains port), so it fails.\r\n\r\n## But it works for MediaProcessing\r\nThe reason it works, is that it can handle external medias. When it processes a media from Azure Media Storage, it's handled as an external media.\r\n`ImageProfileManager` should reprocess files if the source is more recent than processed file, so it doesn't works for Azure Media Storage files."},"comment":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/comments/200328554","html_url":"https://github.com/OrchardCMS/Orchard/issues/6639#issuecomment-200328554","issue_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6639","id":200328554,"user":{"login":"TFleury","id":7600804,"avatar_url":"https://avatars.githubusercontent.com/u/7600804?v=3","gravatar_id":"","url":"https://api.github.com/users/TFleury","html_url":"https://github.com/TFleury","followers_url":"https://api.github.com/users/TFleury/followers","following_url":"https://api.github.com/users/TFleury/following{/other_user}","gists_url":"https://api.github.com/users/TFleury/gists{/gist_id}","starred_url":"https://api.github.com/users/TFleury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TFleury/subscriptions","organizations_url":"https://api.github.com/users/TFleury/orgs","repos_url":"https://api.github.com/users/TFleury/repos","events_url":"https://api.github.com/users/TFleury/events{/privacy}","received_events_url":"https://api.github.com/users/TFleury/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T12:31:13Z","updated_at":"2016-03-23T12:31:13Z","body":"Yes, the second commit is sufficient to fix the issue. The first is intended to produce cleaner URLs (and also fix the issue if you don't use PublicUrl).\r\nThe issue is double fixed :-)"}}