How to add the Path based rules in a App gateway listener for Backend target using the Azure CLI Command

Md Rahman 0 Reputation points
2024-04-26T07:16:00.2133333+00:00

I am able to create the path based rule for the backend target in our Application gateway Listener using the Azure portal but I need to push the changes either the Terraform Code or the Azure CLI command. Could someone help me to share the azure command line to make the changes.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,069 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 49,601 Reputation points Microsoft Employee
    2024-04-26T08:27:24.8133333+00:00

    Hello @Md Rahman ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know how to add the Path based rules in an Azure Application gateway using the Azure CLI Command.

    You can refer the below article which shows App gateway path-based rule configuration via Azure CLI:

    https://learn.microsoft.com/en-us/azure/application-gateway/tutorial-url-route-cli#add-a-url-path-map

    And below is the Azure CLI document with all the available commands for path-based rules:

    https://learn.microsoft.com/en-us/cli/azure/network/application-gateway/url-path-map?view=azure-cli-latest

    To create a rule for a URL path map, you can use the below command:

    az network application-gateway url-path-map rule create -g MyResourceGroup --gateway-name MyAppGateway -n MyUrlPathMapRule2 --path-map-name MyUrlPathMap --paths /mypath2/* --address-pool MyAddressPool --http-settings MyHttpSettings
    
    

    Refer: https://learn.microsoft.com/en-us/cli/azure/network/application-gateway/url-path-map/rule?view=azure-cli-latest#az-network-application-gateway-url-path-map-rule-create

    To update a URL path map, you can use the below command:

    az network application-gateway url-path-map update -g MyResourceGroup --gateway-name MyAppGateway -n MyUrlPathMap --default-http-settings MyNewHttpSettings
    
    

    Refer: https://learn.microsoft.com/en-us/cli/azure/network/application-gateway/url-path-map?view=azure-cli-latest#az-network-application-gateway-url-path-map-update

    If you need any specific command, please let us know.

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    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.