You can use code to create a service SAS token
for that queue(for example, the queue named queueA), then associate it with Stored Access Policy
.
For example(please modify the code to meet your need):
QueueClient queueClient = new QueueClient(connectionString, "queueA");
//create a service SAS
QueueSasBuilder sasBuilder = new QueueSasBuilder()
{
QueueName = "queueA",
//set the ip here
IPRange = new SasIPRange(IPAddress.Parse("172.16.0.1"))
};
//associate the service SAS with the Stored Access Policy
sasBuilder.Identifier = storedPolicyName;
//then you can use this uri with sas token to operate this queue
Uri sasUri = queueClient.GenerateSasUri(sasBuilder);
For more details, you can refer to this article(it's for blob storage, but you can easy to modify it for queue storage).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…