2

I am trying to get a specific Microsoft Azure Website resource, so that I can change some of its properties. To get a single resource, Get-AzureResource requires the ApiVersion property. Where do I find this?

Parameter Set: Get a single resource

Get-AzureResource 
    [-Name] <String> 
    -ApiVersion <String> 
    -ResourceGroupName <String> 
    -ResourceType <String> 
    [-ParentResource <String> ] 
    [ <CommonParameters>]

See http://msdn.microsoft.com/en-us/library/dn654579.aspx

2 Answers 2

4

I found the answer here.

Run the following in PowerShell.

$DebugPreference='Continue'
Get-AzureResourceGroup

The debug output will start like this:

DEBUG: 5:25:10 PM - GetAzureResourceGroupCommand begin processing with ParameterSet 'GetMultiple'.
DEBUG: 5:25:10 PM - using account id '[email protected]'...
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
POST

Absolute Uri:
https://management.azure.com/subscriptions/12345678-1234-1234-1234-1234567890ab/providers/microsoft.batch/register?api-version=2014-04-01-preview

Inspect the Absolute Uri - the query string parameter is api-version.

  • https://management.azure.com/
  • subscriptions/
  • 12345678-1234-1234-1234-1234567890ab/
  • providers/
  • microsoft.batch/
  • register?
  • api-version=2014-04-01-preview

Where you're done, run the following in PowerShell to stop the debug output.

$DebugPreference='SilentlyContinue'
3

Here is how to get a particular website Resource details.

Switch-AzureMode -Name AzureResourceManager

$website = Get-AzureResource -ResourceType "Microsoft.Web/sites" | where {$_.Name -eq "<*YOURWEBSITENAME*>"}

$websiteName = $website.Name

$websiteResource = $website.ParentResource

$websiteResourceId = $website.ResourceId

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.