Last active
August 29, 2021 20:31
-
-
Save gpsarkar/fac4128c925e3c2de4c5e70884aa78fd to your computer and use it in GitHub Desktop.
azure powershell notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get ps version | |
Get-Host | Select-Object Version | |
$PSVersionTable.PSVersion | |
// get azure powershell version | |
Get-Module -ListAvailable -Name Az | |
Get-Module -ListAvailable -Name Azure -Refresh | |
// get apim services | |
Get-AzApiManagement | |
// get apim service by id | |
Get-AzApiManagement -ResourceId /subscriptions/GUID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.ApiManagement/service/SERVICENAME | |
// get all apis | |
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "RESOURCE_GROUP" -ServiceName "SERVICENAME" | |
Get-AzApiManagementApi -Context $ApiMgmtContext | |
//Create new aspi | |
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "RESOURCE_GROUP" -ServiceName "SERVICENAME" | |
New-AzApiManagementApi -Context $ApiMgmtContext -Name "gs test api" -ServiceUrl "https://URL" -Protocols @("http", "https") -Path "dev" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment