azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

webapp object does not include kind

Open anyasabo opened this issue 10 years ago • 3 comments

Cmdlet(s)

Get-AzureRmWebApp

PowerShell Version

5.1.14393.0

Module Version

3.0.0

OS Version

10.0.14393.0

Description

Get-AzureRmWebApp's output doesn't include a Kind property, which indicates if the app is a web, mobile, or API app. This info is returned from the API as shown in the debug output, it just does not make its way into the Site object. As is there's not an easy way to tell what kind of a site you are working with in powershell.

Debug Output

Here's a slice of the Debug output, with the kind set to api. It will also indicate mobileapp, or null (for vanilla web apps).

        "microService": "WebSites",
        "gatewaySiteName": null,
        "clientAffinityEnabled": true,
        "clientCertEnabled": false,
        "hostNamesDisabled": false,
        "domainVerificationIdentifiers": null,
        "kind": "api",
        "outboundIpAddresses": "redacted",
        "containerSize": 0,
        "dailyMemoryTimeQuota": 0,
        "suspendedTill": null,
        "siteDisabledReason": 0,
        "functionExecutionUnitsCache": null,
        "maxNumberOfWorkers": null,
        "homeStamp": "waws-prod-dm1-d078a68a",

But none of the members of a Site object have a way to retrieve this, unless I'm missing it. There is a MicroService property but it appears to always be set to WebSites:

   TypeName: Microsoft.Azure.Management.WebSites.Models.Site

Name                      MemberType Definition                                                                                                                
----                      ---------- ----------                                                                                                                
Equals                    Method     bool Equals(System.Object obj)                                                                                            
GetHashCode               Method     int GetHashCode()                                                                                                         
GetType                   Method     type GetType()                                                                                                            
ToString                  Method     string ToString()                                                                                                         
Validate                  Method     void Validate()                                                                                                           
AvailabilityState         Property   System.Nullable[Microsoft.Azure.Management.WebSites.Models.SiteAvailabilityState] AvailabilityState {get;}                
ClientAffinityEnabled     Property   System.Nullable[bool] ClientAffinityEnabled {get;set;}                                                                    
ClientCertEnabled         Property   System.Nullable[bool] ClientCertEnabled {get;set;}                                                                        
CloningInfo               Property   Microsoft.Azure.Management.WebSites.Models.CloningInfo CloningInfo {get;set;}                                             
ContainerSize             Property   System.Nullable[int] ContainerSize {get;set;}                                                                             
DefaultHostName           Property   string DefaultHostName {get;}                                                                                             
Enabled                   Property   System.Nullable[bool] Enabled {get;set;}                                                                                  
EnabledHostNames          Property   System.Collections.Generic.IList[string] EnabledHostNames {get;}                                                          
GatewaySiteName           Property   string GatewaySiteName {get;set;}                                                                                         
HostingEnvironmentProfile Property   Microsoft.Azure.Management.WebSites.Models.HostingEnvironmentProfile HostingEnvironmentProfile {get;set;}                 
HostNames                 Property   System.Collections.Generic.IList[string] HostNames {get;}                                                                 
HostNamesDisabled         Property   System.Nullable[bool] HostNamesDisabled {get;set;}                                                                        
HostNameSslStates         Property   System.Collections.Generic.IList[Microsoft.Azure.Management.WebSites.Models.HostNameSslState] HostNameSslStates {get;set;}
Id                        Property   string Id {get;set;}                                                                                                      
IsDefaultContainer        Property   System.Nullable[bool] IsDefaultContainer {get;}                                                                           
LastModifiedTimeUtc       Property   System.Nullable[datetime] LastModifiedTimeUtc {get;}                                                                      
Location                  Property   string Location {get;set;}                                                                                                
MaxNumberOfWorkers        Property   System.Nullable[int] MaxNumberOfWorkers {get;set;}                                                                        
MicroService              Property   string MicroService {get;set;}                                                                                            
Name                      Property   string Name {get;set;}                                                                                                    
OutboundIpAddresses       Property   string OutboundIpAddresses {get;}                                                                                         
PremiumAppDeployed        Property   System.Nullable[bool] PremiumAppDeployed {get;}                                                                           
RepositorySiteName        Property   string RepositorySiteName {get;}                                                                                          
ResourceGroup             Property   string ResourceGroup {get;}                                                                                               
ScmSiteAlsoStopped        Property   System.Nullable[bool] ScmSiteAlsoStopped {get;set;}                                                                       
ServerFarmId              Property   string ServerFarmId {get;set;}                                                                                            
SiteConfig                Property   Microsoft.Azure.Management.WebSites.Models.SiteConfig SiteConfig {get;set;}                                               
SiteName                  Property   string SiteName {get;set;}                                                                                                
State                     Property   string State {get;}                                                                                                       
Tags                      Property   System.Collections.Generic.IDictionary[string,string] Tags {get;set;}                                                     
TargetSwapSlot            Property   string TargetSwapSlot {get;}                                                                                              
TrafficManagerHostNames   Property   System.Collections.Generic.IList[string] TrafficManagerHostNames {get;}                                                   
Type                      Property   string Type {get;set;}                                                                                                    
UsageState                Property   System.Nullable[Microsoft.Azure.Management.WebSites.Models.UsageState] UsageState {get;}                                  

Script/Steps for Reproduction

Get-AzureRmWebApp -Debug while a mobile or API app exists.

anyasabo avatar Oct 25 '16 14:10 anyasabo

@akurmi Hey Ashish, would you mind taking a look at this issue?

cormacpayne avatar Oct 25 '16 16:10 cormacpayne

Please assign this to @LukaszStem and include him in all future discussions as he is the new PowerShell owner for App Service. @ahmedelnably

akurmi avatar Oct 25 '16 23:10 akurmi

@jonsabo this has been fixed a while back. I tested with our preview-version https://github.com/Azure/azure-powershell/releases/tag/v5.0.0-preview-AzureRM.Websites

panchagnula avatar Mar 09 '18 23:03 panchagnula