Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add info for using modules in Azure Devops pipeline #89

Merged
merged 1 commit into from
Jun 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/using-in-azure-devops-pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Using In Azure Devops

The recommended way to test newly generated Azurestack modules in Azure Devops is to upload them to a storage accessible by your Azure Devops pipeline. For example, the following code downloads, installs, and imports the required Az.Accounts and Az.Resources modules.

```
Unregister-PSRepository -Name local -ErrorAction SilentlyContinue
$psrepo="$env:systemdrive\psrepo"
New-Item -Path $psrepo -ItemType Directory -force
Invoke-WebRequest -Uri <URI_TO_AZ_ACCOUNTS_DOWNLOAD> -OutFile <AZ_ACCOUNTS_MODULE_DOWNLOADED_FILE>
Invoke-WebRequest -Uri <URI_TO_AZ_RESOURCES_DOWNLOAD> -OutFile <AZ_RESOURCES_MODULE_DOWNLOADED_FILE>
Register-PSRepository -Name local -SourceLocation $psrepo -InstallationPolicy Trusted
Install-Module Az.Accounts -Repository Local
Install-Module Az.Resources -Repository Local
Import-Module Az.Accounts
Import-Module Az.Resources
```