2
votes

In azure logic apps is there any validity or expiration time for SAS token, as it I'll be in the URL if the expiration time is there then URL will change.

1

1 Answers

3
votes

If you are sharing the URL with other parties, you can generate URLs with specific keys and expiration dates as needed. You can then seamlessly roll keys, or ensure access to fire an app is restricted to a certain time span.

You can specify an expiration date for a URL through the logic apps REST API:

POST 
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl?api-version=2016-06-01

In the body, include the property NotAfter as a JSON date string, which returns a callback URL that is only valid until the NotAfter date and time.

enter image description here To add an expiration date to the trigger of the Logic App, open the LogicApp.json in code view in Visual Studio. Locate the triggers section and add the following to it inside the schema section:

"NotAfter": "2018-06-01T11:00:00.511Z"

Adjust the date and time to your needs. The triggers section will now look like below:

"triggers": {
          "manual": {
            "type": "Request",
            "kind": "Http",
            "inputs": {
              "schema": {
                "NotAfter": "2018-06-01T11:00:00.511Z",
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ]
              },
              "method": "POST"
            }
          }
        },

For more details, refer to this article to Callback URLs with an expiration date