{"id":20475,"date":"2024-04-02T14:37:11","date_gmt":"2024-04-02T22:37:11","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/powershell\/?p=20475"},"modified":"2025-02-28T12:27:40","modified_gmt":"2025-02-28T20:27:40","slug":"psresourceget-support-for-azure-container-registry-acr-is-in-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/psresourceget-support-for-azure-container-registry-acr-is-in-preview\/","title":{"rendered":"PSResourceGet support for Azure Container Registry (ACR) is in Preview"},"content":{"rendered":"<p>Microsoft.PowerShell.PSResourceGet 1.1.0-preview1 is now available on <a href=\"https:\/\/www.powershellgallery.com\/packages\/Microsoft.PowerShell.PSResourceGet\/\">the PowerShell Gallery<\/a>.<\/p>\n<p>This preview adds support for Azure Container Registry (ACR) as a private repository for PowerShell.\nAlthough ACR is a container registry by name, in this release we add support for PowerShell resources as modules, scripts and DSC resources to be directly published and consumed in the repository.\nTo support this we publish the PowerShell resources as OCIArtifacts, and created a dependable schema to store the needed PSResource metadata.<\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/gallery\/powershellget\/supported-repositories?view=powershellget-3.x#azure-container-registry\">The documentation for PSResourceGet<\/a> is also updated to reflect this release.<\/p>\n<h2>How to install the module<\/h2>\n<p>To install from PSResourceGet (which is included since PowerShell 7.4 Preview 5)<\/p>\n<p><code>Install-PSResource -Name Microsoft.PowerShell.PSResourceGet -Prerelease<\/code><\/p>\n<p>To install from PowerShellGet 2.2.5<\/p>\n<p><code>Install-Module -Name Microsoft.PowerShell.PSResourceGet -AllowPrerelease<\/code><\/p>\n<p>This module is supported on all supported versions of PowerShell including Windows PowerShell 5.1.<\/p>\n<h2>Updates in this release<\/h2>\n<h3>New Features<\/h3>\n<ul>\n<li>Support for Azure Container Registries<\/li>\n<\/ul>\n<h3>Bug Fixes<\/h3>\n<ul>\n<li>Fix incorrect request URL when installing resources from ADO (Thanks @anytonyoni!)<\/li>\n<li>Fix for swallowed exceptions<\/li>\n<li>Fix for PSResourceGet not working in Constrained Language Mode<\/li>\n<\/ul>\n<h2>Getting started with ACR<\/h2>\n<p>Azure Container Registry (ACR) allows you to build, store, and manage container images and artifacts in a private registry for all types of container deployments.\nACR-based repositories are private repositories and require credentials for access.\nTo create a registry refer to <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/gallery\/powershellget\/how-to\/use-acr-repository?view=powershellget-3.x#create-an-azure-container-registry\">this documentation<\/a>.<\/p>\n<p>To register an ACR repository, you must know the LoginServer name of the ACR. Use the following commands to register an ACR repository as a PSResource repository.<\/p>\n<pre><code class=\"language-powershell\">$myAcr = Get-AzContainerRegistry -Name myAcr\r\n$acrUrl = \"https:\/\/$($myAcr.LoginServer)\"\r\nRegister-PSResourceRepository -Name ACRDemoRepo -Uri $acrUrl<\/code><\/pre>\n<p>After you register the repository, the first time you perform an operation on the registered repository in a new session you are prompted to login.\nThis repository uses the Azure.Identity SDK for authentication.<\/p>\n<p>Once you register, you can publish to the repository, note you will not need to use\nan API key.\nFor PowerShell resources to be discoverable\/installable by PSResourceGet they will need to be published by PSResourceGet,\nthis is because the module formats the metadata in a particular way during the publish process to ACR.<\/p>\n<pre><code class=\"language-powershell\">$publishPSResourceSplat = @{\r\n    Path = 'D:\\MyModule'\r\n    Repository = 'ACRDemoRepo'\r\n}\r\nPublish-PSResource @publishPSResourceSplat<\/code><\/pre>\n<p>You can now interact with the repository using find\/install commands\nas you would with other repositories.<\/p>\n<p>Please note <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/gallery\/powershellget\/how-to\/use-acr-repository?view=powershellget-3.x#limitations\">the limitations of container registries<\/a>.<\/p>\n<p>For more detailed information check out <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/gallery\/powershellget\/how-to\/use-acr-repository?view=powershellget-3.x\">the documentation<\/a>.<\/p>\n<h2>How to give feedback and get support<\/h2>\n<p>We cannot overstate how useful user feedback has been in the development of this module.<\/p>\n<p>In order to give feedback or get support please open issues in our <a href=\"https:\/\/github.com\/powershell\/psresourceget\">GitHub repository<\/a>.<\/p>\n<p>Sydney<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PSResourceGet 1.1 preview 1 is available<\/p>\n","protected":false},"author":2299,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[248,274,3199],"class_list":["post-20475","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-powershell","tag-powershellget","tag-psresourceget"],"acf":[],"blog_post_summary":"<p>PSResourceGet 1.1 preview 1 is available<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/20475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/2299"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=20475"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/20475\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=20475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=20475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=20475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}