How can we find Properties or Config setting of Azure Resources using PowerShell?

Ravikumar P 21 Reputation points
2020-10-27T05:03:17.513+00:00

Hi All

How can we find Properties or Config setting of Azure Resources using PowerShell?

In which situation do we need to use APIVERSION in PowerShell

I need to change my config setting on Azure resources using PowerShell

Could you please help me to understand the concept of this

Regards,

Ravi P

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
553 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
965 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,963 questions
{count} votes

Accepted answer
  1. Krish G 2,326 Reputation points
    2020-10-27T13:08:48.027+00:00

    @Ravikumar P , To get 'Properties' of any type of Azure resources in Powershell, you can use Get-AzResource in Powershell. For example:

    (Get-AzResource  -Name myWebApp -ResourceGroupName myResourceGroup).Properties  
    

    will show the properties of the web app named 'myWebApp' in resource group 'myResourceGroup'. There are many variations of the 'Get-AzResource' cmdlet input which you can explore here.

    If you are looking specifically for config settings for any specific type of resources then the command will depend on the type of the resource. For example in Web App, you can use Set-AzWebApp.

    Set-AzWebApp -Name myWebApp -ResourceGroupName myResourceGroup -AppSettings @{myKey1=myValue1; myKey2=myValue2;}  
    

    You can explore the required cmdlet for your specific service in PowerShell Module Browser. For overall Azure powershell walkthrough, you can refer Azure PowerShell documentation

    Regarding your question,

    In which situation do we need to use APIVERSION in PowerShell

    You don't need actually for Powershell. APIVERSION is applicable for the exposed APIs for the management APIs of different resources behind the scene. When you use Powershell cmdlet, it calls a specific version of the API tied to version of the Az module you are using (for example, it might be 2018-10-12 for a specific module). You might come across a situation when a new feature/update is possible in a newer API version in future at which point you need to update your Az modules if you want to leverage that. Also, Azure maintains several old API versions for sometime for backwards compatibility with old code/script. For overall resource management, you can refer Managing resources documentation.

    Note: On the other hand if you use ARM template for resource deployment, you have a option of specifying API version in the template json itself.

    0 comments No comments

0 additional answers

Sort by: Most helpful