{"id":82795,"date":"2018-02-28T11:00:52","date_gmt":"2018-02-28T19:00:52","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/?p=82795"},"modified":"2019-02-18T09:10:00","modified_gmt":"2019-02-18T16:10:00","slug":"powertip-create-new-authentication-keys-for-azurerm-cognitive-services","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-create-new-authentication-keys-for-azurerm-cognitive-services\/","title":{"rendered":"PowerTip: Create new authentication keys for AzureRM Cognitive Services"},"content":{"rendered":"<p><strong>Summary<\/strong>: Change the keys to authenticate to Azure RM Cognitive Services, by using Windows PowerShell.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\"><img decoding=\"async\" width=\"34\" height=\"34\" class=\"alignnone size-full wp-image-82735\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" \/><\/a>\u00a0 Hey, Scripting Guy! I created the keys for my Rest API. I know I can change them in the web portal, but is there a faster way of doing it through Windows PowerShell?<\/p>\n<p style=\"padding-left: 30px\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\"><img decoding=\"async\" width=\"34\" height=\"34\" class=\"alignnone size-full wp-image-82745\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" \/><\/a>\u00a0 There absolutely is! Just use the <strong>New-AzureRMCognitiveServicesAccountKey<\/strong> cmdlet to reset either Key1 or Key2 (or both). Here is an example, where we generate a new sequence for Key1:<\/p>\n<p style=\"padding-left: 90px\">New-AzureRMCognitiveServicesAccountKey -ResourceGroup &#8216;HSG&#8217; -Name &#8216;Sample&#8217; -KeyName Key1<\/p>\n<p style=\"padding-left: 30px\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/dr_scripto.png\"><img decoding=\"async\" width=\"96\" height=\"145\" class=\"alignnone size-full wp-image-82775\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/dr_scripto.png\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Change the keys to authenticate to Azure RM Cognitive Services, by using Windows PowerShell. \u00a0 Hey, Scripting Guy! I created the keys for my Rest API. I know I can change them in the web portal, but is there a faster way of doing it through Windows PowerShell? \u00a0 There absolutely is! Just use [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[639],"tags":[56,356,154,45],"class_list":["post-82795","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powertip","tag-guest-blogger","tag-powertip","tag-sean-kearney","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Change the keys to authenticate to Azure RM Cognitive Services, by using Windows PowerShell. \u00a0 Hey, Scripting Guy! I created the keys for my Rest API. I know I can change them in the web portal, but is there a faster way of doing it through Windows PowerShell? \u00a0 There absolutely is! Just use [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/82795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=82795"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/82795\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=82795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=82795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=82795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}