{"id":637,"date":"2019-12-20T14:11:58","date_gmt":"2019-12-20T22:11:58","guid":{"rendered":"http:\/\/blog.nillsf.com\/?p=637"},"modified":"2019-12-20T14:12:01","modified_gmt":"2019-12-20T22:12:01","slug":"sharing-blob-storage-with-azure-ad-b2b-guests","status":"publish","type":"post","link":"https:\/\/nillsf.com\/index.php\/2019\/12\/20\/sharing-blob-storage-with-azure-ad-b2b-guests\/","title":{"rendered":"Sharing Blob storage with Azure AD B2B guests"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Azure blob storage supports two ways of authorization for blob access. Either you use the storage account key or a derivate SAS token &#8211; or you use AAD RBAC to access blob.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I did a quick test today to check if it would be possible to use a B2B guest to access blob storage. Want to find out more?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Inviting a guest to your storage container<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I decided to use an existing storage account for this test. I did create a new container on this storage account, called &#8216;testb2b&#8217;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"501\" height=\"286\" src=\"\/wp-content\/uploads\/2019\/12\/image-6.png\" alt=\"\" class=\"wp-image-638\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-6.png 501w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-6-300x171.png 300w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The default authorization is still storage account key (or SAS). I switched this to AAD.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"458\" height=\"243\" src=\"\/wp-content\/uploads\/2019\/12\/image-7.png\" alt=\"\" class=\"wp-image-639\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-7.png 458w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-7-300x159.png 300w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And then I went ahead and invited my guest. This guest exists in my own AAD tenant, nillsf.com.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"430\" height=\"899\" src=\"\/wp-content\/uploads\/2019\/12\/image-8.png\" alt=\"\" class=\"wp-image-640\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-8.png 430w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-8-143x300.png 143w\" sizes=\"auto, (max-width: 430px) 100vw, 430px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If this is the first time this guest is invited to your directory, he&#8217;ll get an invitation. Since Ben doesn&#8217;t have email (he is just a demo user for me), I used the invitation URL from the notification for him the accept his invite.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"517\" height=\"425\" src=\"\/wp-content\/uploads\/2019\/12\/image-9.png\" alt=\"\" class=\"wp-image-641\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-9.png 517w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-9-300x247.png 300w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"463\" height=\"549\" src=\"\/wp-content\/uploads\/2019\/12\/image-10.png\" alt=\"\" class=\"wp-image-642\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-10.png 463w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-10-253x300.png 253w\" sizes=\"auto, (max-width: 463px) 100vw, 463px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And then finally, I uploaded a file to that storage account (still using my own user in the azure portal) so I would have some data to show:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"530\" height=\"331\" src=\"\/wp-content\/uploads\/2019\/12\/image-11.png\" alt=\"\" class=\"wp-image-643\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-11.png 530w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-11-300x187.png 300w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Using Storage Explorer to access files using AAD RBAC<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To demo the fact that we can connect, I decided to use the <a href=\"https:\/\/azure.microsoft.com\/en-us\/features\/storage-explorer\/\">Storage Explorer<\/a>. This is a free tool you can use to connect to Azure storage. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"597\" src=\"\/wp-content\/uploads\/2019\/12\/image-12.png\" alt=\"\" class=\"wp-image-644\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-12.png 889w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-12-300x201.png 300w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-12-768x516.png 768w\" sizes=\"auto, (max-width: 889px) 100vw, 889px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">First, I added my ben@nillsf.com to the storage explorer accounts.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"919\" height=\"929\" src=\"\/wp-content\/uploads\/2019\/12\/image-13.png\" alt=\"\" class=\"wp-image-645\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-13.png 919w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-13-297x300.png 297w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-13-768x776.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-13-60x60.png 60w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After that, I added the resource (the container) via AAD authorization.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"919\" height=\"929\" src=\"\/wp-content\/uploads\/2019\/12\/image-14.png\" alt=\"\" class=\"wp-image-646\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-14.png 919w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-14-297x300.png 297w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-14-768x776.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-14-60x60.png 60w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This will ask you for the account to use and the container location. Once you enter that, you can use storage explorer to see the files. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"919\" height=\"929\" src=\"\/wp-content\/uploads\/2019\/12\/image-15.png\" alt=\"\" class=\"wp-image-647\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-15.png 919w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-15-297x300.png 297w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-15-768x776.png 768w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-15-60x60.png 60w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And as you can see, I can now see and download my file using storage explorer. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"390\" height=\"265\" src=\"\/wp-content\/uploads\/2019\/12\/image-16.png\" alt=\"\" class=\"wp-image-648\" srcset=\"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-16.png 390w, https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-16-300x204.png 300w\" sizes=\"auto, (max-width: 390px) 100vw, 390px\" \/><figcaption><br><\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The goal of this post was to prove that I can invite Azure AD B2B guests to connect to storage accounts using Azure AD authorization. This worked perfectly. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure blob storage supports two ways of authorization for blob access. Either you use the storage account key or a derivate SAS token &#8211; or you use AAD RBAC to access blob. I did a quick test today to check if it would be possible to use a B2B guest to access blob storage. Want [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,4],"tags":[8,68],"class_list":["post-637","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-management","tag-azure","tag-blob"],"jetpack_featured_media_url":"https:\/\/nillsfblog.blob.core.windows.net\/media\/2019\/12\/image-12.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/comments?post=637"}],"version-history":[{"count":1,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/637\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/posts\/637\/revisions\/649"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/media\/644"}],"wp:attachment":[{"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/media?parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/categories?post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nillsf.com\/index.php\/wp-json\/wp\/v2\/tags?post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}