{"id":113,"date":"2015-05-21T14:12:02","date_gmt":"2015-05-21T14:12:02","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/azuregov\/2015\/05\/21\/connecting-to-a-media-services-account-located-in-azure-government\/"},"modified":"2015-05-21T14:12:02","modified_gmt":"2015-05-21T14:12:02","slug":"connecting-to-a-media-services-account-located-in-azure-government","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azuregov\/connecting-to-a-media-services-account-located-in-azure-government\/","title":{"rendered":"Connecting to a Media Services account located in Azure Government"},"content":{"rendered":"<p>The full details of how to connect are listed in this MSDN article, however the connection information for Azure Government is a bit different then on the public cloud.<br \/><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/azure\/jj129571.aspx\">https:\/\/msdn.microsoft.com\/en-us\/library\/azure\/jj129571.aspx<\/a><\/p>\n<p>Connecting a two-step process, first you setup your credential and then you create your context. To connect to Azure Government you will need to take advantage of the following overloads:<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>\/\/ Create and cache the Media Services credentials in a static class variable.<br \/>_cachedCredentials = new MediaServicesCredentials(<br \/>&nbsp;&nbsp;&nbsp;&nbsp; _mediaServicesAccountName,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; _mediaServicesAccountKey,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; _mediaContextScope,<br \/>&nbsp;&nbsp;&nbsp;&nbsp; _acsBaseAddress);<\/p>\n<p>\/\/ Use the cached credentials to create CloudMediaContext.<br \/>_context = new CloudMediaContext(new Uri(_apiServerAddress),<br \/>&nbsp;&nbsp;&nbsp;&nbsp; _cachedCredentials);<\/p>\n<p>You get the account name and key via the Azure portal, just press the &ldquo;Manage Keys&rdquo; button.<br \/>The Media Context Scope should be set to &#8220;urn:WindowsAzureMediaServices&#8221;.<br \/>The Acs Base Address should be set to &#8220;https:\/\/ams-usge-0-acs-global-1-1.accesscontrol.usgovcloudapi.net&#8221;<br \/>The API Server Address depends on what region you are deployed to:<br \/>&nbsp; US Gov Virginia is &#8220;https:\/\/ams-usge-1-hos-rest-1-1.usgovcloudapp.net\/API\/&#8221;<br \/>&nbsp; US Gov Iowa is &#8220;https:\/\/ams-usgc-1-hos-rest-1-1.usgovcloudapp.net\/API\/&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The full details of how to connect are listed in this MSDN article, however the connection information for Azure Government is a bit different then on the public cloud.https:\/\/msdn.microsoft.com\/en-us\/library\/azure\/jj129571.aspx Connecting a two-step process, first you setup your credential and then you create your context. To connect to Azure Government you will need to take advantage [&hellip;]<\/p>\n","protected":false},"author":5375,"featured_media":20423,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[95,391],"class_list":["post-113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azuregov","tag-azure-government","tag-media-services"],"acf":[],"blog_post_summary":"<p>The full details of how to connect are listed in this MSDN article, however the connection information for Azure Government is a bit different then on the public cloud.https:\/\/msdn.microsoft.com\/en-us\/library\/azure\/jj129571.aspx Connecting a two-step process, first you setup your credential and then you create your context. To connect to Azure Government you will need to take advantage [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/users\/5375"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/comments?post=113"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media\/20423"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azuregov\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}