base on Microsoft Azure PowerShell <meta name="google-site-verification" content="tZgbB2s-hTI0IePQQRCjHqL_Vf0j_XJmehXAHJerrn4" />
# ![AzureIcon] ![PowershellIcon] Microsoft Azure PowerShell
This repository contains PowerShell cmdlets for developers and administrators to develop, deploy,
administer, and manage Microsoft Azure resources.
The Az PowerShell module is preinstalled in [Azure Cloud Shell][AzureCloudShell].
## Modules
The following table contains a list of the Azure PowerShell rollup modules.
Description | Module Name | PowerShell Gallery Link
----------------- | ------------ | -----------------------
Azure PowerShell | `Az` | [![Az]][AzGallery]
Azure PowerShell with preview modules | `AzPreview` | [![AzPreview]][AzPreviewGallery]
For a complete list of the modules found in this repository, see
[Azure PowerShell Modules][AzurePowerShellModules].
## Installation
### PowerShell Gallery
Run the following command in a PowerShell session to install the Az PowerShell module:
```powershell
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
```
[The latest version of PowerShell 7][PowerShellCore] is the recommended version of PowerShell for
use with the Az PowerShell module on all platforms including Windows, Linux, and macOS. This module
also runs on Windows PowerShell 5.1 with [.NET Framework 4.7.2][DotNetFramework] or higher.
The `Az` module replaces `AzureRM`. You should not install `Az` side-by-side with `AzureRM`.
If you have an earlier version of the Azure PowerShell module installed from the PowerShell Gallery
and would like to update to the latest version, run the following command in a PowerShell session:
```powershell
Update-Module -Name Az -Scope CurrentUser -Force
```
`Update-Module` installs the new version side-by-side with previous versions. It does not uninstall
the previous versions.
For more information on installing Azure PowerShell, see the
[installation guide][InstallationGuide].
## Usage
### Log into Azure
To connect to Azure, use the [`Connect-AzAccount`][ConnectAzAccount] cmdlet:
```powershell
# Opens a new browser window to log into your Azure account.
Connect-AzAccount
# Log in with a previously created service principal. Use the application ID as the username, and the secret as password.
$Credential = Get-Credential
Connect-AzAccount -ServicePrincipal -Credential $Credential -TenantId $TenantId
```
To log into a specific cloud (_AzureChinaCloud_, _AzureCloud_, _AzureUSGovernment_), use the
`Environment` parameter:
```powershell
# Log into a specific cloud, for example the Azure China cloud.
Connect-AzAccount -Environment AzureChinaCloud
```
### Session context
A session context persists login information across Azure PowerShell modules and PowerShell
instances. Use the [`Get-AzContext`][GetAzContext] cmdlet to view the context you are using in the
current session. The results contain the Azure tenant and subscription.
```powershell
# Get the Azure PowerShell context for the current PowerShell session
Get-AzContext
# Lists all available Azure PowerShell contexts in the current PowerShell session
Get-AzContext -ListAvailable
```
To get the subscriptions in a tenant, use the [`Get-AzSubscription`][GetAzSubscription] cmdlet:
```powershell
# Get all of the Azure subscriptions in your current Azure tenant
Get-AzSubscription
# Get all of the Azure subscriptions in a specific Azure tenant
Get-AzSubscription -TenantId $TenantId
```
To change the subscription that you are using for your current context, use the
[`Set-AzContext`][SetAzContext] cmdlet:
```powershell
# Set the Azure PowerShell context to a specific Azure subscription
Set-AzContext -Subscription $SubscriptionName -Name 'MyContext'
# Set the Azure PowerShell context using piping
Get-AzSubscription -SubscriptionName $SubscriptionName | Set-AzContext -Name 'MyContext'
```
For details on Azure PowerShell contexts, see [Azure PowerShell context objects][PersistedCredentialsGuide].
### Discovering cmdlets
Use `Get-Command` to discover cmdlets within a specific module, or cmdlets that follow a specific
search pattern:
```powershell
# List all cmdlets in the Az.Accounts module
Get-Command -Module Az.Accounts
# List all cmdlets that contain VirtualNetwork in their name
Get-Command -Name '*VirtualNetwork*'
# List all cmdlets that contain VM in their name in the Az.Compute module
Get-Command -Module Az.Compute -Name '*VM*'
```
### Cmdlet help and examples
To view the help content for a cmdlet, use the `Get-Help` cmdlet:
```powershell
# View basic help information for Get-AzSubscription
Get-Help -Name Get-AzSubscription
# View the examples for Get-AzSubscription
Get-Help -Name Get-AzSubscription -Examples
# View the full help for Get-AzSubscription
Get-Help -Name Get-AzSubscription -Full
# View the online version of the help from https://learn.microsoft.com for Get-AzSubscription
Get-Help -Name Get-AzSubscription -Online
```
For detailed instructions on using Azure PowerShell, see the [getting started guide][GettingStartedGuide].
## Reporting Issues and Feedback
### Issues
If you find any bugs when using Azure PowerShell, file an issue in our [GitHub repo][GitHubRepo].
Fill out the issue template with the appropriate information.
Alternatively, see [Azure Community Support][AzureCommunitySupport] if you
have issues with Azure PowerShell or Azure services.
### Feedback
If there is a feature you would like to see in Azure PowerShell, use the
[`Send-Feedback`][SendFeedback] cmdlet, or file an issue in our [GitHub repo][GitHubRepo].
## Contributing
For details on contributing to this repository, see the [contributing guide][Contributing] and the [_Azure PowerShell Developer Guide_][DeveloperGuide].
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit
https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [
[email protected]](mailto:
[email protected]) with any additional questions or comments.
## Telemetry
Azure PowerShell collects telemetry data by default. Microsoft aggregates collected data to identify
patterns of usage to identify common issues and to improve the experience of Azure PowerShell.
Microsoft Azure PowerShell does not collect any private or personal data. For example, the usage
data helps identify issues such as cmdlets with low success and helps prioritize our work. While we
appreciate the insights this data provides, we also understand that not everyone wants to send usage
data. You can disable data collection with the
[`Disable-AzDataCollection`][DisableAzDataCollection] cmdlet. To learn more, see our
[privacy statement][PrivacyStatement].
## Learn More
* [Microsoft Azure Documentation][MicrosoftAzureDocs]
* [PowerShell Documentation][PowerShellDocs]
---
_This project has adopted the [Microsoft Open Source Code of Conduct][CodeOfConduct]. For more
information see the [Code of Conduct FAQ][CodeOfConductFaq] or contact
[
[email protected]][OpenCodeEmail] with any additional questions or comments._
<!-- References -->
<!-- Local -->
[GitHubRepo]: https://github.com/Azure/azure-powershell/issues
[Contributing]: CONTRIBUTING.md
[AzureIcon]: documentation/images/MicrosoftAzure-32px.png
[PowershellIcon]: documentation/images/MicrosoftPowerShellCore-32px.png
[AzurePowerShellModules]: documentation/azure-powershell-modules.md
[DeveloperGuide]: documentation/development-docs/azure-powershell-developer-guide.md
<!-- External -->
[Az]: https://img.shields.io/powershellgallery/v/Az.svg?style=flat-square&label=Az
[AzPreview]: https://img.shields.io/powershellgallery/v/AzPreview.svg?style=flat-square&label=AzPreview
[AzGallery]: https://www.powershellgallery.com/packages/Az/
[AzPreviewGallery]: https://www.powershellgallery.com/packages/AzPreview/
[DotNetFramework]: https://dotnet.microsoft.com/download/dotnet-framework-runtime
[PowerShellCore]: https://github.com/PowerShell/PowerShell/releases/latest
[ContributionGuidelines]: https://opensource.microsoft.com/collaborate/
[CodeOfConduct]: https://opensource.microsoft.com/codeofconduct/
[CodeOfConductFaq]: https://opensource.microsoft.com/codeofconduct/faq/
[OpenCodeEmail]: mailto:
[email protected]
[AzureCloudShell]: https://shell.azure.com/
[AzureCommunitySupport]: https://azure.microsoft.com/support/community/
[PrivacyStatement]: https://privacy.microsoft.com/privacystatement
<!-- Docs -->
[MicrosoftAzureDocs]: https://learn.microsoft.com/azure/
[PowerShellDocs]: https://learn.microsoft.com/powershell/
[InstallationGuide]: https://learn.microsoft.com/powershell/azure/install-az-ps
[GettingStartedGuide]: https://learn.microsoft.com/powershell/azure/get-started-azureps
[PersistedCredentialsGuide]: https://learn.microsoft.com/powershell/azure/context-persistence
[ConnectAzAccount]: https://learn.microsoft.com/powershell/module/az.accounts/connect-azaccount
[GetAzContext]: https://learn.microsoft.com/powershell/module/az.accounts/get-azcontext
[GetAzSubscription]: https://learn.microsoft.com/powershell/module/az.accounts/get-azsubscription
[SetAzContext]: https://learn.microsoft.com/powershell/module/az.accounts/set-azcontext
[SendFeedback]: https://learn.microsoft.com/powershell/module/az.accounts/send-feedback
[DisableAzDataCollection]: https://learn.microsoft.com/powershell/module/az.accounts/disable-azdatacollection
", Assign "at most 3 tags" to the expected json: {"id":"10754","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"