Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web App update method is not updating resource configuration #30625

Open
1 of 6 tasks
sdsubhajitdas opened this issue Aug 2, 2024 · 12 comments
Open
1 of 6 tasks

Web App update method is not updating resource configuration #30625

sdsubhajitdas opened this issue Aug 2, 2024 · 12 comments
Assignees
Labels
App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@sdsubhajitdas
Copy link

  • Package Name: @azure/arm-appservice
  • Package Version: 15.0.0
  • Operating system: macOS Sonoma Version 14.5
  • nodejs
    • version: 20.14.0
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
I have an Azure Web App where I am using the following code to get the Web App configuration

const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");
const util = require("util");

async function main() {
  const subscriptionId = "<subscription_id>";
  const client = new WebSiteManagementClient(new DefaultAzureCredential(), subscriptionId);

  let webAppConfiguration = await client.webApps.getConfiguration("<resource_group>", "<web_app_name>");
  console.log(util.inspect(webAppConfiguration, { depth: null }));
}
main();

In the webAppConfiguration, I see that my ftpsState field value is disabled.

Now I am trying to use the following code to update the Web App configuration

const { WebSiteManagementClient } = require("@azure/arm-appservice");
const { DefaultAzureCredential } = require("@azure/identity");
const util = require("util");

async function main() {
  const subscriptionId = "<subscription_id>";
  const client = new WebSiteManagementClient(new DefaultAzureCredential(), subscriptionId);

  await client.webApps.update("<resource_group>", "<web_app_name>", {
    siteConfig: { ftpsState: "Disabled" },
  });

  let webAppConfiguration = await client.webApps.getConfiguration("<resource_group>", "<web_app_name>");
  console.log(util.inspect(webAppConfiguration, { depth: null }));
}
main();

After updating the configuration and checking the output I still see that in the webAppConfiguration object ftpsState value is still set to disabled.

To Reproduce
Steps to reproduce the behavior:
1.

Expected behavior
I expected the webApps.update function to update the Web App configuration with the value Disabled for the ftpsState field. Instead, I see the value is still set to disabled.

Screenshots
Screenshot 2024-08-02 at 3 15 31 PM

Additional context
When I first tried to update the configuration of the Web App I called the update method with the following

{
    siteConfig: { ftpsState: "disabled" }
}

I later realized the allowed value was Disabled instead of disabled.

@github-actions github-actions bot added App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. labels Aug 2, 2024
Copy link

github-actions bot commented Aug 2, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp @AzureAppServiceCLI.

@kazrael2119
Copy link
Contributor

will check

@kazrael2119
Copy link
Contributor

kazrael2119 commented Aug 5, 2024

@sdsubhajitdas , appservice has a api named updateConfiguration(),
could you use that? I think client.webApps.update() may not work for configuration.
as when I called webApps.get(), the ftpsState from the result is null, but I calledwebApps.getConfiguration(), the ftpsState is disabled.
here is my code to test:

    const result=await client.webApps.getConfiguration(resourceGroupName,"czwapp");
    console.log(result.ftpsState);

    const res=await client.webApps.update(resourceGroupName,"czwapp",
      {
        siteConfig:{ftpsState: "AllAllowed"} 
      }
    );
    console.log(res.siteConfig?.ftpsState)

    const res1=await client.webApps.updateConfiguration(resourceGroupName,"czwapp",
      {
        ftpsState: "Disabled"
      }
    )
    console.log(res1.ftpsState)

and the result is :

disabled
null
Disabled

@kazrael2119 kazrael2119 removed the Service Attention Workflow: This issue is responsible by Azure service team. label Aug 5, 2024
@sdsubhajitdas
Copy link
Author

Thanks for the response @kazrael2119 .
I tried the updateConfiguration API and yes it works.
From your testing code, I can see that you are transitioning from AllAllowed -> Disabled, which also works for me.
But I am trying to transition from disabled -> Disabled state.

@kazrael2119
Copy link
Contributor

kazrael2119 commented Aug 5, 2024

Thanks for the response @kazrael2119 . I tried the updateConfiguration API and yes it works. From your testing code, I can see that you are transitioning from AllAllowed -> Disabled, which also works for me. But I am trying to transition from disabled -> Disabled state.

you can ignore

const res=await client.webApps.update(resourceGroupName,"czwapp",
      {
        siteConfig:{ftpsState: "AllAllowed"} 
      }
    );

this one is tell you that webapp.update() doesn't work. the ftpsState result from webApps.get() is null and I try to update it as AllAllowed but it is still null.
you can see first I get the configuration and the ftpsState is disabled, and then I call the updateConfiguration(), the result is changed to Disabled

@sdsubhajitdas
Copy link
Author

sdsubhajitdas commented Aug 6, 2024

@kazrael2119

Here is my code to test

  const client = new WebSiteManagementClient(new DefaultAzureCredential(), subscriptionId);

  let webAppConfiguration = await client.webApps.getConfiguration(resourceGroup, webAppName);
  console.log("Web App Configuration Before Update");
  console.log(webAppConfiguration.ftpsState);

  console.log("Updating configuration...");
  let result = await client.webApps.updateConfiguration(resourceGroup, webAppName, {
    ftpsState: "Disabled"
  });
  console.log(result.ftpsState);

  webAppConfiguration = await client.webApps.getConfiguration(resourceGroup, webAppName);
  console.log("Web App Configuration After Update");
  console.log(webAppConfiguration.ftpsState);

and the output for the following

Web App Configuration Before Update
disabled
Updating configuration...
disabled
Web App Configuration After Update
disabled

The state is not changing from disabled to Disabled.

@kazrael2119
Copy link
Contributor

kazrael2119 commented Aug 6, 2024

I tried to debug this case and I found that the request body is Disabled but the response is still diasbled. I think this should be a service issue.

Normally, on portal we can select three value for ftps states:
image
but when I updated the status as disabled, this value is null on portal:
image

I guess in the server side does not distinguish between uppercase and lowercase, but supports the use of lowercase if using sdks

@kazrael2119
Copy link
Contributor

Add Service attention for awareness

@kazrael2119 kazrael2119 added the Service Attention Workflow: This issue is responsible by Azure service team. label Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @antcp @AzureAppServiceCLI.

@qiaozha
Copy link
Member

qiaozha commented Aug 7, 2024

@sdsubhajitdas since this is a service backend issue, could you open a support ticket to get better support from them directly https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request, thank you.

@qiaozha qiaozha added needs-author-feedback Workflow: More information is needed from author to address the issue. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Aug 28, 2024
Copy link

Hi @sdsubhajitdas. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Copy link

github-actions bot commented Sep 4, 2024

Hi @sdsubhajitdas, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Services customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants