Open lwajswaj opened 6 years ago
@lwajswaj I don't see the error mentioned in this repro - is this the cmdlet invocation that produced the error?
Also, after producing the error, in addition to the Debug log, can you provide the results of runnign Resolve-AzureRmError
It's not an actual error, it's that I don't get anything. when I run this line
$vip = Get-AzureRmResource -ResourceGroupName ResourceGroupName -ResourceType Microsoft.Web/hostingEnvironments/capacities -ResourceName ASEName/virtualip -debug -ApiVersion 2018-02-01
I get nothing although in the response the data is there, it doesn't get processed
@lwajswaj Got it, thanks.
@Tiano2017 looking at the first scenario, where the user is providing both the -ResourceId
and -ApiVersion
parameters, the generic HttpClient is used to make the call rather than the ARM SDK (second scenario), and a resposne is received, but is not parsed. Would you know why this would occur?
Still an issue in 6.13.1 release
This also prevents the ASE ILB address from being available to use as the output of an ARM template.
InternalServerError: ResourceDeploymentFailure
The response for resource had empty or invalid content
Is there any update on this issue. I am still not able to see ILB ip with the above command. In ARM template also i am not able to retrieve it.
I concur. I am trying to get the internalIpAddress
from resource /capacities/virtualip
, but ARM deployment fails with error The response for resource had empty or invalid content.
I am using the following method to try to retrieve this value:
"[reference(resourceId('Microsoft.Web/hostingEnvironments/capacities/', parameters('aseName'), 'virtualip'), '2019-08-01', 'Full').internalIpAddress]"
@murdockcrc /capacities/virtualip won't work due to the above issue.You can get the ip after deploying appservice in ase plan.This is kind a workaround
@kdevesh do I have to deploy a web app, or would an app service plan suffice?
@murdockcrc in order to deploy a web app you need an app service plan.You can create the app service plan in the ASE and then create the web app from there you can get the IP address
I managed to use a workaround with powershell. But if the internal private frontend IP address is already available in the portal and in resources.azure.com, I believe this same value should be retrievable via ARM. I'd suggest for the team to take a look at this and extend the functionality of the ARM RP. Thx.
As I'm failing to get the addresses after creating ASP and Azure Portal has the IPv4-addresses on newly created ASE without ASP, I'm getting the values from API https://docs.microsoft.com/en-us/rest/api/appservice/appserviceenvironments/getvipinfo.
The obvious problem is to gain access to the required bearer token. As I need the token for other API-calls which are not available as PowerShell cmdlets, it's not a big thing.
I can still repro the error, even though there is already an app service plan and a web app deployed on the ASE. The following Posh command returns empty:
Get-AzureRmResource -ResourceGroupName "ResourceGroupName" -ResourceType Microsoft.Web/hostingEnvironments/capacities -ResourceName ASEName/virtualip
The same value can be retrieved with azcli successfully. Seems to be indeed a bug in powershell:
az resource show --ids $aseFullId --query "internalIpAddress"
After debugging the code, I found that the response for Microsoft.Web/hostingEnvironments/capacities in the powershell get resource doesn't follow a format that works for serialization.
The RP is returning, for example, this:
{ "serviceIpAddress": "52.224.160.164", "internalIpAddress": "10.0.0.11", "outboundIpAddresses": [ "52.224.160.164" ], "vipMappings": []}
It should return something more like this, (this is a public ip object, note that it has id, name, type, location and other things)
{{ "id": "/subscriptions/0dffc609-7841-43d0-a884-60eb80d1a19c/resourceGroups/github_ezgambac_ps_issue/providers/Microsoft.Network/publicIPAddresses/AzFirewall-pip", "name": "AzFirewall-pip", "type": "Microsoft.Network/publicIPAddresses", "sku": { "name": "Standard" }, "location": "eastus", "tags": { "tag1": "value1", "tag2": "value2" }}}
I think the response the RP is sending should be part of the properties property in the resource class (https://github.com/Azure/azure-powershell/blob/master/src/Resources/ResourceManager/Entities/Resources/Resource.cs).
The response from the RP should be able to be parsed as that c# object.
When will this resource type return a valid resource structure?
{
"id": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Web/hostingEnvironments/{ase-name}/capacities/virtualip",
"name": "virtualip",
"properties": {
"serviceIpAddress": "x.x.x.x",
"internalIpAddress": "x.x.x.x",
"outboundIpAddresses": [
"x.x.x.x"
],
"vipMappings": []
}
}
Is it that hard to fix? it's been more than 2 years
this is what we get today
{
"serviceIpAddress": "x.x.x.x",
"internalIpAddress": "x.x.x.x",
"outboundIpAddresses": [
"x.x.x.x"
],
"vipMappings": []
}
It's really hard to automate these deployments. Service plans are planned outside of the ASE deployment. We need to deploy:
Then other teams deploy Service Plans based on requirements
Any update on that ?
@madsd is this something you can assist with?
@madsd is this something you can assist with?
@apwestgarth looking at this - this is using an API directly & not specific to an App Service command. I will let @madsd comment as well - but might be API related .
Thanks @madsd & @miwebst . @MartinAngelov As per the ASE team this was fixed with api-version 2019-08-01 & higher so change the command to use this api-version & this should work.
ARM Template Solution
For anyone who comes here from Google in the future: How to access the Internal IP address of an ILB ASE (Internal Load Balancer App Service Environment) through an ARM Template.
The following reference function works for me:
"[reference(resourceId('Microsoft.Web/hostingEnvironments/capacities/', variables('aseName'), 'virtualip'), '2019-08-01', 'Full')]"
And the full object has the internalIpAddress
, which you can get using:
"value": "[reference(resourceId('Microsoft.Web/hostingEnvironments/capacities/', variables('aseName'), 'virtualip'), '2019-08-01', 'Full').properties.internalIpAddress]"
I believe that any API version after 2019-08-01 should also work, but my only evidence for that is @panchagnula 's comment.
I think this theoretically fully resolves this issue?
Description
No Provider for "Microsoft.Web/hostingEnvironments/capacities"; unable to retrieve ASE ILB Private IP. If I include -ApiVersion, the body contains the information but it isn't parsed; otherwise, the body is empty.
Script/Steps for Reproduction
Module Version
Environment Data
Debug Output