Azure web app path mapping using az update not working

Jayashree K C 1 Reputation point
2021-07-28T10:24:06.607+00:00

I have used the below command to update my path mappings for azure web app but it does not actually add the mapping but still shows command execution successfull.

az resource update --name acusnpdsndweb06/config/web --resource-group azrg-tax-snd-m-dev --resource-type "Microsoft.Web/sites/config" --set properties.virtualApplications="[{\"physicalPath\":\"site\wwwroot\",\"preloadEnabled\":true,\"virtualDirectories\":null,\"virtualPath\":\"/\"},{\"physicalPath\":\"site\wwwroot\ConfigService\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/configService\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020100516.2\",\"preloadEnabled\":true,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020100516.2\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020103014.2\",\"preloadEnabled\":true,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020103014.2\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020103018.1\",\"preloadEnabled\":true,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020103018.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020103021.1\",\"preloadEnabled\":true,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020103021.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020110421.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020110421.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020120707.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020120707.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2020120810.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2020120810.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021020501.2\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021020501.2\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021021002.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021021002.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021033019.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021033019.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021033023.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021033023.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021033103.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021033103.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021033104.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021033104.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021040700.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021040700.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021040918.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021040918.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021061217.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021061217.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021072316.1\",\"preloadEnabled\":true,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021072316.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021072615.1\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021072615.1\"},{\"physicalPath\":\"site\wwwroot\FileManagerService\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerService\"},{\"physicalPath\":\"site\wwwroot\FMApiStoargeChangeTest\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/FMApiStoargeChangeTest\"},{\"physicalPath\":\"site\wwwroot\FileManagerApi2021072719.1\",\"preloadEnabled\":false\"virtualDirectories\":null,\"virtualPath\":\"/FileManagerApi2021072719.1\"}]"

Please check

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,755 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,886 Reputation points
    2021-07-29T18:50:57.827+00:00

    Hi @Jayashree K C ,

    Thanks for brining this to our attention. What version of CLI are you using? Is this a Linux or windows based app?have you tried updating your map pathing through the portal?

    Based on this similar Github thread, az resource update is not designed to support updating the webapp config.

    If you want to update the configuration of webapp, the following command should be executed:

    az webapp config set --name {resource-name} -g {resource-group} --generic-configurations "{\"virtualApplications\":[{\"physicalPath\":\"site\wwwroot\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/\"},{\"physicalPath\":\"site\wwwroot\v2\flow-server\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/flow\"},{\"physicalPath\":\"site\wwwroot\v2\iris-server\",\"preloadEnabled\":false,\"virtualDirectories\":null,\"virtualPath\":\"/iris\"}]}"

    Because only this command implements the function of Web Apps - Create Or Update Configuration.

    It might be also helpful to check out this documentation regarding quoting best practices when using CLI.

    Hope that helps.

    -Grace

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.