Is there a way to restart an Azure webapp after de...
# azure
s
Is there a way to restart an Azure webapp after deployment using pulumi (without the Azure CLI). We are running into a problem where this said app needs access to a KeyVault, but when the app is created/started the RBAC is not there yet. Thanks!
t
When would you call this restart? I guess it doesn’t make sense to do so immediately after creation?
s
We have the following Pulumi code:
Copy code
var vault = new KeyVault(...);

var app = new AppService(...);

// Workaround to get app's identity: <https://github.com/pulumi/pulumi/issues/5071#issuecomment-669281090>
var appGet = AppService.Get(...);

new Assignment(...); // give App access to KeyVault
Now the problem is that when the
Assignment
is given, the app is already running. A restart after the
Assignment
would fix this issue. We are now doing it after the DevOps
Pulumi@1
task, using an
AzureCli@2
task (it works). We were wondering if there is a pulumi mechanism to achieve the same.
t
There’s no Pulumi resource to restart a web app, so you need to call either Azure CLI or Azure SDK (could be from within the program or outside as you do)
s
Yes I see. Thanks!